/* ===== CSS Variables ===== */
:root {
    --primary: #C41E3A;
    --primary-dark: #8B0000;
    --primary-light: #E8475F;
    --white: #FFFFFF;
    --off-white: #FFF5F5;
    --bg-cream: #FEF9F9;
    --text-dark: #2D2D2D;
    --text-muted: #666666;
    --shadow-sm: 0 2px 8px rgba(196, 30, 58, 0.1);
    --shadow-md: 0 4px 20px rgba(196, 30, 58, 0.15);
    --shadow-lg: 0 8px 32px rgba(196, 30, 58, 0.2);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ===== Splash Screen ===== */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    margin-top: 24px;
    animation: spin 1s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 24px 16px 32px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.header-text {
    color: var(--white);
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slogan {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 2px;
}

.location {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

/* ===== Category Navigation ===== */
.category-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
}

.category-scroll {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border: none;
    background: var(--off-white);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-width: fit-content;
}

.category-btn:active {
    transform: scale(0.95);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.4);
}

.category-icon {
    font-size: 1.2rem;
}

/* ===== Menu Container ===== */
.menu-container {
    padding: 20px 16px 32px;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Menu Section ===== */
.menu-section {
    margin-bottom: 32px;
    scroll-margin-top: 80px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Menu Grid ===== */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ===== Menu Card ===== */
.menu-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.menu-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.card-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--off-white);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.menu-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.price {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.portion-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--off-white);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== Drinks Grid (Smaller Cards) ===== */
.drinks-grid {
    grid-template-columns: repeat(2, 1fr);
}

.drink-card {
    flex-direction: column;
    padding: 12px;
    text-align: center;
}

.drink-card .card-image {
    width: 100%;
    height: 100px;
}

.drink-card .card-content {
    align-items: center;
    padding-top: 8px;
}

.drink-card .card-content h3 {
    font-size: 0.85rem;
}

.drink-card .price {
    font-size: 0.8rem;
    padding: 5px 12px;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 32px 16px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--white), var(--primary-light));
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.footer-text {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
}

.footer-slogan {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-top: 4px;
}

.footer-divider {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 16px auto;
    border-radius: 1px;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

/* ===== Contact Section ===== */
.contact-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-link:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.25);
}

.contact-link.instagram {
    background: linear-gradient(135deg, #833AB4, #FD1D1D, #F77737);
    font-size: 0.85rem;
}

.contact-icon {
    font-size: 1.1rem;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-card {
    animation: fadeInUp 0.5s ease forwards;
}

.menu-section:nth-child(1) .menu-card {
    animation-delay: 0.1s;
}

.menu-section:nth-child(2) .menu-card {
    animation-delay: 0.15s;
}

.menu-section:nth-child(3) .menu-card {
    animation-delay: 0.2s;
}

.menu-section:nth-child(4) .menu-card {
    animation-delay: 0.25s;
}

/* ===== Responsive Adjustments ===== */
@media (min-width: 400px) {
    .menu-grid:not(.drinks-grid) {
        grid-template-columns: 1fr;
    }

    .card-image {
        width: 100px;
        height: 100px;
    }

    .card-content h3 {
        font-size: 1rem;
    }
}

@media (min-width: 500px) {
    .drinks-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-text h1 {
        font-size: 1.75rem;
    }
}

/* ===== Safe Area for notched phones ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(24px + env(safe-area-inset-top));
    }

    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* ===== Touch Feedback ===== */
.menu-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: var(--border-radius);
    pointer-events: none;
}

.menu-card:active::after {
    opacity: 0.05;
}

/* ===== Image Loading Placeholder ===== */
.card-image {
    position: relative;
    background: linear-gradient(135deg, var(--off-white) 0%, #f0f0f0 100%);
}

.card-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-image img.loaded {
    opacity: 1;
}

/* ===== Lightbox Modal ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover,
.lightbox-close:active {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

#lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

#lightbox-caption {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.4);
}

/* Safe area for lightbox close button */
@supports (padding-top: env(safe-area-inset-top)) {
    .lightbox-close {
        top: calc(20px + env(safe-area-inset-top));
        right: calc(20px + env(safe-area-inset-right));
    }
}

/* Cursor pointer for clickable images */
.card-image {
    cursor: pointer;
}