/* Bar Italia - Premium Design System */
:root {
    /* Colors */
    --color-gold: #D4AF37;
    --color-gold-hover: #F4CF57;
    --color-bg: #0a0a0a;
    --color-bg-secondary: #121212;
    --color-text: #E0E0E0;
    --color-text-muted: #A0A0A0;
    --color-accent: #800020;
    /* Deep Burgundy for highlights */

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Borders */
    --border-gold: 1px solid var(--color-gold);

    /* Transitions */
    --transition-fast: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-gold);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-gold {
    color: var(--color-gold);
}

.text-center {
    text-align: center;
}

/* Components */
.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-gold);
    color: var(--color-bg);
}

/* Header */
header {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.95);
    z-index: 1000;
}

/* Nav Container */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--color-gold);
    cursor: pointer;
    position: absolute;
    /* Position absolute to place it correctly on mobile */
    right: 20px;
    /* Place on right side */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

/* Nav Links (Desktop) */
.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    align-items: center;
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition-fast);
}

@media (min-width: 769px) {

    /* Hide Logo on Desktop explicitly */
    .logo-img {
        display: none !important;
    }

    /* Hide mobile close button on desktop */
    .nav-close-btn {
        display: none !important;
    }

    /* Language selector Positioning (Desktop) */
    .flags-item {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav {
        justify-content: space-between;
    }

    /* Dark overlay behind menu */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Slide-in panel */
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 75%;
        max-width: 320px;
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        height: auto;
        max-height: 100vh;
        background-color: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 30px 20px;
        border-left: 1px solid rgba(212, 175, 55, 0.15);
        border-radius: 0 0 0 16px;
        text-align: center;
        justify-content: flex-start;
        align-items: center;
        gap: 1.2rem;
        z-index: 1000;
        overflow-y: hidden;
        /* Slide animation */
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.show {
        transform: translateX(0);
    }

    .nav-close-btn {
        order: 999;
        margin-top: 1.5rem;
        margin-right: 0;
        align-self: center;
        cursor: pointer;
        font-size: 1.5rem;
        color: var(--color-gold);
        list-style: none;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 50%;
        transition: all 0.2s ease;
    }

    .nav-close-btn:hover {
        color: #fff;
        border-color: #fff;
    }

    .nav-links li {
        margin: 0.6rem 0;
    }

    /* Language selector as part of the menu */
    .flags-item {
        order: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0.5rem 0;
        border-top: 1px solid rgba(212, 175, 55, 0.1);
        padding-top: 1rem;
    }

    /* Mobile Logo — at the top, bigger */
    .logo-img {
        height: 150px;
        display: block !important;
        margin: 0 auto 0.5rem auto;
        order: -2;
    }
}

/* Hero */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
    animation: fadeInDown 1s ease-out;
}

/* Premium Hero Text Styles */
.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 0.5rem;
    /* Tighter spacing */
    font-weight: 300;
    /* Thin */
    animation: fadeInDown 1s ease-out 0.2s backwards;
}

/* Rules moved to min-width query above */

.hero-title {
    font-family: var(--font-body);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: var(--color-white);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background: none;
    -webkit-text-fill-color: initial;
    animation: fadeInDown 1s ease-out 0.4s backwards;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
        /* Smaller on mobile */
        padding: 0 1rem;
        /* Prevent edge touching */
    }
}

.hero-location {
    font-size: 1.2rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
    animation: fadeInDown 1s ease-out 0.6s backwards;
}

.btn-lg {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-width: 2px;
}

/* Hero Gluten-Free — Refined Typography */
.hero-gf-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
    animation: fadeInDown 1s ease-out 1s backwards;
}

.hero-gf-badge::before,
.hero-gf-badge::after {
    content: '';
    width: 30px;
    height: 1px;
    background: rgba(212, 175, 55, 0.4);
}

.hero-gf-svg {
    color: var(--color-gold);
    opacity: 0.6;
    flex-shrink: 0;
}

.hero-gf-badge span {
    font-size: 0.6rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.6);
    font-weight: 300;
    white-space: nowrap;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    color: var(--color-text-muted);
}

/* Menu Grid */
.menu-section {
    padding: var(--spacing-xl) 0;
}

.menu-category-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    position: relative;
    display: inline-block;
    width: 100%;
}

.menu-category-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--color-gold);
    margin: var(--spacing-sm) auto 0;
}

/* Added spacing between menu sections */
.menu-section-group {
    margin-top: 5rem;
    /* Approx ~80px (2cm+) spacing */
}

/* First section shouldn't have massive top margin */
.menu-section-group:first-child {
    margin-top: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.menu-item {
    background: var(--color-bg-secondary);
    padding: var(--spacing-lg);
    border: 1px solid #222;
    transition: var(--transition-fast);
    position: relative;
}

.menu-item:hover {
    border-color: var(--color-gold);
    transform: translateY(-5px);
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-sm);
    padding-right: 30px;
    /* Space for icon */
}

.menu-item-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-text);
}

.menu-item-price {
    font-weight: bold;
    color: var(--color-gold);
}

.menu-item-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Updated GF Icon Style */
.gf-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: auto;
    z-index: 10;
}

.gf-icon-sm {
    width: 16px;
    height: auto;
    margin-right: 6px;
    vertical-align: middle;
}

/* Logo Styles */
/* Re-declare logo-img base style if needed, but handled above */

.hero-logo {
    max-width: 700px;
    width: 90%;
    height: auto;
    margin-bottom: 0.5rem;
    /* Drastically reduced from var(--spacing-lg) */
    animation: fadeInDown 1s ease-out;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 0;
}

/* Footer */
footer {
    background: var(--color-bg-secondary);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    border-top: 1px solid #222;
    text-align: center;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Center items vertically */
    flex-wrap: wrap;
    /* responsive wrapping */
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-grid>div {
    flex: 1;
    /* Distribute space evenly if possible */
    min-width: 200px;
    /* Prevent crushing on small screens */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--spacing-md);
    font-size: 1.5rem;
}

.social-links a {
    color: var(--color-text);
    transition: var(--transition-fast);
}

.social-links a:hover {
    color: var(--color-gold);
    transform: translateY(-3px);
}

.hover-gold:hover {
    color: var(--color-gold);
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--color-bg-secondary);
    margin: 5% auto;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-gold);
    width: 90%;
    max-width: 600px;
    /* Max width for readability */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideIn 0.3s;
}

.modal-content h2 {
    margin-bottom: 2rem;
    /* Added spacing between title and text */
}

.close-modal {
    color: var(--color-text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-gold);
    text-decoration: none;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.modal-body .italic {
    font-style: italic;
    font-weight: 600;
    margin-top: 1.5rem;
    display: block;
    text-align: center;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 15% auto;
        width: 95%;
        padding: var(--spacing-md);
    }
}

/* Sticky Menu Filters */
.sticky-filters {
    position: sticky;
    top: 70px;
    /* Adjust for header height approx */
    z-index: 999;
    background-color: var(--color-bg);
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-bottom: 1px solid #333;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    transition: top 0.3s;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 0.5rem 1.5rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-gold);
    color: #000;
}

@media (max-width: 500px) {
    .sticky-filters {
        top: 60px;
        /* Adjusted for mobile header */
        padding: 0.5rem;
        gap: 0.5rem;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
}

/* Favorite Button on Cards */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 40px;
    /* Left of GF icon if present */
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
    z-index: 10;
}

.fav-btn:hover {
    transform: scale(1.2);
    color: #ff4757;
}

/* Floating Favorites Button */
.floating-fav-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-gold);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    z-index: 2000;
    transition: transform 0.3s;
    border: none;
}

.floating-fav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.fav-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    /* Hidden by default, JS toggles flex */
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 2px solid var(--color-bg);
}

/* Skeleton Loading */
@keyframes skeleton-loading {
    0% {
        background-color: #222;
    }

    50% {
        background-color: #333;
    }

    100% {
        background-color: #222;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite;
    pointer-events: none;
}

.skeleton-text {
    width: 100%;
    height: 1em;
    border-radius: 4px;
    margin-bottom: 0.5em;
}

.skeleton-title {
    width: 60%;
    height: 1.5em;
    margin-bottom: 1em;
}


/* Favorites Modal List */
.fav-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #333;
}

/* ======== Globe Language Selector ======== */
.language-selector {
    position: relative;
    z-index: 1001;
}

.lang-globe-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    cursor: pointer;
    color: var(--color-gold);
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.25s ease;
    white-space: nowrap;
    user-select: none;
}

.lang-globe-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.45);
}

.lang-globe-btn .globe-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.lang-globe-btn .globe-arrow {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.lang-globe-btn.open .globe-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 8px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 1002;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Two column grid */
.lang-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.lang-col {
    display: flex;
    flex-direction: column;
}

/* Subtle vertical divider */
.lang-col:first-child {
    border-right: 1px solid rgba(212, 175, 55, 0.1);
    padding-right: 4px;
}

.lang-col:last-child {
    padding-left: 4px;
}

/* Language option buttons */
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #aaa;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-body);
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lang-option:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-gold);
}

.lang-option.active {
    color: var(--color-gold);
    font-weight: 600;
    background: rgba(212, 175, 55, 0.06);
}

.lang-option .lang-check {
    opacity: 0;
    font-size: 0.75rem;
    margin-left: auto;
}

.lang-option.active .lang-check {
    opacity: 1;
}

/* Close dropdown on outside click */
.lang-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.lang-overlay.open {
    display: block;
}

/* RTL support */
html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-option {
    text-align: right;
}

html[dir="rtl"] .lang-option .lang-check {
    margin-left: 0;
    margin-right: auto;
}

/* Mobile: Language selector in mobile menu */
@media (max-width: 768px) {
    .flags-item {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .lang-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
        padding: 16px;
        transform: translateY(100%);
    }

    .lang-dropdown.open {
        transform: translateY(0);
    }

    .lang-option {
        padding: 12px 16px;
        font-size: 1rem;
    }
}