/* style-front.css - Version 6.0 */

/* ==========================================================================
   Variables & Thèmes
   ========================================================================== */
:root {
    /* Polices */
    --font-primary: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-headings: 'Oswald', var(--font-primary); /* Police plus impactante */
    --font-accent: 'Oswald', var(--font-primary); /* Utiliser Oswald pour les titres */
    
    




    /* Couleurs Light Mode (Défaut) */
    --primary-color: #B71C1C; /* Rouge Boucherie */
    --secondary-color: #212121; /* Gris très foncé */
    --accent-color: #FFC107; /* Jaune / Or */
    --bg-color: #F8F9FA; /* Fond très clair légèrement gris */
    --card-bg-color: #FFFFFF; /* Fond des cartes/items */
    --text-color: #343A40; /* Texte principal un peu plus doux */
    --text-muted-color: #6C757D; /* Texte discret */
    --text-light-color: #FFFFFF; /* Texte sur fond sombre */
    --header-bg: #8B0000; /* Header principal bordeaux */
    --header-text-color: #FFFFFF;
    --filter-bg: rgba(255, 255, 255, 0.98); /* Presque opaque */
    --filter-border: #dee2e6; /* Bordure filtre légère */
    --filter-btn-bg: #e9ecef; /* Fond bouton filtre */
    --filter-btn-text: #495057; /* Texte bouton filtre */
    --filter-btn-active-bg: var(--primary-color);
    --filter-btn-active-text: #FFFFFF;
    --border-color: #dee2e6; /* Bordure générale */
    --shadow-color: rgba(0, 0, 0, 0.07);
    --shadow-hover-color: rgba(0, 0, 0, 0.12);
    --hero-overlay-color: rgba(0, 0, 0, 0.4); /* Assombrissement image héro */

    /* Constantes */
    --border-radius: 8px;
    --box-shadow: 0 3px 8px var(--shadow-color);
    --box-shadow-hover: 0 5px 15px var(--shadow-hover-color);
    --transition: all 0.25s ease-in-out;
    --header-height: 70px;
    /* Pas de hauteur fixe pour filtre */
    --container-width: 1200px;
}

@font-face {
  font-family: 'tungsten';
  src: url('fonts/Tungsten-Book.woff2') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Animation de pulsation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Application au bouton */
.game-btn {
  animation: pulse 2.5s infinite;
  transform-origin: center;
  display: inline-block; /* Important pour les transformations */
}

.bg-indigo-800 {
    --tw-bg-opacity: 1;
    background-color: rgb(86 151 255) !important;
}



/* Style bouton jeu */
.game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #f3f4f6;
    color: #cd171a;
    font-size: 1.25em;
    border-radius: 7px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: background 0.15s, color 0.14s, box-shadow 0.14s;
    margin-left: 2px;
}

.game-btn:hover,
.game-btn:focus {
    background: #e9ecef;
    color: #911315;
    box-shadow: 0 4px 12px #d9042911;
    outline: none;
}

.game-btn i {
    pointer-events: none;
}




/* AJOUT : Styles pour les allergènes sur la carte du menu */
.product-description-list .product-allergens {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-description-list .product-allergens i {
    font-size: 1.1rem;
    color: var(--text-muted-color);
}

/* AJOUT : Styles pour la légende des allergènes */
.allergen-legend-container {
    margin-top: 40px;
    padding: 20px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    border-top: 3px solid var(--primary-color);
    width: 95%;
    margin: 0 auto;
}

.legend-title {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.legend-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.legend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-icon {
    color: var(--primary-color);
}





div#menu-container {
    width: 95%;
    margin: 0 auto;
    margin-top: 20px;
}

.filter-btn {
   font-family: 'tungsten', sans-serif;
}


.product-image-container-list {
    display: none;
}

body.dark-mode {
    /* Couleurs Dark Mode */
    --primary-color: #cd171a; /* Rouge plus doux en dark */
    --secondary-color: #f5f5f5; /* Texte principal clair */
    --accent-color: #FFD54F; /* Jaune légèrement plus doux */
    --bg-color: #1a1a1a; /* Fond très sombre */
    --card-bg-color: #2c2c2c; /* Fond cartes/items sombre */
    --text-color: #e0e0e0; /* Texte standard */
    --text-muted-color: #bdbdbd; /* Texte discret */
    --text-light-color: #121212; /* Texte sur fond clair (théorique) */
    --header-bg: #1f1f1f; /* Header très sombre */
    --header-text-color: #e0e0e0;
    --filter-bg: rgba(44, 44, 44, 0.98); /* Fond filtre sombre */
    --filter-border: #424242; /* Bordure filtre sombre */
    --filter-btn-bg: #424242; /* Fond bouton filtre sombre */
    --filter-btn-text: #e0e0e0; /* Texte bouton filtre */
    --filter-btn-active-bg: var(--primary-color);
    --filter-btn-active-text: #FFFFFF;
    --border-color: #424242; /* Bordure générale sombre */
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover-color: rgba(0, 0, 0, 0.4);
    --hero-overlay-color: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Reset & Basics
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}
body.bg-light {
    background-color: var(--bg-color); /* Appliqué par défaut via JS */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */
.main-header { /* Renommer la classe pour clarté */
    background-color: var(--header-bg);
    color: var(--header-text-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; /* Reste en haut */
    top: 0;
    z-index: 110; /* Au dessus de tout, y compris filtre */
    transition: background-color 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
        width: 95%;
}

.header-left, .header-right {
    flex: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style bouton jeu */
.game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    background: #f3f4f6;
    color: #cd171a;
    font-size: 1.25em;
    border-radius: 7px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: background 0.15s, color 0.14s, box-shadow 0.14s;
    margin-left: 2px;
}

.game-btn:hover,
.game-btn:focus {
    background: #e9ecef;
    color: #911315;
    box-shadow: 0 4px 12px #d9042911;
    outline: none;
}

.game-btn i {
    pointer-events: none;
}

.header-center {
    flex: 2;
    text-align: center;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.restaurant-title {
    font-family: var(--font-headings);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--header-text-color);
    margin: 0;
    text-transform: uppercase;
}

.restaurant-title img {
    max-height: calc(var(--header-height) - 20px);
    display: inline-block;
    vertical-align: middle;
}

div#restaurant-logo {
    display: flex
;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.restaurant-logo-container img {
  /* Définissez une hauteur maximale légèrement inférieure à celle du header */
  max-height: 50px; /* Ajustez cette valeur (ex: 45px, 55px) */
  width: auto;      /* Garde les proportions */
  display: block;   /* Bonnes pratiques pour les images */
}


/* Toggle Dark Mode */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--header-text-color);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 5px;
    line-height: 1;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.theme-toggle-btn .icon-sun {
    display: none;
}

.dark-mode .theme-toggle-btn .icon-sun {
    display: inline-block;
}

.dark-mode .theme-toggle-btn .icon-moon {
    display: none;
}

/* Language Switch */
.language-switch {
    display: flex;
    gap: 5px;
    align-items: center;
}

.lang-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
}

.lang-btn.active {
    background-color: #fff;
    color: var(--header-bg); /* Ou --primary-color */
    border-color: #fff;
    font-weight: bold;
}

.dark-mode .lang-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-mode .lang-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ==========================================================================
   Section Héro
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    background-image: url('https://laboucherie.mq/menu2/viande_back.jpg');
    background-size: cover;
    background-position: center center;
    overflow: hidden;
    /* Hauteur responsive */
    height: 250px; /* Mobile */
}

@media (min-width: 768px) { /* Tablette */
    .hero-section {
        height: 450px;
    }
}

@media (min-width: 1024px) { /* Desktop */
    .hero-section {
        height: 650px;
    }
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hero-overlay-color); /* Assombrissement */
    transition: background-color 0.3s ease;
    text-align: center;
    padding: 20px;
}

.hero-title-text {
    font-family: var(--font-accent);
    font-size: clamp(2.5rem, 8vw, 5.5rem); /* Taille responsive */
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    margin: 0;
}

/* ==========================================================================
   Filtre Catégories (Sticky SOUS Header APRÈS Scroll Héro)
   ========================================================================== */
.category-filter-sticky {
    position: sticky;
    /* Colle SOUS le main-header */
    top: var(--header-height, 70px);
    z-index: 100; /* Sous le header principal, au dessus du contenu */
    background: var(--bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 102%;
    padding: 20px 0;
    margin-left: -3px;
}

.category-filter-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px; /* Padding interne container */
}

.filter-buttons-wrapper { /* Nouveau wrapper */
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px; /* Espace ajusté */
    justify-content: center; /* Centrer les boutons */
}

.filter-btn {
    background: var(--filter-btn-bg);
    border: 1px solid transparent; /* Pour cohérence */
    padding: 2px 6px;
    border-radius: 6px;
    transition: var(--transition);
    color: var(--filter-btn-text);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: 0.6px;
}

.filter-btn:hover {
    border-color: #ccc;
    background-color: #e2e6ea;
}

.dark-mode .filter-btn:hover {
     border-color: #555;
     background-color: #4f4f4f;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--filter-btn-active-text);
    font-weight: 600;
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.dark-mode .filter-btn.active {
    border-color: var(--primary-color) !important;
}

/* ==========================================================================
   Main Content & Menu Structure
   ========================================================================== */
.main-content {
    padding-top: 0px; /* Espace initial au dessus du premier titre */
    padding-bottom: 40px;
    position: relative; /* Nécessaire si on utilise des marges négatives sur sticky */
}

.loading-indicator {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted-color);
}

.loading-spinner {
    font-size: 2.8rem;
    color: var(--primary-color);
    animation: fa-spin 1.5s infinite linear;
}

.loading-text {
    margin-top: 15px;
    font-size: 1.1rem;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.menu-content {
    display: none; /* Affiché par JS */
    margin-top: 20px; /* Espace après filtre */
}

.category-section {
    margin-bottom: 50px;
}

/* Header Catégorie Principale */
.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.category-icon.fas {
    font-size: 1.6rem;
    color: var(--primary-color);
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    background-color: var(--card-bg-color);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.category-title {
    font-family: var(--font-headings);
    font-size: clamp(1.6rem, 4.5vw, 2rem);
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.3s ease;
    margin: 0;
}

/* Header Sous-Catégorie */
.subcategory-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 45px;
    margin-bottom: 25px;
    padding-left: 5px;
    width: 100%;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.subcategory-header > .subcategory-icon.fas {
    font-size: 1.4rem;
    color: var(--primary-color);
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border: none;
    padding: 0;
    margin: 0;
}

.subcategory-title { /* Appliqué au H3 */
    font-family: var(--font-headings);
    font-size: clamp(1.4rem, 3.8vw, 1.6rem);
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    padding-left: 12px;
    border-left: 5px solid var(--accent-color);
    flex-grow: 1;
    line-height: 1.3;
    background: transparent !important;
    border-radius: 0 !important;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   Product Display (Liste et Liste en colonnes)
   ========================================================================== */

.products-container {
    margin-top: 10px;
}

.product-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background-color: var(--card-bg-color);
    padding: 15px;
    border: 0px solid transparent;
    border-bottom-color: var(--border-color);
    transition: background-color 0.2s ease, border-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
    overflow: visible; /* Permettre ombres */
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.product-item:hover {
    background-color: rgba(0,0,0,0.02);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.dark-mode .product-item:hover {
    background-color: rgba(255,255,255,0.04);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.products-container:last-of-type > .product-item:last-child {
    margin-bottom: 0;
}

.product-image-container-list {
    width: 75px;
    height: 75px;
    flex-shrink: 0;
    border-radius: calc(var(--border-radius) - 3px);
    overflow: hidden;
    background-color: #e9ecef;
}

.dark-mode .product-image-container-list {
    background-color: #424242;
}

.product-image-list {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details-list {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px 10px;
    overflow: hidden;
    align-items: start;
}

.product-name-list {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.35;
    transition: color 0.3s ease;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    align-self: start;
    padding-right: 5px;
}

.product-price-list {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
    line-height: 1.35;
    flex-shrink: 0;
    padding-left: 10px;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    white-space: nowrap;
    align-self: start;
}

.product-description-list {
    font-size: 0.9rem;
    color: var(--text-muted-color);
    line-height: 1.5;
    transition: color 0.3s ease;
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    text-overflow: clip;
    margin: 0;
    padding-top: 2px;
    white-space: normal;
    word-break: break-word;
}

.product-description-list[style*="display: none"] {
    display: none !important;
}

/* ==========================================================================
   Multi-colonnes pour Tablette & Desktop (Liste en colonnes)
   ========================================================================== */
@media (min-width: 640px) {
    .products-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px; /* Augmenter gap */
        margin-top: 20px;
        border: none;
    }

    .product-item {
        border: 0px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: none;
        margin-bottom: 0;
        padding: 18px; /* Augmenter padding */
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .product-item:hover {
        box-shadow: var(--box-shadow);
        transform: translateY(-2px);
    }

    .product-image-container-list { width: 85px; height: 85px; }
    .product-name-list { font-size: 1.1rem; }
    .product-price-list { font-size: 1.15rem; }
    .product-description-list { font-size: 0.9rem; }
}

@media (min-width: 1024px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .product-item {
        padding: 20px; /* Encore plus de padding */
    }

    .product-image-container-list { width: 90px; height: 90px; } /* Image un peu plus grande */
    .product-name-list { font-size: 1.15rem; } /* Nom un peu plus grand */
    .product-price-list { font-size: 1.2rem; }
    .product-description-list { font-size: 0.9rem; }
}

/* ==========================================================================
   Footer & Scroll-to-Top
   ========================================================================== */
.site-footer {
    background-color: var(--secondary-color);
    color: rgba(255, 255, 255, 0.7);
    padding: 30px 15px;
    text-align: center;
    margin-top: 60px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.dark-mode .site-footer {
    background-color: #111;
}

.scroll-top-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 100;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.scroll-top-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-top-button:hover {
    opacity: 0.9;
}

.dark-mode .scroll-top-button {
    background-color: var(--primary-color);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.hidden {
    display: none !important;
}


@media (max-width: 640px) {
  .filter-buttons-wrapper {
    /* Pour les écrans tactiles, ne capter que les mouvements horizontaux */
    touch-action: pan-x;
  }
}


/* —————————————————————————————————————————————
   MOBILE (max-width: 640px) – barre en ligne scrollable 
   ————————————————————————————————————————————— */
@media (max-width: 640px) {
  /* Assurer la largeur totale */
  .category-filter-sticky {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 16px 10px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    touch-action: pan-x;
    background-color: var(--bg-color);
    box-shadow: 0 1px 15px rgba(0, 0, 0, 0.1);
  }
  
  /* Wrapper en one-line, priorité max */
  .category-filter-sticky .filter-buttons-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
  }
  .category-filter-sticky .filter-buttons-wrapper::-webkit-scrollbar {
    display: none;
  }

  /* Boutons qui ne s’étirent pas */
  .category-filter-sticky .filter-btn {
    flex: 0 0 auto !important;
  }
}