/**
 * Theme: Freemium
 * Description: Navbar et bottom navigation pour le thème freemium
 * Colors: Utilise les variables CSS du menu (--brand-color)
 */

/* ============================================
   HEADER - Freemium
   ============================================ */
.menu-header {
    background: linear-gradient(155deg, 
        color-mix(in oklab, var(--brand-color, #121828) 100%, #000 0%) 0%, 
        color-mix(in oklab, var(--brand-color, #121828) 85%, #000 15%) 100%);
    color: white;
    padding: 2.75rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-header .logo-badge {
    display: inline-block;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 50%;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.menu-header .restaurant-logo {
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
}

.menu-header .menu-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BOTTOM NAVIGATION - Freemium
   ============================================ */
.bottom-nav {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    border-top: 2px solid #495057;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
}

.bottom-nav .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.bottom-nav .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.bottom-nav .nav-link {
    color: #f8f9fa !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.bottom-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    transform: translateY(-2px);
}

.bottom-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Swipe indicator */
.swipe-indicator {
    color: #f8f9fa;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    animation: swipe-hint 2s ease-in-out infinite;
}

@keyframes swipe-hint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

/* Dropdown */
.bottom-nav .dropdown-menu {
    background: #343a40;
    border: 1px solid #495057;
    border-radius: 8px;
}

.bottom-nav .dropdown-item {
    color: #f8f9fa !important;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

.bottom-nav .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

/* Badge */
.badge-freemium {
    background: #dc3545;
    color: #fff;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .menu-header {
        padding: 1.5rem 0;
    }
    
    .menu-header .menu-title {
        font-size: 1.5rem;
    }
    
    .menu-header .restaurant-logo {
        max-width: 120px;
    }
    
    .bottom-nav .nav-link {
        padding: 0.5rem 0.75rem;
        margin: 0.25rem 0;
    }
    
    /* Collapse vers le haut */
    .bottom-nav .navbar-collapse {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #343a40 0%, #212529 100%);
        border-top: 2px solid #495057;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
        padding: 0.5rem 0;
    }
}

/* Désactiver animations si préférence mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .swipe-indicator {
        animation: none !important;
    }
}

/* ============================================
   BODY & CONTAINER
   ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-family: var(--font-family);
    background-color: #f8f9fa;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   LOGO ROND
   ============================================ */
.logo-badge {
    width: 120px;
    height: 120px;
    border-radius: 9999px;
    background: #fff;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.12), inset 0 0 0 1px rgba(0,0,0,.06);
}

.restaurant-logo {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
}

/* ============================================
   SECTIONS & PLATS
   ============================================ */
.section-area + .section-area {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

/* Ornement entre deux sections */
.section-area + .section-area::before {
    content: "~";
    display: block;
    text-align: center;
    font-size: 3rem;
    color: var(--accent, #c9a96e);
    margin-bottom: 1rem;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-section-title {
    color: var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.dish-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dotted #eee;
}

.dish-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.dish-description {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.dish-price {
    color: var(--brand-color);
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
}

/* Intro/outro de section */
.section-intro, .section-outro {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.section-outro {
    margin-top: 1rem;
}

/* Options de plat */
.dish-options {
    margin-top: 0.25rem;
}

.dish-option {
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}

/* Override couleur bordure option avec brand-color */
.dish-option .option-label {
    border-left-color: var(--brand-color);
}

/* Override couleur prix option */
.option-price {
    color: var(--brand-color);
}

/* ============================================
   TABS
   ============================================ */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ============================================
   LAYOUTS
   ============================================ */
/* Layout minimal */
.layout-minimal .menu-section-title {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
}

/* Layout élégant */
.layout-elegant .menu-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

.layout-elegant .dish-name {
    font-family: 'Playfair Display', serif;
}

/* Layout moderne */
.layout-modern .menu-section {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.layout-modern .menu-section-title {
    border-bottom: none;
    position: relative;
    padding-left: 1rem;
}

.layout-modern .menu-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-color);
}

/* ============================================
   WISHLIST
   ============================================ */
.wishlist-button {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    line-height: 1;
}

.wishlist-button:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.wishlist-button.active {
    color: #ff6b6b;
}

.wishlist-button.active i {
    animation: heartBeat 1.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* Badge wishlist */
.wishlist-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mise en évidence du bouton wishlist dans la navbar */
.nav-link.highlight {
    animation: highlightPulse 1s infinite;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* Onglet wishlist */
#wishlist-items {
    min-height: 200px;
}

#wishlist-empty {
    padding: 3rem 0;
}

/* Encadré explicatif wishlist */
.hero-compare {
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 107, 107, 0.2);
    text-align: center;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-emphasis {
    color: #ff6b6b;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: #555;
}

.hero-tagline {
    font-size: 1rem;
    font-style: italic;
    color: #777;
}

/* ============================================
   NAVBAR & MENU MOBILE
   ============================================ */
.navbar-toggler {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    position: relative;
    z-index: 1050;
    margin-right: 0.5rem;
}

.navbar-toggler i {
    font-size: 1.25rem;
}

/* Menu mobile */
@media (max-width: 767.98px) {
    .navbar-collapse {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        background-color: var(--brand-color);
        padding: 1rem;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav {
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .navbar-toggler {
        z-index: 2;
    }
}

/* ============================================
   FIX LAYOUT
   ============================================ */
/* FIX: Les conteneurs de tabs doivent être en block, pas en flex (hérité de critical.css) 
   On retire !important sur display pour laisser le JS gérer le masquage (style="display: none")
*/
.tab_area.menu-tabs {
    display: block;
    width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    gap: 0 !important;
}
