/* ============================================================
   Kinder Land — Header
   Topbar : logo | réseaux + bouton
   Nav    : menu horizontal avec hover vert
   Mobile : hamburger + menu dropdown
   ============================================================ */

/* ── Reset utilitaire ─────────────────────────────────────── */
.kl-header *,
.kl-header *::before,
.kl-header *::after {
    box-sizing: border-box;
}

/* ── Wrapper header ───────────────────────────────────────── */
.kl-header {
    width: 100%;
    background-color: var( --kl-hdr-bg, #ffffff );
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ── Barre supérieure ─────────────────────────────────────── */
.kl-header__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    max-width: 1280px;
    margin: 0 auto;
    gap: 16px;
}

/* Logo */
.kl-header__logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.kl-header__logo img,
.kl-header__logo-svg {
    display: block;
    max-height: 60px;
    width: auto;
}

/* Partie droite */
.kl-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── Réseaux sociaux ──────────────────────────────────────── */
.kl-header__social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.kl-header__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.kl-header__social a:hover {
    transform: scale(1.12);
    filter: brightness(1.15);
}

.kl-header__social svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
}

/* ── Bouton Contact Us ────────────────────────────────────── */
.kl-header__btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    border: 2px solid var( --kl-hdr-btn-color, #78ABF1 );
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: var( --kl-hdr-btn-color, #78ABF1 );
    background: transparent;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1.4;
}

.kl-header__btn:hover {
    background-color: #ff9138;
    color: #ffffff !important;
    border-color: #ff9138 !important;
    text-decoration: none;
}

/* ── Barre d'accent orange ────────────────────────────────── */
.kl-header__accent-bar {
    height: 3px;
    background-color: var( --kl-hdr-accent, #ff9138 );
    width: 100%;
}

/* ── Navigation ───────────────────────────────────────────── */
.kl-header__nav {
    background-color: var( --kl-hdr-nav-bg, #ffffff );
    position: relative;
}

.kl-nav-menu {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Liste de premier niveau */
.kl-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.kl-nav-list > li {
    position: relative;
}

.kl-nav-list > li > a {
    display: block;
    padding: 14px 16px;
    color: var( --kl-hdr-nav-color, #2f474e );
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    text-decoration: none;
    text-transform: capitalize;
    font-weight: 400;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.kl-nav-list > li > a:hover,
.kl-nav-list > li.current-menu-item > a,
.kl-nav-list > li.current_page_item > a,
.kl-nav-list > li.current-menu-ancestor > a {
    color: var( --kl-hdr-nav-active, #9ac14e );
    background-color: transparent;
}

/* Sous-menu (dropdown) */
.kl-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    border-radius: 0 0 4px 4px;
    border-top: 2px solid var( --kl-hdr-nav-active, #9ac14e );
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 100;
}

.kl-nav-list li:hover > .sub-menu,
.kl-nav-list li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.kl-nav-list .sub-menu a {
    display: block;
    padding: 10px 18px;
    color: #2f474e;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s;
}

.kl-nav-list .sub-menu a:hover {
    color: var( --kl-hdr-nav-active, #9ac14e );
    background-color: #f8f8f8;
}

/* ── Hamburger (mobile) ───────────────────────────────────── */
.kl-header__hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.kl-header__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var( --kl-hdr-nav-color, #2f474e );
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation hamburger → croix */
.kl-header__hamburger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.kl-header__hamburger.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.kl-header__hamburger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Responsive tablette (≤ 960px) ───────────────────────── */
@media (max-width: 960px) {
    .kl-header__topbar {
        padding: 10px 16px;
    }

    .kl-nav-menu {
        padding: 0 16px;
    }

    .kl-nav-list > li > a {
        padding: 12px 10px;
        font-size: 15px;
    }
}

/* ── Responsive mobile (≤ 767px) ─────────────────────────── */
@media (max-width: 767px) {
    /* Topbar : logo centré, social + btn à droite */
    .kl-header__topbar {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 8px;
    }

    .kl-header__logo {
        flex: 0 0 auto;
    }

    .kl-header__right {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 10px;
    }

    .kl-header__social {
        gap: 5px;
    }

    .kl-header__social a {
        width: 26px;
        height: 26px;
    }

    .kl-header__social svg {
        width: 12px;
        height: 12px;
    }

    /* Hamburger visible */
    .kl-header__hamburger {
        display: flex;
    }

    /* Nav devient un drawer vertical */
    .kl-header__nav {
        padding: 0;
    }

    .kl-nav-menu {
        padding: 0;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }

    .kl-nav-menu.is-open {
        max-height: 600px;
    }

    .kl-nav-list {
        flex-direction: column;
        align-items: flex-start;
        border-top: 1px solid #f0f0f0;
    }

    .kl-nav-list > li {
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
    }

    .kl-nav-list > li > a {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
    }

    /* Sous-menu mobile : affiché en dessous (pas de position absolute) */
    .kl-nav-list .sub-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var( --kl-hdr-nav-active, #9ac14e );
        border-radius: 0;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        background-color: #fafafa;
        display: none;
    }

    .kl-nav-list li:hover > .sub-menu,
    .kl-nav-list li.is-open > .sub-menu {
        display: block;
    }

    .kl-nav-list .sub-menu a {
        padding: 11px 28px;
        font-size: 14px;
    }
}

/* ── Fallback message (admin uniquement) ──────────────────── */
.kl-nav-fallback {
    padding: 10px 24px;
    background: #fff3cd;
    font-size: 13px;
    color: #856404;
}

.kl-nav-fallback a {
    color: #9ac14e;
}
