/* ═══════════════════════════════════════════════════════════════════════════
   GTH Burger Menu - Offcanvas avec navigation multi-niveaux animee
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Bouton Burger ──────────────────────────────────────────────────────── */
.gth-burger-wrap {
    display: flex;
    align-items: center;
}

.gth-burger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    color: #232323;
    font-size: 14px;
    font-weight: 600;
}

.gth-burger-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.gth-burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.gth-burger-icon span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Animation burger -> X quand ouvert */
.gth-burger-btn.is-open .gth-burger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.gth-burger-btn.is-open .gth-burger-icon span:nth-child(2) {
    opacity: 0;
}
.gth-burger-btn.is-open .gth-burger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ─── Overlay ────────────────────────────────────────────────────────────── */
.gth-offcanvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(2px);
}

.gth-offcanvas-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Offcanvas ──────────────────────────────────────────────────────────── */
.gth-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.gth-offcanvas.is-open {
    transform: translateX(0);
}

/* ─── Header offcanvas ───────────────────────────────────────────────────── */
.gth-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.gth-offcanvas-title {
    font-size: 16px;
    font-weight: 700;
    color: #232323;
}

.gth-offcanvas-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: #666;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gth-offcanvas-close:hover {
    background: #f5f5f5;
    color: #232323;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.gth-offcanvas-nav {
    flex: 1;
    overflow: hidden;
    position: relative;
}

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

.gth-menu-row {
    display: flex;
    align-items: center;
}

.gth-menu-link {
    flex: 1;
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.gth-menu-link:hover {
    background: #f7f7f7;
    color: #000;
    text-decoration: none;
}

/* Niveau 1 */
.gth-menu-level-1 .gth-menu-link {
    font-size: 14px;
    font-weight: 400;
    padding: 12px 20px;
}

/* Niveau 2 */
.gth-menu-level-2 .gth-menu-link {
    font-size: 13px;
    font-weight: 400;
    padding: 10px 20px;
    color: #666;
}

/* ─── Fleche pour ouvrir sous-menu ───────────────────────────────────────── */
.gth-menu-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    border-left: 1px solid #f0f0f0;
    cursor: pointer;
    color: #999;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.gth-menu-arrow:hover {
    background: #f0f0f0;
    color: #333;
}

/* ─── Panneaux de sous-menu (slide) ──────────────────────────────────────── */
.gth-submenu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    -webkit-overflow-scrolling: touch;
}

.gth-submenu-panel.is-active {
    transform: translateX(0);
}

/* Bouton retour */
.gth-submenu-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #f8f8f8;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: background 0.15s;
}

.gth-submenu-back:hover {
    background: #f0f0f0;
    color: #333;
}

/* Titre du sous-menu (lien parent cliquable) */
.gth-submenu-title {
    display: block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #232323;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.gth-submenu-title:hover {
    color: #000;
    text-decoration: none;
}

/* ─── Separateur entre items ─────────────────────────────────────────────── */
.gth-menu-level-0 > .gth-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.gth-menu-level-0 > .gth-menu-item:last-child {
    border-bottom: none;
}

.gth-menu-level-1 > .gth-menu-item {
    border-bottom: 1px solid #f5f5f5;
}

.gth-menu-level-2 > .gth-menu-item {
    border-bottom: 1px solid #f8f8f8;
}

/* ─── Masquer le menu root quand un sous-panneau est actif ───────────────── */
.gth-offcanvas-nav.has-active-panel > #gth-menu-root {
    transform: translateX(0%);
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

#gth-menu-root {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

/* ─── Body lock quand offcanvas ouvert ───────────────────────────────────── */
body.gth-offcanvas-open {
    overflow: hidden;
}
