/**
 * Header CSS — De Anciola
 * Version corrigée et fidèle au site deanciola.com
 *
 * @package deanciola
 * @version 3.0.3
 */

/* ========================================
   HEADER — STRUCTURE STICKY
   ======================================== */

.de-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #00222E;
    z-index: 9000;
}

/* Ligne principale */
.de-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 72px;
    padding: 0 40px;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Second niveau — barre de recherche étendue (caché par défaut) */
.de-header-search-bar {
    display: none;
    align-items: center;
    padding: 0 40px 14px;
    gap: 12px;
    background: #1A202C;
}

.de-header-search-bar.active {
    display: flex;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Quand la barre est active, retirer le shadow de la ligne principale */
.de-header:has(.de-header-search-bar.active) .de-header-main {
    box-shadow: none;
}

.de-header-search-bar .de-search-field-full {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(253, 189, 116, 0.35);
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 0.88em;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.de-header-search-bar .de-search-field-full::placeholder {
    color: rgba(253, 189, 116, 0.45);
}

.de-header-search-bar .de-search-field-full:focus {
    border-color: #FDBD74;
}

.de-header-search-bar .de-search-close {
    background: none;
    border: none;
    color: #FDBD74;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.de-header-search-bar .de-search-close:hover {
    color: #fff;
}

/* Compense la hauteur du header sticky */
body:not(.elementor-editor-active) {
    padding-top: 72px !important;
}

/* Admin bar WordPress — uniquement desktop */
@media screen and (min-width: 783px) {
    .admin-bar .de-header {
        top: 32px;
    }
}

/* Sur mobile, admin bar est en position fixe séparée — on ne décale pas le header */
@media screen and (max-width: 782px) {
    .admin-bar .de-header {
        top: 0;
    }
}

/* ========================================
   LOGO
   ======================================== */

.de-header-logo {
    flex-shrink: 0;
}

.de-header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.de-header-logo img {
    height: 25px;
    width: auto;
    display: block;
}

/* ========================================
   NAVIGATION DESKTOP
   ======================================== */

.de-header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.de-header-nav > ul {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.de-nav-item > a {
    display: block;
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 0.78em;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FDBD74;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.de-nav-item > a:hover {
    color: #fff;
    font-weight: 300;
}

/* SERVICES : ne pas mettre en blanc quand une sous-page est active */
.de-has-dropdown > a.active {
    color: #FDBD74;
}

/* Boutique en ligne — rendu via shortcode [btn] */
.de-nav-item--cta > .de-btn {
    margin-right: 8px;
    padding: 7px 14px;
    font-size: 0.78em;
    font-weight: 300;
}

/* Hover et état actif du bouton boutique : texte sombre + rempli */
.de-nav-item--cta > .de-btn:hover,
.de-nav-item--cta > .de-btn.active {
    color: #1A202C;
}

.de-nav-item--cta > .de-btn:hover::before,
.de-nav-item--cta > .de-btn.active::before {
    height: 100%;
}

/* ========================================
   DROPDOWN SERVICES
   ======================================== */

.de-has-dropdown {
    position: relative;
}

.de-dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.de-arrow {
    font-size: 0.75em;
    transition: transform 0.2s ease;
    display: inline-block;
    margin-left: 2px;
}

.de-has-dropdown:hover .de-arrow {
    transform: rotate(180deg);
}

.de-dropdown-menu {
    position: absolute;
    top: calc(100% + 0px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 160px;
    background: #1A202C;
    border: 1px solid rgba(253, 189, 116, 0.25);
    border-radius: 6px;
    padding: 6px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
    pointer-events: none;
}

.de-has-dropdown:hover .de-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.de-dropdown-menu li a {
    display: block;
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 0.78em;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FDBD74;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.de-dropdown-menu li a:hover {
    background: rgba(253, 189, 116, 0.08);
    color: #fff;
}

/* ========================================
   ACTIONS DROITE
   ======================================== */

.de-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Boutons icônes — cercle avec bordure dorée (fidèle au design original) */
.de-header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(253, 189, 116, 0.6);
    border-radius: 50%;
    cursor: pointer;
    color: #FDBD74;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    position: relative;
}

.de-header-icon-btn:hover {
    background: rgba(253, 189, 116, 0.12);
    border-color: #FDBD74;
    color: #fff;
}

.de-header-icon-btn svg {
    width: 16px;
    height: 16px;
}

/* Compteur panier */
.de-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: #FDBD74;
    color: #1A202C;
    font-family: var(--font-primary);
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: 2px solid #1A202C;
}

.de-cart-count.empty {
    display: none;
}

/* ========================================
   RECHERCHE
   ======================================== */

.de-anciola-search {
    position: relative;
    display: flex;
    align-items: center;
}

/* Le bouton loupe reprend le même style que les autres icônes */
.de-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(253, 189, 116, 0.6);
    border-radius: 50%;
    cursor: pointer;
    color: #FDBD74;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.de-search-btn:hover {
    background: rgba(253, 189, 116, 0.12);
    border-color: #FDBD74;
    color: #fff;
}

.de-search-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.de-search-wrapper {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 0;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.de-search-wrapper.active {
    width: 220px;
}

/* Sur desktop (> 1460px) : la barre s'ouvre vers la gauche dans le flux normal
   sans superposer la navigation */
@media (min-width: 1461px) {
    .de-anciola-search {
        flex-direction: row-reverse;
    }

    .de-search-wrapper {
        margin-right: 8px;
    }
}

.de-search-field {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(253, 189, 116, 0.35);
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 0.88em;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.de-search-field::placeholder {
    color: rgba(253, 189, 116, 0.45);
}

.de-search-field:focus {
    border-color: #FDBD74;
}

/* Suggestions */
.de-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: #1A202C;
    border: 1px solid rgba(253, 189, 116, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.de-search-suggestions.active {
    display: block;
}

.de-search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.de-search-suggestion:hover {
    background: rgba(253, 189, 116, 0.06);
}

.de-suggestion-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.de-suggestion-thumb--empty {
    background: rgba(255, 255, 255, 0.08);
    display: block;
}

.de-suggestion-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.de-suggestion-name {
    font-family: var(--font-primary);
    font-size: 0.88em;
    font-weight: 400;
    color: #FDBD74;
}

.de-suggestion-price {
    font-family: var(--font-primary);
    font-size: 0.78em;
    color: rgba(253, 189, 116, 0.55);
}

.de-suggestion-type {
    font-family: var(--font-primary);
    font-size: 0.72em;
    font-weight: 600;
    color: rgba(253, 189, 116, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   BURGER BUTTON
   ======================================== */

.de-mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(253, 189, 116, 0.6);
    border-radius: 50%;
    cursor: pointer;
    padding: 10px 9px;
    margin-left: 4px;
    z-index: calc(var(--menu-panel-z, 9999) + 1);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.de-mobile-menu-btn:hover {
    background: rgba(253, 189, 116, 0.12);
    border-color: #FDBD74;
}

.de-mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: #FDBD74;
    border-radius: 2px;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        width 0.2s ease;
    transform-origin: center;
}

/* Croix à l'état actif */
.de-mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}

.de-mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.de-mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

/* ========================================
   MENU PANNEAU LATÉRAL (≤ 1460px)
   ======================================== */

@media (max-width: 1460px) {

    .de-mobile-menu-btn {
        display: flex;
    }

    /* Masquer la nav desktop */
    .de-header-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 340px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        background: #1A202C !important;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.6) !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        padding: 80px 32px 40px !important;
        transform: translateX(100%) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        visibility: hidden !important;
        left: auto !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
    }

    .de-header-nav.active {
        transform: translateX(0) !important;
        visibility: visible !important;
    }

    /* Bouton × fermer — géré par le burger qui se transforme en croix, ::before supprimé */

    /* Liste */
    .de-header-nav > ul {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .de-nav-item {
        width: 100% !important;
    }

    .de-nav-item > a {
        display: block !important;
        padding: 15px 0 !important;
        font-size: 0.9em !important;
        color: #FDBD74 !important;
        border-bottom: 1px solid rgba(253, 189, 116, 0.1) !important;
        letter-spacing: 0.08em !important;
        transition: padding-left 0.2s ease, color 0.2s ease !important;
    }

    .de-nav-item > a:hover {
        padding-left: 8px !important;
        color: #fff !important;
    }

    /* Boutique — bouton shortcode [btn] dans le panneau mobile */
    .de-nav-item--cta {
        padding: 16px 0 !important;
        border-bottom: 1px solid rgba(253, 189, 116, 0.1) !important;
    }

    .de-nav-item--cta > .de-btn {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 12px 0 !important;
        font-size: 0.82em !important;
        /* Variante gold — identique au bouton desktop */
        color: #FDBD74 !important;
        border-color: #FDBD74 !important;
    }

    .de-nav-item--cta > .de-btn::before {
        background-color: #FDBD74 !important;
    }

    .de-nav-item--cta > .de-btn:hover,
    .de-nav-item--cta > .de-btn:active {
        color: #1A202C !important;
    }

    /* Dropdown à plat */
    .de-has-dropdown > .de-dropdown-toggle {
        display: none !important;
    }

    .de-has-dropdown > .de-dropdown-menu {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .de-has-dropdown > .de-dropdown-menu li a {
        padding: 13px 0 13px 14px !important;
        font-size: 0.85em !important;
        color: rgba(253, 189, 116, 0.65) !important;
        border-bottom: 1px solid rgba(253, 189, 116, 0.07) !important;
        letter-spacing: 0.08em !important;
    }

    .de-has-dropdown > .de-dropdown-menu li a:hover {
        color: #FDBD74 !important;
        background: transparent !important;
        padding-left: 22px !important;
    }

    /* Tous les boutons d'action restent visibles sous le breakpoint */
}

/* ========================================
   TABLETTE
   ======================================== */

@media (max-width: 1024px) {
    .de-header-main {
        padding: 0 24px;
    }
}

/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 768px) {
    .de-header-main {
        padding: 0 16px;
    }

    .de-header-logo img {
        height: 20px;
    }

    .de-header-nav {
        width: 100% !important;
        max-width: 100% !important;
        padding: 70px 20px 30px !important;
    }
}

/* ========================================
   BLOCAGE SCROLL (menu ouvert)
   ======================================== */

body.menu-open {
    overflow: hidden !important;
}
