/* ==========================================================================
   ASYORA — Responsive fixes (global)
   Fichier inclus dans toutes les pages pour corriger les principaux
   problèmes responsive sans toucher au HTML existant.
   ========================================================================== */

/* ----------------------------------------------------------------
   1) Empêche le scroll horizontal indésirable
   ---------------------------------------------------------------- */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Hero qui utilisait width: 100vw provoquait une barre de scroll horizontale
   sur Windows (scrollbar visible) ; on force 100% du conteneur. */
.hero-banner,
.hero-section {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------
   2) Logo Asyora — taille fluide pour ne pas déborder sur mobile
   ---------------------------------------------------------------- */
.logo-asyora-header,
.logo-asyora {
    font-size: clamp(1.6rem, 5vw, 4rem) !important;
    letter-spacing: clamp(4px, 2vw, 30px) !important;
    margin-right: 0 !important;
    overflow-wrap: break-word;
}

/* Sidebar admin : texte compact (ne pas réutiliser le style hero logo) */
.sidebar .sidebar-title {
    font-family: 'Avenir Next', 'Avenir Next Arabic', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: lowercase !important;
    text-align: center !important;
    padding: 0.75rem 1rem 1rem !important;
    margin: 0 0 0.75rem 0 !important;
    color: #CADBE7 !important;
    border-bottom: 1px solid rgba(202, 219, 231, 0.25) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.logo-essential-header {
    font-size: clamp(0.7rem, 1.5vw, 1.1rem) !important;
    letter-spacing: clamp(1px, 0.5vw, 4px) !important;
}

/* ----------------------------------------------------------------
   3) Zones tactiles des icônes navbar (a11y : minimum 44x44px)
   ---------------------------------------------------------------- */
.nav-icon-btn,
.nav-icon-btn:link,
.nav-icon-btn:visited {
    min-width: 44px;
    min-height: 44px;
    padding: 8px !important;
    margin-left: 0.5rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .nav-icon-btn { margin-left: 1rem !important; }
}

/* ----------------------------------------------------------------
   4) Modale produit (produits.html) — corrige le CSS cassé qui
      utilisait position: absolute + transform et débordait sur mobile.
      Bootstrap gère déjà le centrage avec modal-dialog-centered.
   ---------------------------------------------------------------- */
.modal-dialog {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 1.75rem auto !important;
}

/* Sur très petit écran, les grosses modales prennent tout l'écran */
@media (max-width: 575.98px) {
    .modal-dialog,
    .modal-dialog.modal-xl,
    .modal-dialog.modal-lg {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
    }
    .modal-dialog .modal-content {
        min-height: 100vh;
        border-radius: 0 !important;
    }
}

/* ----------------------------------------------------------------
   5) Cartes produits — image bornée, hauteur uniforme
   ---------------------------------------------------------------- */
.card-img-top {
    width: 100% !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f8f8f8;
}

.cart-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.fav-img {
    width: 70px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.seller-img {
    width: 100% !important;
    max-height: 180px;
    object-fit: contain;
}

/* ----------------------------------------------------------------
   6) Cartes "offer-card" — autoriser le reflow sur mobile
   ---------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .offer-card,
    .offer-card * {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .offer-card { padding-bottom: 16px; }
    .offer-img-container { height: 130px !important; margin-bottom: 12px !important; }
    .rule-card { min-width: 0 !important; }
}

/* ----------------------------------------------------------------
   7) Typographie — réduit les titres énormes sur mobile
   ---------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .display-1, .display-2, .display-3 { font-size: 2.2rem !important; }
    .display-4, .display-5, .display-6 { font-size: 1.7rem !important; }
    .section-title { font-size: 1.6rem !important; margin-bottom: 30px !important; }
    h1 { font-size: 1.7rem !important; }
    h2 { font-size: 1.45rem !important; }
    h3 { font-size: 1.25rem !important; }
}

@media (max-width: 767.98px) {
    .tiers-section,
    section.tiers-section { padding: 40px 0 !important; }
}

/* ----------------------------------------------------------------
   8) Tableaux — scroll horizontal sécurisé
   Si une page a oublié <div class="table-responsive">, on force
   le wrap-around pour la table.
   ---------------------------------------------------------------- */
.table-card .table,
table.table {
    width: 100%;
}

@media (max-width: 767.98px) {
    .table-card,
    .table-card .table-responsive {
        padding: 1rem !important;
        font-size: 0.85rem;
    }
    .table thead th { font-size: 0.7rem !important; padding: 8px 6px !important; }
    .table tbody td { padding: 8px 6px !important; }
    .fav-cell { padding: 12px 8px !important; }
}

/* ----------------------------------------------------------------
   9) ADMIN SIDEBAR — passe en menu off-canvas sous lg (≤991.98px)
   Le HTML existant <div class="sidebar"> est transformé en drawer
   coulissant via CSS uniquement. Un bouton hamburger (ajouté en
   inline) le toggle.
   ---------------------------------------------------------------- */
.admin-mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #38111C;
    color: #f4f1EB;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admin-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 991.98px) {
    .admin-mobile-toggle { display: inline-flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px !important;
        max-width: 80vw;
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar.show + .admin-mobile-overlay,
    body.sidebar-open .admin-mobile-overlay { display: block; }

    .main-content {
        margin-left: 0 !important;
        padding: 4rem 1rem 2rem 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .main-content { padding: 4rem 0.75rem 1.5rem 0.75rem !important; }
}

/* ----------------------------------------------------------------
   10) Boutons — full width sur très petit écran
   ---------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .btn-offer-black,
    .btn-category-highlight {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ----------------------------------------------------------------
   11) Footer — empilement propre sur mobile
   ---------------------------------------------------------------- */
@media (max-width: 767.98px) {
    footer .row > [class*="col-"] {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    footer .row > [class*="col-"]:last-child { margin-bottom: 0; }
}

/* ----------------------------------------------------------------
   12) Page quizz.html — restaure le menu central caché par le CSS
       d'origine sous 900px (même si on ajoutera une vraie navbar plus
       tard, au moins les liens redeviennent accessibles).
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
    .center-nav {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* ----------------------------------------------------------------
   13) Page Login & assimilées — espace haut réduit en mobile
   ---------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .main-wrapper { margin-top: 60px !important; }
}

/* ----------------------------------------------------------------
   14) Suppression du letter-spacing négatif sur le logo header
       qui causait du chevauchement
   ---------------------------------------------------------------- */
.logo-asyora-header { margin-right: 0 !important; }

/* ================================================================
   15) MENU MOBILE ASYORA — bouton hamburger + offcanvas drawer
   Utilisé sur les pages utilisateur (acceuilUser, produits, panier,
   favoris, apropos) via le fragment nav-mobile.
   ================================================================ */

/* Bouton hamburger placé dans la navbar (à droite), visible uniquement < lg.
   Le JS du fragment l'injecte automatiquement comme dernier enfant de la navbar. */
.asyora-mobile-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    z-index: 1045;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: #38111C;
    color: #f4f1EB;
    box-shadow: 0 4px 12px rgba(56, 17, 28, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s ease;
}
.asyora-mobile-toggle:hover,
.asyora-mobile-toggle:focus {
    background: #5a1e2d;
    color: #fff;
    transform: translateY(-50%) scale(1.05);
}
.asyora-mobile-toggle:active { transform: translateY(-50%) scale(0.95); }

/* L'offcanvas drawer */
.asyora-offcanvas {
    background-color: #f4f1EB;
    color: #38111C;
    width: 320px !important;
    max-width: 85vw;
    border-right: 1px solid rgba(56, 17, 28, 0.08);
}
.asyora-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, #38111C 0%, #5a1e2d 100%);
    color: #f4f1EB;
    padding: 1.5rem 1.25rem;
    border-bottom: none;
}
.asyora-offcanvas .offcanvas-title { line-height: 1; }
.asyora-offcanvas .btn-close {
    filter: invert(1) brightness(2);
    opacity: 0.9;
}
.asyora-offcanvas-logo {
    font-family: 'Bodoni FLF', 'Playfair Display', serif;
    font-size: 1.8rem;
    letter-spacing: 6px;
    text-transform: lowercase;
    color: #CADBE7;
    display: block;
}
.asyora-offcanvas-tagline {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: #CADBE7;
    opacity: 0.75;
    margin-top: 4px;
}

.asyora-offcanvas .offcanvas-body { padding: 1rem 0.5rem 2rem 0.5rem; }

/* Section title (Catégories, Mon espace) */
.asyora-mobile-section-title {
    font-family: 'Avenir Next','Avenir Next Arabic', serif;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #38111C;
    opacity: 0.55;
    padding: 1.25rem 1.25rem 0.5rem 1.25rem;
    margin-bottom: 0;
}

/* Liens principaux */
.asyora-mobile-nav { display: flex; flex-direction: column; }
.asyora-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #38111C;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: 0;
    transition: background 0.2s ease, padding-left 0.2s ease;
}
.asyora-mobile-nav-link i {
    font-size: 1.2rem;
    color: #5a1e2d;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.asyora-mobile-nav-link:hover,
.asyora-mobile-nav-link:focus {
    background-color: rgba(202, 219, 231, 0.35);
    color: #5a1e2d;
    padding-left: 26px;
}

/* Accordion catégories */
.asyora-mobile-accordion .accordion-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(56, 17, 28, 0.06);
}
.asyora-mobile-accordion .accordion-button {
    background: transparent;
    color: #38111C;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 14px 20px;
    box-shadow: none !important;
}
.asyora-mobile-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(202, 219, 231, 0.25);
    color: #5a1e2d;
}
.asyora-mobile-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2338111C'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.asyora-mobile-accordion .accordion-body {
    padding: 4px 20px 12px 50px;
    background: transparent;
}
.asyora-sub-link {
    display: block;
    padding: 8px 12px;
    color: #38111C;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
    opacity: 0.85;
}
.asyora-sub-link:hover {
    color: #5a1e2d;
    border-left-color: #CADBE7;
    background-color: rgba(202, 219, 231, 0.2);
    padding-left: 18px;
    opacity: 1;
}

/* Bouton burgundy spécifique */
.btn-asyora-burgundy {
    background: linear-gradient(135deg, #38111C 0%, #5a1e2d 100%);
    color: #f4f1EB !important;
    border: none;
    transition: all 0.2s ease;
}
.btn-asyora-burgundy:hover,
.btn-asyora-burgundy:focus {
    background: linear-gradient(135deg, #5a1e2d 0%, #752a3d 100%);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(56, 17, 28, 0.3);
}

/* Sur desktop : on garde la navbar standard, le hamburger n'apparaît pas */
@media (min-width: 992px) {
    .asyora-mobile-toggle { display: none !important; }
}

/* Sur mobile : la navbar ne contient plus que le logo (back arrow).
   On masque les icônes (catalogue, infos, panier, etc.) et le bouton
   Connexion — ils sont déjà accessibles via le menu hamburger. */
@media (max-width: 991.98px) {
    .navbar .nav-icon-btn { display: none !important; }
    /* Cache tous les boutons d'action (Connexion, Inscription, etc.) dans la navbar
       sur mobile — sauf le hamburger lui-même. */
    .navbar a.btn,
    .navbar button.btn:not(.asyora-mobile-toggle),
    .navbar .btn.rounded-pill { display: none !important; }
    .navbar .asyora-mobile-toggle { display: inline-flex !important; }
    /* Garde une marge à droite pour ne pas que le contenu passe sous le hamburger */
    .navbar { padding-right: 64px !important; }
}

/* ================================================================
   16) Améliorations visuelles globales — micro design polish
   ================================================================ */

/* Effet hover plus doux sur toutes les cartes */
.card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(56, 17, 28, 0.10); }

/* Boutons : focus ring plus joli */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 17, 28, 0.18) !important;
}

/* Liens : transition douce */
a { transition: color 0.15s ease; }

/* Inputs : focus ring cohérent */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #5a1e2d !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 17, 28, 0.15) !important;
}

/* Scrollbar plus discrète sur webkit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f4f1EB; }
::-webkit-scrollbar-thumb { background: #CADBE7; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #38111C; }

/* ================================================================
   17) HEADER HÉRO "Asyora Essential" — page d'accueil
   Bandeau bordeaux avec le logo. Hauteur modérée et harmonieuse.
   ================================================================ */
.asyora-hero-header {
    min-height: 200px;
    padding: 40px 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Effet décoratif subtil : léger dégradé radial pour donner de la profondeur */
.asyora-hero-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(202, 219, 231, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.asyora-hero-header .logo-container {
    position: relative;
    z-index: 1;
    gap: 0.5rem;
}

/* Hauteurs progressives selon la taille d'écran */
@media (min-width: 768px) {
    .asyora-hero-header { min-height: 240px; padding: 50px 20px !important; }
}
@media (min-width: 1200px) {
    .asyora-hero-header { min-height: 280px; padding: 60px 20px !important; }
}

/* Sur mobile : compact mais lisible */
@media (max-width: 575.98px) {
    .asyora-hero-header { min-height: 160px; padding: 30px 15px !important; }
}

