/* ==========================================================================
   1. VARIABLES, ANIMATIONS & GLOBAUX
   ========================================================================== */
:root {
    --fiche-color: <?= $ficheColor ?>;
    --fiche-color-rgb: <?= $fiche_color_rgb ?>;
    --text-muted: #6c757d;
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 15px rgba(var(--fiche-color-rgb), 0.3); }
    50% { box-shadow: 0 0 25px rgba(var(--fiche-color-rgb), 0.5); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   2. HEADER RESTAURANT (Fiche, Vidéo & Infos)
   ========================================================================== */
.resto-header-wrapper {
    position: relative;
    overflow: visible; 
    padding: 25px 20px;
    z-index: 110;
    background: radial-gradient(circle at 100% 0%, <?= $ficheColor ?>25 0%, transparent 250px), 
                linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.resto-header-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.resto-main-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    animation: floatIn 0.6s ease;
}

.resto-header-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: 220px;
}

/* Vidéo de fond */
.video-bg-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
}

.video-bg {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: blur(2px);
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
}

.resto-header-wrapper.has-video-bg {
    padding-top: 40px; 
    padding-bottom: 40px;
    border-bottom: 3px solid <?= $ficheColor ?>;
}

.resto-header-wrapper.has-video-bg .resto-main-card {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Image du restaurant */
.resto-image-section {
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.resto-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    aspect-ratio: 4/3;
}

.resto-hero-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resto-image-container:hover .resto-hero-img { transform: scale(1.05); }

/* Infos textuelles */
.resto-info-section {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.resto-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 18px;
}

.resto-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 !important;
    letter-spacing: -0.3px;
    line-height: 1.2;
    flex: 1;
}

/* === MODIFICATION : ALIGNEMENT HORIZONTAL PC === */
.resto-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.resto-info-item {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex; /* Flex par défaut */
    flex-direction: row; /* Icône à côté du texte par défaut (PC) */
    align-items: center;
    gap: 12px;
}

.resto-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    border-color: var(--fiche-color);
}

.info-icon-inline {
    width: 28px; height: 28px;
    background: <?= $ficheColor ?>;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0 !important; /* On retire la marge du bas */
    flex-shrink: 0;
    box-shadow: 0 3px 8px <?= $ficheColor ?>40;
}

.info-text-wrapper {
    text-align: left;
}

.info-label-sm {
    display: none !important; /* On masque les labels "Adresse", "Téléphone" */
}

.info-value-sm { 
    font-size: 0.85rem; 
    color: #374151; 
    font-weight: 600; 
    line-height: 1.4; 
}
/* === FIN MODIFICATION PC === */

.info-value-sm a { color: #374151; text-decoration: none; transition: color 0.2s ease; }
.info-value-sm a:hover { color: var(--fiche-color); }

.horaires-compact { font-size: 0.8rem; color: #6b7280; line-height: 1.5; margin-top: 2px; }

/* Status Bar */
.resto-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    border-top: 2px solid #1F2937;
    gap: 15px;
}

.resto-status-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.resto-status-pill {
    background: white;
    padding: 10px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    font-size: 0.85rem;
}

.resto-status-pill.open { color: #10b981; }
.resto-status-pill.open .pulse-dot { animation: breathe 2s ease-in-out infinite; }
.resto-status-pill.closed { color: #ef4444; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ==========================================
   3. NAVIGATION DES CATÉGORIES
   ========================================== */
.category-nav-wrapper {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.category-nav { max-width: 1200px; margin: 0 auto; }

.category-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-menu { display: flex; list-style: none; padding: 0; margin: 0; justify-content: center; }
.category-item { margin: 0 4px; }

.category-link {
    display: block;
    padding: 8px 16px;
    color: #444;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 20px;
    background-color: #f5f5f5;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-link.active {
    background-color: var(--fiche-color, #01aff1);
    color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.category-link:hover:not(.active) {
    background-color: #e9e9e9;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   4. CARTES PRODUITS (PLATS)
   ========================================== */
.plat-div {
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.plat-div:hover { border-left-color: <?= htmlspecialchars($ficheColor) ?>; }

.productitem { cursor: pointer; pointer-events: auto; }

.product-card-content { display: flex; height: 100%; }

.product-image-wrapper {
    width: 100px; min-width: 100px; height: 100px;
    overflow: hidden;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.product-image-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
    user-select: none;
}

.product-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-info-wrapper.full-width { width: 100%; }

.plat-titre { font-size: 1.1rem; }
.plat-prix { font-size: 0.9rem !important; }

.plat-desc {
    font-size: 0.8rem !important;
    color: var(--text-muted, #6c757d) !important;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal;
}

.card-body { padding: 15px 10px !important; }

/* Panier flottant */
.floating-cart { bottom: 15px; right: 15px; }

/* ==========================================
   5. MODALES (PRODUIT & OPTIONS)
   ========================================== */
.click-collect-modal {
    max-width: 700px;
    width: 95%;
    background: white;
    border-radius: 16px;
    overflow: visible;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body { display: flex; flex-direction: column; flex: 1; overflow: hidden; max-height: 80vh; scrollbar-width: thin;}
/* Rend la barre de défilement du modal invisible ou très fine sur Chrome/Edge sur PC */
/*.modal-body::-webkit-scrollbar {
    width: 4px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
body.dark-mode .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}*/

.modal-content-wrapper { padding: 25px; overflow-y: auto; flex: 1; }

.modal-header {
    position: relative;
    padding: 15px 20px 0 20px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 0 !important;
}

.btn-close {
    background: #f3f4f6; border: none; width: 36px; height: 36px;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.2s ease;
}

.btn-close:hover { background: #e5e7eb; transform: scale(1.1); }
.btn-close svg { width: 20px; height: 20px; stroke-width: 2.5; }

/* En-tête produit dans modal */
.product-header { display: flex; gap: 20px; margin-bottom: 20px; }

.product-carousel {
    position: relative;
    width: 180px; min-width: 180px; height: 180px;
    background: #f5f5f5; border-radius: 12px;
    overflow: hidden; flex-shrink: 0;
}

.carousel-image { width: 100%; height: 100%; object-fit: cover; display: none; }
.carousel-image.active { display: block; }

.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6); color: white; border: none;
    width: 35px; height: 35px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; transition: all 0.3s ease; z-index: 10;
}

.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }

.product-header-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.product-modal-title { font-size: 1.4rem; font-weight: 700; color: #1f2937; margin: 0 0 10px 0; }
.product-main-price { font-size: 1.6rem; font-weight: 700; color: <?php echo $ficheColor; ?>; margin: 5px 0 10px 0; }
.product-modal-description { font-size: 0.9rem; color: #6b7280; line-height: 1.5; margin: 0; }

.modal-divider { height: 1px; background: #e5e7eb; margin: 20px 0; }

/* Options & Variations */
.option-group {
    margin-bottom: 20px; padding: 20px 0; border-top: 1px solid #e5e7eb;
}
.option-group:first-child { border-top: none; padding-top: 0; }

.variations-label, .options-label {
    font-size: 1rem; font-weight: 700; color: #1f2937;
    margin-bottom: 12px; display: block; position: relative; padding-left: 12px;
}

.options-label::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 20px; background: <?php echo $ficheColor; ?>; border-radius: 2px;
}

.variation-options, .checkbox-options, .radio-options, .qty-options {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}

.variation-option, .option-item, .radio-option-item { position: relative; flex: 0 0 auto; margin: 0 !important; }

.variation-option input[type="radio"], .option-item input[type="checkbox"], 
.option-item input[type="radio"], .radio-option-item input[type="radio"] {
    position: absolute; opacity: 0; pointer-events: none;
}

.variation-label, .option-item label, .radio-option-item label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px 18px; background: #f5f5f5; border: 2px solid #e0e0e0;
    border-radius: 12px; cursor: pointer; transition: all 0.3s ease;
    min-width: 85px; text-align: center; min-height: 60px; margin: 0;
}

.variation-label:hover, .option-item label:hover {
    background: #e9ecef; border-color: <?php echo $ficheColor; ?>80;
}

.variation-option input[type="radio"]:checked + .variation-label,
.option-item input[type="checkbox"]:checked + label,
.option-item input[type="radio"]:checked + label,
.radio-option-item input[type="radio"]:checked + label {
    background: <?php echo $ficheColor; ?>15; border-color: <?php echo $ficheColor; ?>;
    box-shadow: 0 2px 8px <?php echo $ficheColor; ?>40;
}

.variation-name, .option-item label span:first-child { font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 4px; }
.variation-price, .option-item label span:last-child { font-size: 0.8rem; color: #666; font-weight: 500; }
.variation-option input[type="radio"]:checked + .variation-label .variation-name,
.option-item input[type="checkbox"]:checked + label span:first-child { color: <?php echo $ficheColor; ?>; }

/* Footer Modal */
.modal-footer { border-top: 1px solid #e5e7eb; padding: 20px 25px; background: #f9fafb; flex-shrink: 0; }
.footer-content { display: flex; gap: 15px; align-items: flex-end; }
.quantity-label { font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 5px; display: block; }
.quantity-select { padding: 10px 15px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem; font-weight: 600; background: white; min-width: 80px; }

.add-to-cart-btn {
    flex: 1; padding: 12px 20px; background: <?php echo $ficheColor; ?>; color: white;
    border: none; border-radius: 8px; font-weight: 600; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s ease; margin-top: 1rem;
}
.add-to-cart-btn:hover { background: <?php echo $colorDark; ?>; transform: translateY(-1px); box-shadow: 0 4px 12px <?php echo $ficheColor; ?>40; }

/* ==========================================
   6. BADGES, STATUTS & MODES
   ========================================== */
.badge-status { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 500; color: white; }
.badge-status.closed { background-color: #dc3545; }
.badge-status.open { background-color: #28a745; }

.time-badge {
    background: white; padding: 8px 14px; border-radius: 50px;
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 0.85rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e7eb; transition: all 0.3s ease;
    animation: fadeInScale 0.4s ease;
}
.time-badge i { font-size: 1rem; }
.preparation-time { color: #f59e0b; border-color: #fcd34d; }
.preparation-time:hover { background: #fef3c7; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
.delivery-time { color: #3b82f6; border-color: #93c5fd; }
.delivery-time:hover { background: #dbeafe; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); }

/* Changement de mode */
.change-mode-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: white; border: 2px solid #e5e7eb;
    padding: 8px 16px; border-radius: 50px; font-weight: 600;
    font-size: 0.85rem; color: #1f2937; cursor: pointer;
    transition: all 0.3s ease; white-space: nowrap; flex-shrink: 0;
}
.change-mode-badge:hover {
    background: #f9fafb; border-color: var(--fiche-color);
    color: var(--fiche-color); transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.mode-buttons-3 { grid-template-columns: repeat(3, 1fr) !important; }
.mode-btn-asap:hover { border-color: #f59e0b; background: #fef3c7; }
.mode-btn-asap .mode-btn-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.mode-btn-creneaux:hover { border-color: #3b82f6; background: #dbeafe; }
.mode-btn-creneaux .mode-btn-icon { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }

/* ==========================================
   7. SYSTÈME (CODE POSTAL, FERMETURE & INFOS)
   ========================================== */

/* Overlay principal : Centre tout verticalement et horizontalement */
.cp-validation-overlay {
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8); 
    z-index: 999999;
    display: none; /* Piloté par JS (doit être mis en 'flex') */
    
    /* CENTRAGE VERTICAL ET HORIZONTAL */
    align-items: center; 
    justify-content: center;
    
    /* Sécurité pour décoller du haut/bas sur petits écrans */
    padding: 40px 20px; 
    
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Contenu de la modale : Format compact et sombre */
.cp-validation-content {
    background: #343a40; 
    color: white;
    border-radius: 16px; 
    padding: 25px;
    width: 100%; 
    max-width: 350px; /* Plus petit pour gagner de la place */
    text-align: left;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    
    /* GESTION DU DÉCOLLAGE ET DU SCROLL */
    margin: auto; /* Force le navigateur à équilibrer l'espace */
    max-height: calc(100vh - 80px); /* Laisse 40px de marge en haut et en bas */
    overflow-y: auto;
}

/* Titre simplifié */
.cp-validation-content h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: white;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    text-align: center;
}

/* Bouton Fermer discret en haut à droite */
.cp-back-btn {
    position: absolute; 
    top: 15px; 
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none; 
    border-radius: 50%; 
    width: 32px; 
    height: 32px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.cp-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* On masque l'ancienne icône géante pour gagner de la place */
.cp-icon { display: none !important; }

/* Groupes d'entrée (Code Postal) */
.cp-input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-top: 15px; 
}

.cp-input { 
    width: 100%;
    padding: 12px; 
    border: 1px solid #495057; 
    border-radius: 8px; 
    font-size: 1.1rem; 
    text-align: center; 
    background: #2b3035;
    color: white;
}

.cp-verify-btn { 
    background: var(--fiche-color); 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
}

/* Modal Restaurant Fermé (Look cohérent) */
.restaurant-closed-modal {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8); 
    z-index: 999999; 
    justify-content: center; 
    align-items: center;
}

.restaurant-closed-content { 
    background-color: white; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 400px; 
    padding: 25px; 
    text-align: center; 
}

.restaurant-closed-title { 
    font-size: 20px; 
    font-weight: bold; 
    color: #d32f2f; 
    margin-bottom: 15px; 
}

.restaurant-closed-hours { 
    background-color: #f8f9fa; 
    padding: 15px; 
    border-radius: 8px; 
    text-align: left; 
    color: #333;
    font-size: 0.9rem;
}

.close-modal-btn { 
    background-color: #d32f2f; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 6px; 
    font-weight: bold; 
    margin-top: 15px;
    cursor: pointer;
}

/* Scrollbar personnalisée pour la modale sombre */
.cp-validation-content::-webkit-scrollbar {
    width: 4px;
}
.cp-validation-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ==========================================
   8. MEDIA QUERIES (RESPONSIVE)
   ========================================== */

/* --- TABLETTE & DESKTOP --- */
@media (min-width: 769px) {
    .change-mode-badge.desktop-only { display: inline-flex; }
    .change-mode-badge.mobile-only { display: none; }
}

@media (min-width: 768px) and (max-width: 991px) {
    .row > .col-md-4.col-sm-6.col-12.mb-2 { flex: 0 0 50%; max-width: 50%; }
}

@media (max-width: 992px) {
    .resto-header-grid { grid-template-columns: 180px 1fr !important; min-height: auto; }
    .resto-image-section { padding: 20px; align-items: center; }
    .resto-image-container { width: 100%; max-width: 160px; }
    .resto-info-section { padding: 25px 20px 25px 0; }
    .resto-title-row { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .resto-title { font-size: 1.6rem; text-align: left; }
    .resto-info-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }
}

/* --- MOBILE GÉNÉRAL (Max 768px) --- */
@media (max-width: 768px) {
    .resto-status-bar-content { gap: 8px; }
    .product-image-wrapper { width: 80px; min-width: 80px; height: 80px; }
    .plat-titre { font-size: 0.9rem !important; }
    .time-badge { font-size: 0.75rem; padding: 6px 10px; }
    .time-badge i { font-size: 0.85rem; }
    .change-mode-badge.desktop-only { display: none !important; }
    .change-mode-badge.mobile-only { display: inline-flex; }
    .product-header { flex-direction: column; }
    .product-carousel { width: 100%; max-width: 180px; height: 180px; margin: 0 auto; }
    .product-modal-title { font-size: 1.2rem; text-align: center; margin-top: 10px; }
    .product-main-price { font-size: 1.4rem; text-align: center; }
    .product-modal-description { text-align: center; font-size: 0.85rem; line-height: 1.4; }
    .modal-content-wrapper, .modal-footer { padding: 15px; }
    .footer-content { flex-direction: column; gap: 10px; }
    .quantity-selector, .add-to-cart-btn { width: 100%; }
    .carousel-arrow { width: 30px; height: 30px; font-size: 16px; }
    .carousel-arrow.prev, .carousel-arrow.next { left: 8px; right: 8px; }
    .resto-title { font-size: 1.5rem; }
    .resto-header-grid { grid-template-columns: 110px 1fr !important; gap: 15px !important; padding: 20px; }
    .resto-image-section { background: transparent !important; padding: 0 !important; }
    .resto-image-container { width: 110px; height: 110px; aspect-ratio: 4/3; }
    .resto-info-section { padding: 0 !important; }
    .resto-info-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
    .resto-info-item { padding: 8px 12px !important; display: flex !important; align-items: center !important; gap: 10px !important; }
    .info-icon-inline { margin-bottom: 0 !important; width: 32px !important; height: 32px !important; }
    .info-label-sm { display: none !important; }
    .info-value-sm { font-size: 0.8rem; }
    .resto-status-bar { padding: 15px; flex-wrap: wrap; }
    .resto-status-pill { flex: 1; font-size: 0.8rem; padding: 8px 12px; }
    .badge-status { padding: 5px 10px; font-size: 0.8rem; width: auto; margin: 0 auto; }
    .col-md-5.col-sm-12.text-md-end.text-center { margin-top: 10px !important; }
    .category-nav-wrapper { padding: 8px 0; }
    .category-link { padding: 6px 12px; font-size: 0.8rem; min-width: auto; }
    .category-menu { justify-content: flex-start; padding: 0 10px; }
    .card-body { padding: 15px 10px !important; }
    .plat-titre { font-size: 1rem !important; }
    .plat-prix { font-size: 0.9rem !important; }
    .plat-div { height: auto !important; min-height: 80px; }
    .click-collect-modal { width: 95% !important; max-width: 95% !important; }
    .product-container { flex-direction: column !important; }
    .product-info { width: 100% !important; padding: 10px !important; }
    .checkbox-options { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }
    .option-item { padding: 10px 6px; }
    input[type="checkbox"] { transform: scale(1.2); }
    select.form-control { height: 40px; }
}

/* --- SMARTPHONES (Max 576px) --- */
@media (max-width: 576px) {
    .resto-info-grid {
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 15px !important;
        margin-top: 10px;
        justify-items: center;
    }

    .resto-info-item {
        flex-direction: column !important; /* Retour en colonne pour mobile */
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        width: auto !important;
    }

    .info-icon-inline {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50% !important;
        margin-bottom: 0 !important;
        font-size: 1.1rem !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    }

    .info-text-wrapper, 
    .info-label-sm, 
    .info-value-sm, 
    .horaires-compact {
        display: none !important;
    }
    
    .resto-title {
        text-align: center !important;
        width: 100%;
        font-size: 1.3rem !important;
    }
    
    .resto-info-section {
        align-items: center !important;
        padding: 15px !important;
    }
}

/* --- TRÈS PETITS ÉCRANS (Max 480px) --- */
@media (max-width: 480px) {
    .checkbox-options { grid-template-columns: repeat(2, 1fr) !important; }
    .modal-footer .footer-content { flex-direction: row !important; align-items: center; }
    .quantity-selector { width: 100% !important; margin-bottom: 10px !important; }
    .add-to-cart-btn { width: 100% !important; }
    .product-carousel { max-width: 150px; height: 150px; }
    .modal-content-wrapper { padding: 12px; }
}

/* ==========================================
   9. MODES SPÉCIFIQUES (DARK MODE, ETC)
   ========================================== */
body.dark-mode .time-badge { background: var(--bg-card); border-color: var(--border-secondary); }
body.dark-mode .preparation-time { color: #fbbf24; }
body.dark-mode .delivery-time { color: #60a5fa; }
body.dark-mode .resto-header-wrapper.has-video-bg .resto-main-card { background-color: rgba(31, 41, 55, 0.85); border: 1px solid rgba(255, 255, 255, 0.05); }

/* Fix final pour défilement modale */
.click-collect-modal { max-height: 85vh; overflow-y: auto; }
.product-options { overflow-y: visible; max-height: none; margin-bottom: 20px; }
.modal-body { overflow-y: visible; }




/* Limite de hauteur avec scrollbar pour les grandes listes d'options */
.options-scrollable {
    max-height: 350px !important;
    overflow-y: auto;
	overflow-x: hidden !important;
    padding-right: 0 5px !important;
    scrollbar-width: thin;
    scrollbar-color: var(--fiche-color) transparent;
}
.options-scrollable::-webkit-scrollbar {
    width: 5px;
}
.options-scrollable::-webkit-scrollbar-thumb {
    background-color: var(--fiche-color);
    border-radius: 10px;
}

/* Styles pour le select des options */
.select-options select {
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background-color: #f9fafb;
    cursor: pointer;
}
.select-options select:focus {
    border-color: var(--fiche-color, #007bff);
    box-shadow: 0 0 0 3px rgba(var(--fiche-color-rgb, 0, 123, 255), 0.15);
}

/* Barre de recherche interne aux groupes d'options */
.option-search-container {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-primary);
}
/* Barre de recherche plein écran */
.option-search-input {
    width: 100% !important;
    height: 45px;
    padding: 10px 15px !important;
    border-radius: 10px !important;
    border: 1px solid var(--border-primary) !important;
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    font-size: 16px !important; /* Évite le zoom auto sur iPhone */
}

.info-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #4A90E2;
    color: white !important;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    font-style: italic;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.2s;
}
.info-trigger:hover { transform: scale(1.2); }

.option-desc-block {
    display: none;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.05);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 5px;
    border-left: 3px solid #4A90E2;
    font-style: italic;
}
body.dark-mode .option-desc-block { background: rgba(255,255,255,0.05); }

/* Affichage en liste compacte pour les grands groupes multiples */
.qty-options-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
/* Rendu en liste propre (nettoyage des styles de cartes) */
.option-row-item {
    display: flex !important;
    flex-direction: row !important; /* Force l'alignement horizontal */
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 10px !important;
    margin: 0 !important;
    background: transparent !important; /* Supprime le fond de carte */
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    box-shadow: none !important; /* Supprime les ombres portées */
    border-left: none !important; /* Supprime la bordure bleue à gauche */
}
.option-row-info {
    flex: 1 !important;
    text-align: left !important;
}
/* Contrôles de quantité compacts et alignés */
.option-row-controls {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: rgba(255,255,255,0.05) !important;
    padding: 5px 8px !important;
    border-radius: 30px !important;
    margin-left: 10px !important;
    min-width: 100px !important;
    justify-content: center !important;
}
.btn-qty-adj {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    border-radius: 50% !important;
    font-weight: 900 !important;
    font-size: 1.2rem !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}
.btn-qty-adj:active { transform: scale(0.9); }
/* Classe pour forcer le masquage lors de la recherche */
.hidden-search {
    display: none !important;
}
.row-qty-display {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: var(--fiche-color) !important;
    min-width: 20px;
    text-align: center;
}