/* =============================================================
   EK HEADER v2 - CSS
   Les variables --ekh-* sont injectées dans <style> par le hook
   displayHeader du module.
   ============================================================= */

/* ---- Wrapper global ---- */
#ekh-header-wrapper.ekh {
    background-color: var(--ekh-bg, #ffffff);
    color: var(--ekh-text, #222222);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    z-index: 1000;
    position: relative;
    border: none !important;
    box-shadow: none !important;
}

/* Pas de bordure sur les éléments principaux du header */
#ekh-header-wrapper.ekh,
#ekh-header-wrapper .ekh-main,
#ekh-header-wrapper .ekh-topbar,
#ekh-header-wrapper .ekh-menu,
#ekh-header-wrapper header,
#ekh-header-wrapper nav {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

#ekh-header-wrapper.ekh-sticky {
    position: sticky;
    top: 0;
}

#ekh-header-wrapper a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

#ekh-header-wrapper a:hover {
    color: var(--ekh-hover, #1696b8);
}

/* ---- Container central ---- */
#ekh-header-wrapper .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ============ TOPBAR ============ */
.ekh-topbar {
    background-color: var(--ekh-topbar-bg, #2c3338);
    color: var(--ekh-topbar-text, #ffffff);
    font-size: 13px;
    padding: 8px 0;
}

.ekh-topbar a {
    color: var(--ekh-topbar-text, #ffffff);
}

.ekh-topbar a:hover {
    color: var(--ekh-accent, #1abce8);
}

.ekh-topbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ekh-topbar-left,
.ekh-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ekh-topbar a,
.ekh-topbar span {
    display: inline-block;
}

/* ============ HEADER PRINCIPAL ============ */
.ekh-main {
    background-color: var(--ekh-bg, #ffffff);
    padding: 20px 0;
}

.ekh-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ---- Logo ---- */
.ekh-logo {
    flex-shrink: 0;
}

.ekh-logo-img {
    max-height: var(--ekh-logo-max, 60px);
    width: auto;
    display: block;
}

.ekh-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--ekh-text, #222222);
}

/* Variante "logo centré" */
.ekh-logo-center .ekh-main-row {
    position: relative;
}

.ekh-logo-center .ekh-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.ekh-logo-center .ekh-search {
    margin-left: auto;
    margin-right: 0;
    order: 3;
}

.ekh-logo-center .ekh-actions {
    order: 4;
}

/* ---- Barre de recherche style Babylux ---- */
.ekh-search {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0 5px 0 0;
    margin: 0 auto;
}

.ekh-search:focus-within {
    border-color: var(--ekh-accent, #ed1c79);
    box-shadow: 0 0 0 3px rgba(237, 28, 121, 0.1);
}

.ekh-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px 22px;
    font-size: 14px;
    background: transparent;
    color: var(--ekh-text);
}

.ekh-search-input::placeholder {
    color: #999;
}

/* Bouton recherche rond rose à l'intérieur de la barre */
.ekh-search-btn {
    border: 0;
    background: var(--ekh-accent, #ed1c79);
    color: #fff;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.ekh-search-btn:hover {
    background: var(--ekh-hover, #c2155f);
    color: #fff;
}

.ekh-search-btn .material-icons {
    font-size: 20px;
}

/* ---- Actions à droite : icônes pures, pas de bouton plein ---- */
.ekh-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.ekh-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ekh-text);
    font-size: 14px;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.ekh-action .material-icons {
    font-size: 26px;
}

.ekh-action:hover {
    color: var(--ekh-accent, #ed1c79);
}

.ekh-action-label {
    display: none; /* style Babylux : icônes seules */
}

/* Panier : icône simple comme Babylux, pas de bouton plein rose */
.ekh-cart {
    background: transparent;
    color: var(--ekh-text);
    padding: 6px;
    border-radius: 4px;
    font-weight: 400;
}

.ekh-cart:hover {
    background: transparent;
    color: var(--ekh-accent, #ed1c79);
}

.ekh-cart .material-icons {
    font-size: 26px;
}

.ekh-cart-label {
    display: none; /* style Babylux : pas de texte, juste l'icône */
}

/* ============ MENU style Babylux ============ */
.ekh-menu {
    background-color: var(--ekh-menu-bg, #ffffff);
    color: var(--ekh-menu-text, #555555);
}

.ekh-menu a {
    color: var(--ekh-menu-text, #555555);
    font-weight: 500;
    font-size: var(--ekh-menu-font, 14px);
    text-transform: none;
}

.ekh-menu a:hover {
    color: var(--ekh-menu-hover, #ed1c79);
}

.ekh-menu-inner {
    padding: 14px 0;
}

.ekh-menu-align-center .ekh-menu-inner {
    text-align: center;
}

.ekh-menu-align-center .iqit-megamenu ul,
.ekh-menu-align-center .ekh-menu-inner > ul,
.ekh-menu-align-center .ekh-menu-inner nav {
    justify-content: center;
}

/* Items du mégamenu IQIT - couleurs et taille configurables */
.ekh-menu .cbp-hrmenu li > a,
.ekh-menu .menu-top-link,
.ekh-menu .top-menu a {
    color: var(--ekh-menu-text, #555555) !important;
    font-size: var(--ekh-menu-font, 14px) !important;
    padding: 0 16px;
}

.ekh-menu .cbp-hrmenu li > a:hover,
.ekh-menu .menu-top-link:hover {
    color: var(--ekh-menu-hover, #ed1c79) !important;
}

/* Les 2 derniers items du menu en gras façon "Marques / Bons plans" Babylux */
.ekh-menu .iqit-megamenu > ul > li:nth-last-child(-n+2) > a,
.ekh-menu .cbp-hrmenu > ul > li:nth-last-child(-n+2) > a {
    font-weight: 700 !important;
    color: var(--ekh-text, #222) !important;
}

/* ============ MENU PERSONNALISÉ ============
   Style appliqué aux items définis manuellement dans le BO du module.
   Reproduit exactement le rendu Babylux. */

.ekh-menu-list {
    list-style: none;
    margin: 0 auto; /* centré dans le container parent */
    padding: 0;
    display: inline-flex; /* prend juste la largeur du contenu, pas 100% */
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto; /* surcharge tout reset Bootstrap */
}

/* Le conteneur parent force le centrage horizontal du bloc inline-flex */
.ekh-menu .ekh-menu-inner {
    text-align: center !important;
    display: block;
}

/* Variantes d'alignement */
.ekh-menu-align-center .ekh-menu-inner {
    text-align: center !important;
}

.ekh-menu-align-left .ekh-menu-inner {
    text-align: left !important;
}

.ekh-menu-align-left .ekh-menu-list {
    margin: 0;
}

.ekh-menu-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ekh-menu-item > a {
    display: inline-block;
    padding: 4px 18px;
    color: var(--ekh-menu-text, #555555);
    font-size: var(--ekh-menu-font, 14px);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.6;
}

.ekh-menu-item > a:hover {
    color: var(--ekh-menu-hover, #ed1c79);
}

/* Items marqués "gras" via le 3ème paramètre */
.ekh-menu-item-bold > a {
    font-weight: 700;
    color: var(--ekh-text, #222);
}

.ekh-menu-item-bold > a:hover {
    color: var(--ekh-menu-hover, #ed1c79);
}

/* ============ NETTOYAGE DU MENU NATIF PRESTASHOP ============
   Masque les éléments parasites quand iqitmegamenu n'a pas
   d'items configurés (icône maison, séparateurs, "Sample tab")
   pour avoir un menu propre style Babylux. */

/* Icône maison (lien "Accueil" par défaut) */
.ekh-menu .top-menu .menu-top-icon,
.ekh-menu .top-menu li.first-item,
.ekh-menu .top-menu li > a > i.material-icons,
.ekh-menu .top-menu li > a > i.icon-home,
.ekh-menu .iqit-megamenu .menu-top-icon,
.ekh-menu .cbp-hrmenu .menu-top-icon {
    display: none !important;
}

/* Lien "Accueil" textuel du menu natif */
.ekh-menu .top-menu li > a[href$="index.php"]:not([href*="?"]),
.ekh-menu .top-menu li.category-home {
    display: none !important;
}

/* Item démo "Sample tab" (CMS exemple du thème) */
.ekh-menu li > a[title="Sample tab"],
.ekh-menu li > a[href*="sample-tab"],
.ekh-menu li.cms-id-4,
.ekh-menu li.cms-id-5 {
    display: none !important;
}

/* Séparateurs verticaux entre items */
.ekh-menu .top-menu li,
.ekh-menu .iqit-megamenu li,
.ekh-menu .cbp-hrmenu > ul > li {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
}

.ekh-menu .top-menu li::before,
.ekh-menu .top-menu li::after,
.ekh-menu .iqit-megamenu li::before,
.ekh-menu .iqit-megamenu li::after {
    display: none !important;
    content: none !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .ekh-search {
        max-width: 100%;
        order: 99;
        flex-basis: 100%;
        margin-top: 12px;
    }

    .ekh-main-row {
        flex-wrap: wrap;
    }

    .ekh-action-label {
        display: none;
    }

    .ekh-cart .ekh-cart-label {
        display: none;
    }

    .ekh-cart {
        padding: 10px;
    }
}

@media (max-width: 575.98px) {
    .ekh-main {
        padding: 12px 0;
    }

    .ekh-logo-img {
        max-height: 40px;
    }

    .ekh-actions {
        gap: 8px;
    }

    .ekh-topbar {
        font-size: 12px;
    }

    .ekh-topbar-row {
        justify-content: center;
    }

    .ekh-logo-center .ekh-logo {
        position: static;
        transform: none;
        order: 1;
        width: 100%;
        text-align: center;
    }
}

/* Polices Material Icons (au cas où le thème ne les charge pas) */
@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/materialicons/v143/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
    font-display: swap;
}

#ekh-header-wrapper .material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}
