/* ================================================
   DIVINSHKA – HEADER CSS
   Top bar + Nav principale + Barre catégories
   + Mega menu AJAX
   ================================================ */

/* ── STRUCTURE GÉNÉRALE ── */
#masthead,
.ast-header-break-point .ast-header,
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: none;
    transition: box-shadow 0.4s ease;
}
.ast-sticky-active #masthead,
.ast-header-sticked {
    box-shadow: 0 2px 28px rgba(0,0,0,0.10) !important;
}

/* ─────────────────────────────────────────────
   ROW 1 – TOP BAR DIVINSHKA
   ───────────────────────────────────────────── */
.dv-topbar {
    background: #ECF2F5;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 44px;
    font-size: 11px;
    letter-spacing: 0.3px;
    color: #222;
    position: relative;
    z-index: 1001;
}
.dv-topbar__left {
    font-weight: 600;
}
.dv-topbar__left a { color: #222; }
.dv-topbar__right {
    display: flex;
    align-items: center;
}
.dv-topbar__right a {
    color: #333;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0 14px;
    line-height: 34px;
    transition: color 0.2s ease;
    text-decoration: none;
}
.dv-topbar__right a:hover { color: var(--dv-gold); }

/* ─────────────────────────────────────────────
   ROW 2 – NAVIGATION PRINCIPALE
   ───────────────────────────────────────────── */
.dv-main-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 44px;
    height: 84px;
    background: #121212;
}

/* Nav gauche */
.dv-nav-left {
    display: flex;
    align-items: center;
    gap: 34px;
}
.dv-nav-left a {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.dv-nav-left a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: var(--dv-gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.dv-nav-left a:hover { color: #fff; }
.dv-nav-left a:hover::after,
.dv-nav-left a.current_page_item::after,
.dv-nav-left a.active::after { transform: scaleX(1); }
.dv-nav-left a.active { font-weight: 600; color: #fff; }

/* Logo centré */
.dv-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}
.dv-logo__main {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 6px;
    color: #fff;
    text-transform: uppercase;
    font-style: italic;
    transition: opacity 0.2s ease;
}
.dv-logo:hover .dv-logo__main { opacity: 0.75; }
.dv-logo__sub {
    font-family: 'Jost', sans-serif;
    font-size: 7.5px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-top: 6px;
    font-style: normal;
    font-weight: 400;
}

/* Nav droite – search + icônes */
.dv-nav-right {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-end;
}
.dv-search-bar {
    display: flex;
    align-items: center;
    background: #2a2a2a;
    border-radius: 3px;
    padding: 0 13px;
    height: 34px;
    gap: 9px;
    width: 200px;
    margin-right: 6px;
    transition: width 0.3s ease, background 0.2s ease;
}
.dv-search-bar:focus-within {
    width: 240px;
    background: #1a1a1a;
}
.dv-search-bar input {
    border: none;
    background: transparent;
    font-family: 'Jost', sans-serif;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.8);
    outline: none;
    width: 100%;
}
.dv-search-bar input::placeholder { color: rgba(255,255,255,0.35); }
.dv-search-bar i,
.dv-search-bar svg { font-size: 12px; color: rgba(255,255,255,0.5); flex-shrink: 0; }

.dv-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    background-color: transparent !important;
    border: none;
    transition: color 0.2s ease;
    text-decoration: none;
}
.dv-icon-btn:hover { color: var(--dv-gold); }

/* Badge panier */
.dv-cart-count {
    position: absolute;
    top: 3px; right: 2px;
    background: var(--dv-gold);
    color: var(--dv-dark);
    font-size: 8px;
    font-weight: 700;
    width: 14px; height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─────────────────────────────────────────────
   ROW 3 – BARRE CATÉGORIES
   ───────────────────────────────────────────── */
.dv-cat-nav {
    background: #F7F7F7;
    height: 40px;
    display: flex;
    align-items: stretch;
    padding: 0 28px;
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.065);
}

.dv-cat-item {
    position: static;
    display: flex;
    align-items: stretch;
}
.dv-cat-item > a,
.dv-cat-item > button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    font-family: 'Jost', sans-serif;
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: #444;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}
.dv-cat-item > a:hover,
.dv-cat-item > button:hover,
.dv-cat-item.is-open > a,
.dv-cat-item.is-open > button {
    color: var(--dv-dark);
    border-bottom-color: var(--dv-dark);
}
.dv-cat-item.is-sans-sucre > a {
    color: #5fc7e2;
}
.dv-cat-item.is-sans-sucre > a:hover {
    color: #3bb8d6;
    border-bottom-color: #5fc7e2;
}
.dv-cat-chevron {
    font-size: 7.5px;
    opacity: 0.45;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.dv-cat-item > button:hover .dv-cat-chevron,
.dv-cat-item.is-open .dv-cat-chevron { opacity: 0.85; }
.dv-cat-item.is-open .dv-cat-chevron { transform: rotate(180deg); }

/* Right side – MAD + langue */
.dv-cat-right {
    margin-left: auto;
    display: flex;
    align-items: stretch;
}
.dv-cat-currency {
    padding: 0 12px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #555;
    border-left: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s ease;
}
.dv-cat-currency:hover { color: var(--dv-dark); }
.dv-cat-lang {
    display: flex;
    align-items: stretch;
    border-left: 1px solid rgba(0,0,0,0.08);
}
.dv-cat-lang a {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 1.2px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    border-right: 1px solid rgba(0,0,0,0.08);
    transition: color 0.2s ease;
    text-decoration: none;
}
.dv-cat-lang a:last-child { border-right: none; }
.dv-cat-lang a:hover { color: var(--dv-dark); }
.dv-cat-lang a.is-active { color: var(--dv-dark); font-weight: 600; }

/* ─────────────────────────────────────────────
   MEGA MENU DROPDOWN
   ───────────────────────────────────────────── */
.dv-backdrop {
    position: fixed;
    inset: 0;
    top: 158px;
    background: rgba(0,0,0,0.28);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.dv-backdrop.is-visible { display: block; opacity: 1; }

.dv-dropdown {
    position: fixed;
    top: 158px;
    left: 0; right: 0;
    background: #fff;
    border-top: 2px solid var(--dv-gold);
    box-shadow: 0 12px 40px rgba(0,0,0,0.11);
    z-index: 999;
    padding: 36px 60px;
    display: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}
.dv-dropdown.is-open { display: flex; pointer-events: auto; }
.dv-dropdown.is-visible { opacity: 1; transform: translateY(0); }

.dv-dropdown__inner {
    max-width: var(--dv-container);
    margin: 0 auto;
    width: 100%;
    display: grid;
    gap: 40px;
}
.dv-dropdown__inner--4 { grid-template-columns: repeat(4, 1fr); }
.dv-dropdown__inner--3 { grid-template-columns: repeat(3, 1fr); }
.dv-dropdown__inner--5 { grid-template-columns: repeat(5, 1fr); }

/* Colonne texte */
.dv-dropdown__col h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--dv-dark);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    letter-spacing: 0.5px;
}
.dv-dropdown__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.dv-dropdown__col ul li a {
    font-size: 13px;
    color: #555;
    display: block;
    padding-left: 0;
    transition: color 0.2s ease, padding-left 0.2s ease;
    text-decoration: none;
}
.dv-dropdown__col ul li a:hover {
    color: var(--dv-dark);
    padding-left: 7px;
}
.dv-dropdown__col ul li a.dv-see-all {
    color: var(--dv-dark);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* Colonne image */
.dv-dropdown__img-col {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    cursor: pointer;
}
.dv-dropdown__img-col img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.dv-dropdown__img-col:hover img { transform: scale(1.04); }
.dv-dropdown__img-col .label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.58));
    color: white;
    padding: 24px 14px 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* Spinner AJAX dans dropdown */
.dv-dropdown__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    width: 100%;
}
.dv-spinner {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: var(--dv-gold);
    border-radius: 50%;
    animation: dv-spin 0.7s linear infinite;
}
@keyframes dv-spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   ASTRA OVERRIDES HEADER
   ───────────────────────────────────────────── */

/* Masquer le header Astra par défaut, on utilise le nôtre */
.ast-header-break-point .ast-above-header-wrap,
.ast-above-header,
.ast-primary-header-bar {
    display: none !important;
}

/* Si vous utilisez Elementor pour le header, rien à faire */
/* Si vous utilisez l'hook wp_body_open, le header Divinshka s'insère avant */
