/* ═══════════════════════════════════════════════════════════════
   slide-menu.css — MageStock v3.0
   Volet latéral gauche (mobile/tablette)
   Chargé en DERNIER pour override app.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop ── */
nav.slide-menu ~ .slide-menu-backdrop,
.slide-menu-backdrop#slideBackdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease !important;
    display: block !important;
    visibility: hidden;
}
@media (max-width: 1024px) {
    .slide-menu-backdrop#slideBackdrop {
        visibility: visible;
    }
}
.slide-menu-backdrop#slideBackdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ── Volet ── */
nav#slideMenu.slide-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    width: 300px !important;
    max-width: 85vw !important;
    height: 100% !important;
    z-index: 9001 !important;
    background: var(--bg-sidebar, #1e293b) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
    padding-top: env(safe-area-inset-top, 0px);
}
nav#slideMenu.slide-menu.open {
    transform: translateX(0) !important;
}

/* ── En-tête ── */
nav#slideMenu .slide-menu-head {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px !important;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1)) !important;
    min-height: 60px !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}
.slide-menu-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.slide-menu-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}
.slide-menu-logo-ph {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}
.slide-menu-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bouton fermer ── */
nav#slideMenu .slide-menu-close {
    margin-left: auto !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted, #94a3b8) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}
nav#slideMenu .slide-menu-close:hover {
    background: rgba(255,255,255,0.08) !important;
    color: var(--text-primary, #f1f5f9) !important;
}
nav#slideMenu .slide-menu-close svg {
    width: 20px !important;
    height: 20px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Corps scrollable ── */
nav#slideMenu .slide-menu-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── Items de navigation ── */
nav#slideMenu .slide-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 11px 14px !important;
    border-radius: 10px !important;
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s !important;
    margin-bottom: 2px !important;
    cursor: pointer !important;
    min-height: 44px !important;
}
nav#slideMenu .slide-item:hover {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-primary, #f1f5f9) !important;
}
nav#slideMenu .slide-item.active {
    background: var(--blue, #3b82f6) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* ── Icônes ── */
nav#slideMenu .slide-item-icon {
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
nav#slideMenu .slide-item-icon svg {
    width: 20px !important;
    height: 20px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Badge ── */
nav#slideMenu .slide-badge {
    margin-left: auto !important;
    padding: 2px 8px !important;
    background: var(--red, #ef4444) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 99px !important;
}

/* ── Déconnexion ── */
nav#slideMenu .slide-logout {
    color: var(--red, #ef4444) !important;
    margin-top: 12px !important;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1)) !important;
    padding-top: 12px !important;
}
nav#slideMenu .slide-logout:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

/* ── Tablette plus large ── */
@media (min-width: 600px) and (max-width: 1024px) {
    nav#slideMenu.slide-menu {
        width: 340px !important;
    }
}
