/* ---------- HEADER (sticky, center page) ---------- */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 9000; /* ✅ HOGER dan mega-nav (8000), LAGER dan overlay (10000) */
    width: 100%;
    display: flex;
    justify-content: center;
}

.header-inner-container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative; /* ✅ nodig voor absolute search op desktop */
}

/* ✅ MIDDENZONE: taal menu blijft links, searchbar gecentreerd op desktop */
.header-middle {
    flex: 2;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* ✅ SEARCHBAR CENTER FIX (DESKTOP) */
.header-search {
    position: absolute; /* ✅ FIX (was leeg bij jou) */
    left: 50%;
    transform: translateX(-50%);
    width: 440px;
    display: flex;
    z-index: 2;
}

.header-search input {
    flex: 1;
    background: var(--grey-blue);
    border: none;
    padding: 10px 16px;
    border-radius: 16px 0 0 16px;
    font-size: 0.9rem;
    min-width: 0;
}

.header-search input::placeholder {
    color: rgba(12,34,55,0.55);
}

.header-search input:focus {
    outline: 2px solid var(--dark-green);
}

.header-search button {
    border: none;
    background: var(--dark-green);
    color: var(--white);
    padding: 0 16px;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -------- TAALMENU – hover-only -------- */
.header-lang {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1.5px solid rgba(12,34,55,0.16);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ✅ TAAL DROPDOWN HOVER — GEEN CLICK */
.header-lang-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translate(0, 6px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-width: 150px;
    z-index: 9500; /* ✅ boven mega-nav, maar header verdwijnt bij overlay */
}

.header-lang:hover .header-lang-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, 0);
}

.flag-icon {
    display: inline-flex;
    margin-right: 6px;
    font-size: 0.9rem;
    align-items: center;
}

.header-lang-option {
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
}

.header-lang-option:hover {
    background: rgba(46,124,87,0.14);
}

/* RECHTS */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ICONS – UNIFORME STIJL */
.header-icon-btn,
.header-cart {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid var(--dark-blue);
    background: transparent;
    color: var(--dark-blue);
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.1s ease, border-color 0.22s ease, color 0.22s ease;
    position: relative; /* ✅ badge positionering */
}

/* hover */
.header-icon-btn:hover,
.header-cart:hover {
    background: var(--dark-green);
    border-color: var(--dark-green);
    color: var(--white);
    transform: scale(1.06);
}

.header-icon-btn:active,
.header-cart:active {
    transform: scale(0.95);
}

/* Rode fill wanneer favoriet actief — blijft exact */
.favorite-heart--active i.fa-heart {
    color: #FF3B30;
}

/* Login style swap via state class */
.js-user-login.logged-in i.fa-circle-user {
    color: var(--dark-green);
}

/* Cart badge */
.header-cart::after {
    content: attr(data-count);
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #FF3B30;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-cart[data-count="0"]::after,
.header-cart:not([data-count])::after {
    display: none;
}

/* RESPONSIVE OVERRIDES */
@media (max-width: 1280px) {
    .slider-arrow--left  { left: -40px; }
    .slider-arrow--right { right: -40px; }
}

/* TABLET: search iets smaller zodat desktop-centrum niet botst */
@media (max-width: 1024px) {
    .header-search {
        width: 360px;
    }
}

/* ✅ MOBIEL/TABLET: TAAL LINKS, SEARCH ER TUSSEN, ICONS RECHTS */
@media (max-width: 720px) {

    /* 1 rij: [taal + search] linksblok, icons rechts */
    .header-inner-container {
        padding: 14px 0;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* linksblok wordt: taal + search naast elkaar */
    .header-middle {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 10px;      /* ✅ lucht tussen taal en search */
        min-width: 0;   /* ✅ belangrijk voor flex shrink */
    }

    /* search wordt flexibel en vult ruimte tussen taal en icons */
    .header-search {
        position: static;
        left: auto;
        transform: none;
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .header-search input {
        padding: 9px 12px;
        font-size: 0.85rem;
        min-width: 0;
    }

    .header-search button {
        padding: 0 12px;
    }

    /* icons blijven allemaal zichtbaar */
    .header-right {
        flex: 0 0 auto;
        gap: 6px;
    }

    .header-icon-btn,
    .header-cart {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    /* taalbutton precies links houden */
    .header-lang {
        flex: 0 0 auto;
        padding: 6px 12px;
    }
}

/* ZEER SMAL (iPhone SE) */
@media (max-width: 380px) {
    .header-right {
        gap: 5px;
    }

    .header-icon-btn,
    .header-cart {
        width: 34px;
        height: 34px;
        font-size: 1.0rem;
    }

    .header-middle {
        gap: 8px;
    }
}

/* SAFARI / IOS FIX */
@supports (-webkit-touch-callout: none) {
    .header-search input {
        font-size: 16px; /* voorkomt zoom bij focus */
    }
}

/* =========================================================
   ✅ FIX: HEADER NOOIT BOVEN FULLSCREEN MENU
   (body.menu-open wordt gezet door main.js)
========================================================= */
body.menu-open .main-header {
    display: none !important;
}
