/* ============================================
   The Good Header — by The Good Lead LLC
   ============================================ */

.tgh-header { position: relative; width: 100%; box-sizing: border-box; }
.tgh-header.is-sticky { position: sticky; top: 0; z-index: 9999; }
.tgh-header *, .tgh-header *::before, .tgh-header *::after { box-sizing: border-box; }

.tgh-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    gap: 24px;
    width: 100%;
}

/* ---- LOGO ---- */
.tgh-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.tgh-header__logo a { display: inline-flex; line-height: 0; }
.tgh-header__logo img { display: block; height: auto; }

/* ---- MENU DESKTOP ---- */
.tgh-header__menu { display: flex; align-items: center; }
.tgh-header__menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
.tgh-header__menu li { position: relative; }
.tgh-header__menu a {
    position: relative;
    display: inline-block;
    text-decoration: none;
    transition: color .25s ease, background-color .25s ease;
    line-height: 1.2;
}

/* Soulignement animé */
.tgh-header.has-underline .tgh-header__menu > ul > li > a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    transition: width .3s ease;
}
.tgh-header.has-underline .tgh-header__menu > ul > li > a:hover::after,
.tgh-header.has-underline .tgh-header__menu > ul > li.current-menu-item > a::after {
    width: calc(100% - 8px);
}

/* Sous-menu */
.tgh-header__menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    z-index: 100;
    border-radius: 8px;
}
.tgh-header__menu li:hover > .sub-menu,
.tgh-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.tgh-header__menu .sub-menu a {
    display: block;
    padding: 10px 18px;
    white-space: nowrap;
}
.tgh-header__menu .menu-item-has-children > a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 6px;
    vertical-align: 2px;
    opacity: .7;
}

/* ---- RIGHT (button + toggle) ---- */
.tgh-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* ---- BUTTON ---- */
.tgh-header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    white-space: nowrap;
    border: 0;
}
.tgh-header__btn:hover { transform: translateY(-1px); }
.tgh-header__btn-icon { display: inline-flex; align-items: center; }
.tgh-header__btn-icon svg, .tgh-header__btn-icon i { width: 1em; height: 1em; font-size: inherit; }

/* ---- HAMBURGER ---- */
.tgh-header__toggle {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 10001;
    transition: background-color .3s ease;
}
.tgh-header__toggle span {
    position: absolute;
    left: 22%;
    width: 56%;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition: transform .35s cubic-bezier(.4,0,.2,1), top .35s cubic-bezier(.4,0,.2,1), opacity .25s ease, background-color .3s ease;
}
.tgh-header__toggle span:nth-child(1) { top: 32%; }
.tgh-header__toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.tgh-header__toggle span:nth-child(3) { top: 68%; }
.tgh-header__toggle.is-active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.tgh-header__toggle.is-active span:nth-child(2) { opacity: 0; }
.tgh-header__toggle.is-active span:nth-child(3) { top: 50%; transform: translateY(-50%) rotate(-45deg); }

/* ============================================
   MOBILE PANEL
   ============================================ */
.tgh-header__panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 10000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .4s ease, visibility .4s, transform .4s cubic-bezier(.4,0,.2,1);
}
.tgh-header__panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Variantes d'ouverture */
.tgh-header.panel-fullscreen .tgh-header__panel { transform: scale(1.04); }
.tgh-header.panel-fullscreen .tgh-header__panel.is-open { transform: scale(1); }

.tgh-header.panel-side .tgh-header__panel { transform: translateX(100%); width: min(420px, 100%); left: auto; right: 0; }
.tgh-header.panel-side .tgh-header__panel.is-open { transform: translateX(0); }

.tgh-header.panel-side-left .tgh-header__panel { transform: translateX(-100%); width: min(420px, 100%); }
.tgh-header.panel-side-left .tgh-header__panel.is-open { transform: translateX(0); }

.tgh-header.panel-dropdown .tgh-header__panel { position: absolute; top: 100%; height: auto; max-height: calc(100vh - 100%); transform: translateY(-12px); }
.tgh-header.panel-dropdown .tgh-header__panel.is-open { transform: translateY(0); }

.tgh-header__panel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    width: 100%;
    min-height: 100%;
    padding: 100px 32px 60px;
}

.tgh-header__panel-menu { width: 100%; }
.tgh-header__panel-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.tgh-header__panel-menu li { width: 100%; }
.tgh-header__panel-menu a {
    display: inline-block;
    text-decoration: none;
    transition: color .25s ease, transform .25s ease;
    padding: 6px 0;
}
.tgh-header__panel-menu a:hover { transform: translateX(4px); }

/* Sous-menu mobile */
.tgh-header__panel-menu .sub-menu {
    list-style: none;
    padding: 12px 0 0 16px;
    margin: 8px 0 0;
    opacity: .85;
}
.tgh-header__panel-menu .sub-menu a {
    font-size: .7em !important;
    font-weight: 400 !important;
}

.tgh-header__panel-btn-wrap { margin-top: 12px; }

/* Animation d'entrée des items */
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li {
    opacity: 0;
    transform: translateY(20px);
    animation: tghFadeUp .5s cubic-bezier(.4,0,.2,1) forwards;
}
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(1) { animation-delay: .1s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(2) { animation-delay: .15s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(3) { animation-delay: .20s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(4) { animation-delay: .25s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(5) { animation-delay: .30s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(6) { animation-delay: .35s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(7) { animation-delay: .40s; }
.tgh-header__panel.is-open .tgh-header__panel-menu > ul > li:nth-child(n+8) { animation-delay: .45s; }
.tgh-header__panel.is-open .tgh-header__panel-btn-wrap {
    opacity: 0;
    animation: tghFadeUp .5s cubic-bezier(.4,0,.2,1) forwards;
    animation-delay: .5s;
}

@keyframes tghFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Block scroll quand le panel est ouvert */
body.tgh-no-scroll { overflow: hidden; }

/* Éditeur Elementor : forcer l'affichage */
.elementor-editor-active .tgh-header__panel { display: flex; position: relative; opacity: 1; visibility: visible; height: auto; min-height: 300px; pointer-events: auto; transform: none !important; }
