:root {
    --primary-color: #feb193; /* Carnita */
    --secondary-color: #c25b32; /* Café */
    --bg-dark: #0a0a0a;
    --overlay-dark: rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(194, 91, 50, 0.6);
    --glow-color: rgba(194, 91, 50, 0.8);
    --font-serif: "Playfair Display", serif;
    --font-sans: "Outfit", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(rgba(254, 177, 147, 0.82), rgba(254, 177, 147, 0.82)), 
                url('https://cdn.gamma.app/egjpqwwxfvherxn/8ab36a003915406fbeb4a3db16e8c979/original/Imagen-de-fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: white;
    font-family: var(--font-sans);
    overflow-x: hidden;
    height: 100vh;
    scroll-behavior: smooth;
}

/* Mobile-first layout */
.mobile-only {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.mobile-only::-webkit-scrollbar {
    display: none;
}

/* HERO SECTION */
#hero {
    position: relative;
    width: 100%;
    height: 85vh; /* Reduced height to minimize dead space */
    overflow: hidden;
    z-index: 10;
    transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image-container {
    width: 100%;
    height: 85vh; /* Matched height with #hero */
    position: fixed; 
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--primary-color);
}

.hero-image {
    width: 100%;
    height: 85vh; /* Matched height */
    background-image: url('https://imgproxy.gamma.app/resize/quality:80/resizing_type:fit/width:2000/https://cdn.gamma.app/egjpqwwxfvherxn/c94300ee9eb54f39955755a8e6081607/original/CC_Menu_22.04.2025-menu-canta-corazon-_page-0001.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--primary-color);
    transition: transform 0.1s linear;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 80px; /* Moved up significantly to be above the fold */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInOut 2s infinite ease-in-out;
}

.arrow {
    width: 18px;
    height: 18px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    margin: 6px auto; /* Reduced margin */
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
    50% { opacity: 1; transform: translate(-50%, 10px); }
}

/* MAIN MENU SECTION */
.main-menu {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
}

.main-menu.visible {
    opacity: 1;
    transform: scale(1);
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Fixed alignment to top */
    padding: 50px 0 20px; /* Controlled margin from the very top */
}

.brand {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 12vh; /* Large clear space to avoid center action */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-menu.visible .brand {
    opacity: 1;
    transform: translateY(0);
}

.logo {
    width: 380px;
    max-width: 90vw;
    height: auto;
}

.location-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    opacity: 0.65;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 10px; /* Tight space with the first button */
    width: 100%;
}

.menu-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Consistent spacing */
    width: 280px; /* Fixed symmetric width based on longest text */
    max-width: 90vw;
    margin: 0 auto;
}

.hand-guide {
    position: absolute;
    top: -20px;
    right: -25px;
    width: 55px;
    z-index: 999999 !important;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    will-change: transform, opacity;
}

.hand-guide.active {
    visibility: visible;
    animation: handFullSequence 6.5s forwards;
}

.hand-img {
    width: 100%;
    height: auto;
    opacity: 1 !important; /* No transparency for absolute visibility */
    display: block;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.8)); /* Add shadow for contrast */
}

.feedback-sparks {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    display: flex;
    justify-content: center;
    gap: 4px;
    opacity: 0;
}

.feedback-sparks span {
    width: 3px;
    height: 8px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 0 5px white;
}

.feedback-sparks span:nth-child(1) { transform: rotate(-30deg); }
.feedback-sparks span:nth-child(3) { transform: rotate(30deg); }

@keyframes handFullSequence {
    0% { opacity: 0; transform: translate(15px, 15px) scale(1); }
    12% { opacity: 1; transform: translate(0, 0) scale(1); }
    
    /* Tap + Pulse 1 */
    24% { transform: translateY(6px) scale(0.95); }
    28% { transform: translateY(0) scale(1.08); }
    32% { transform: translateY(0) scale(1); }
    
    /* Tap + Pulse 2 */
    48% { transform: translateY(6px) scale(0.95); }
    52% { transform: translateY(0) scale(1.08); }
    56% { transform: translateY(0) scale(1); }
    
    /* Tap + Pulse 3 */
    72% { transform: translateY(6px) scale(0.95); }
    76% { transform: translateY(0) scale(1.08); }
    80% { transform: translateY(0) scale(1); }
    
    90% { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(10px, 10px); }
}

/* Animate sparks with the tap moments */
.hand-guide.active .feedback-sparks {
    animation: sparksTrigger 6.5s forwards;
}

@keyframes sparksTrigger {
    0%, 26%, 32%, 50%, 56%, 74%, 80%, 100% { opacity: 0; transform: translateY(0) scale(0); }
    28%, 52%, 76% { opacity: 0.8; transform: translateY(-5px) scale(1.2); }
}

.menu-btn {
    position: relative;
    width: 100%; /* Force all buttons to same width */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 12px 20px;
    color: white;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    overflow: visible !important; /* CRITICAL: Allow hand to show outside */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    animation: iconFloat 3s infinite ease-in-out;
    filter: drop-shadow(0 0 5px var(--glow-color));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.05); }
}

.main-menu.visible .menu-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for buttons */
.main-menu.visible .menu-btn:nth-child(1) { transition-delay: 0.2s; }
.main-menu.visible .menu-btn:nth-child(2) { transition-delay: 0.3s; }
.main-menu.visible .menu-btn:nth-child(3) { transition-delay: 0.4s; }

.menu-btn:active, .menu-btn:hover {
    transform: scale(1.05);
    background: rgba(194, 91, 50, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: pulsateGlow 3s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulsateGlow {
    0%, 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(0.9); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* POPUP OVERLAY */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    width: 90%;
    max-width: 400px;
    background: #fdfaf8;
    border-radius: 24px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 800;
    letter-spacing: 1px;
}

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

/* COUNTDOWN CLOCK */
.countdown-container {
    width: 100%;
    margin-bottom: 25px;
    margin-top: 10px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-block span {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary-color);
    line-height: 1;
}

.time-block small {
    font-size: 0.6rem;
    font-weight: 800;
    color: #888;
    letter-spacing: 1px;
    margin-top: 5px;
    text-transform: uppercase;
}

/* IMAGE */
.popup-image {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.popup-image img {
    max-width: 75%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* FOOTER & BUTTON */
.popup-footer {
    width: 100%;
    margin-top: 10px;
}

.close-btn {
    width: 100%;
    max-width: 200px;
    background: #e74c3c; /* Red color requested */
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.close-btn:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* SCROLL HANDLING HELPERS */
.hidden {
    pointer-events: none;
}

.visible {
    pointer-events: auto;
}

.menu-link {
    text-decoration: none;
    display: block;
    width: 100%;
}

/* LANGUAGE SELECTOR */
.lang-selector {
    position: fixed;
    top: 15px; /* Reduced from 20px */
    right: 15px; /* Reduced from 20px */
    z-index: 9999999;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px; /* Reduced from 6px */
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.lang-btn {
    background: none;
    border: none;
    padding: 5px 10px; /* Reduced from 6px 12px */
    border-radius: 20px;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-sans);
}

.lang-btn.active {
    background: white;
    color: var(--secondary-color);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.lang-btn span {
    font-size: 0.9rem;
}

/* Responsive adjustment */
@media (max-width: 400px) {
    .lang-selector {
        top: 15px;
        right: 15px;
    }
    .lang-btn {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
}
