/* ============================================================
   MENU MOBILE HEXAGONAL - MyCot (thème rouge)
   Tablette (≤ 1024px) + Smartphone (≤ 600px)
   Adapté de css/menu-mobile.css (COT).
   ============================================================ */

/* --- Desktop : masquer les éléments mobiles --- */
.mobile-menu-overlay,
.mobile-bottom-bar {
    display: none;
}

/* ============================================================
   ACTIVATION SUR TABLETTE ET MOBILE (≤ 1200px)
   ============================================================ */
@media screen and (max-width: 1200px) {

    /* Masquer la navigation desktop (liens du header) + déconnexion :
       tout passe par la barre du bas et l'overlay honeycomb. */
    .mycot-header .mycot-navbar,
    .mycot-header .mycot-logout {
        display: none !important;
    }

    /* ============================================================
       BARRE INFÉRIEURE (collée en bas, en flux flex du body)
       ============================================================ */
    .mobile-bottom-bar {
        display: flex;
        position: sticky;
        bottom: 0;
        flex-shrink: 0;
        width: 100%;
        height: 50px;
        background: #2a0b0b;
        align-items: center;
        justify-content: space-around;
        z-index: 99998;
        box-shadow: 0 -3px 20px rgba(0, 0, 0, 0.5);
        padding: 0 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Boutons d'accès rapide */
    .quick-link {
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 4px 10px;
        border-radius: 10px;
        transition: all 0.2s;
        min-width: 55px;
        -webkit-tap-highlight-color: transparent;
        text-decoration: none;
    }

    .quick-link:active,
    .quick-link.active {
        background: rgba(255, 255, 255, 0.1);
        color: #ff8a8a;
    }

    .quick-link i { font-size: 16px; }

    .quick-link span {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        white-space: nowrap;
    }

    /* Bouton Menu principal */
    .menu-trigger {
        background: linear-gradient(135deg, #b51d1d, #7a0f0f);
        border: none;
        color: white;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        padding: 5px 20px;
        border-radius: 12px;
        transition: all 0.2s;
        box-shadow: 0 3px 12px rgba(139, 21, 21, 0.45);
        -webkit-tap-highlight-color: transparent;
    }

    .menu-trigger:active {
        transform: scale(0.93);
        box-shadow: 0 1px 6px rgba(139, 21, 21, 0.35);
    }

    .menu-trigger i { font-size: 17px; }

    .menu-trigger span {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* ============================================================
       OVERLAY MENU HEXAGONAL
       ============================================================ */
    .mobile-menu-overlay {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(20, 4, 4, 0.97);
        z-index: 99999;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        overflow-y: auto;
        padding: 70px 15px 20px;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Bouton fermer (×) */
    .menu-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.7);
        width: 42px;
        height: 42px;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-close-btn:active {
        background: rgba(255, 255, 255, 0.18);
        color: white;
    }

    /* Bouton retour (← Retour) */
    .menu-back-btn {
        position: absolute;
        top: 15px;
        left: 15px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.7);
        padding: 9px 16px;
        border-radius: 22px;
        font-size: 13px;
        cursor: pointer;
        display: none;
        align-items: center;
        gap: 7px;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-back-btn.visible { display: flex; }

    .menu-back-btn:active {
        background: rgba(255, 255, 255, 0.18);
        color: white;
    }

    /* Titre du niveau de menu courant */
    .menu-breadcrumb {
        color: rgba(255, 255, 255, 0.4);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 3px;
        margin-bottom: 28px;
        text-align: center;
    }

    /* ============================================================
       GRILLE HONEYCOMB
       ============================================================ */
    .honeycomb-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-shrink: 0;
        transition: opacity 0.15s ease, transform 0.15s ease;
    }

    .hex-row {
        display: flex;
        justify-content: center;
        margin-top: -28px;
    }

    .hex-row:first-child { margin-top: 0; }

    /* ============================================================
       HEXAGONE INDIVIDUEL
       ============================================================ */
    .hex-item {
        width: 95px;
        height: 110px;
        clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin: 0 5px;
        color: white;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        animation: hexPop 0.35s ease forwards;
        opacity: 0;
        transition: filter 0.15s ease;
    }

    .hex-item:active {
        filter: brightness(1.25);
        transform: scale(0.92);
    }

    .hex-item i {
        font-size: 22px;
        margin-bottom: 6px;
        pointer-events: none;
    }

    .hex-label {
        font-size: 9px;
        text-align: center;
        padding: 0 8px;
        line-height: 1.3;
        max-width: 82px;
        pointer-events: none;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    @keyframes hexPop {
        0%   { opacity: 0; transform: scale(0.5); }
        70%  { transform: scale(1.06); }
        100% { opacity: 1; transform: scale(1); }
    }

    .hex-item:nth-child(1)  { animation-delay: 0.02s; }
    .hex-item:nth-child(2)  { animation-delay: 0.06s; }
    .hex-item:nth-child(3)  { animation-delay: 0.10s; }
    .hex-item:nth-child(4)  { animation-delay: 0.14s; }
    .hex-item:nth-child(5)  { animation-delay: 0.18s; }
    .hex-item:nth-child(6)  { animation-delay: 0.22s; }
}

/* ============================================================
   AJUSTEMENTS SMARTPHONE (≤ 600px)
   ============================================================ */
@media screen and (max-width: 600px) {

    .hex-item {
        width: 84px;
        height: 97px;
        margin: 0 4px;
    }

    .hex-row { margin-top: -24px; }

    .hex-item i {
        font-size: 19px;
        margin-bottom: 4px;
    }

    .hex-label {
        font-size: 8px;
        max-width: 70px;
    }

    .mobile-bottom-bar { height: 48px; }
}
