:root {
    --bg-dark: #1e1e1e;
    --bg-card: #2a2a2a9b;
    --primary: #186ee7;   /* Blue */
    --success: #28a745;   /* Green */
    --warning: #ffc107;   /* Yellow */
    --gallery: #e7186e;   /* Pink */
    --text-main: #ffffff;
    --font-main: "Cause", cursive; /* Fallback defined in specific elements */
}

/* --- Global Reset --- */
* {
    font-family: var(--font-main);
    font-optical-sizing: auto;
    font-style: normal;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: Arial, sans-serif; /* Body override */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: url('./media/fondovr.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
    overflow-x: hidden;
    font-size: 18px;
}

/* --- Layout Components --- */
.main-container {
    width: 100%;
    max-width: 1100px;
    padding: 10px;
    text-align: center;
    margin: auto;
}

.slots-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.slots-row > div {
    flex: 0 1 300px;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.slot-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot-card img {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.slot-title { font-size: 1.3rem; margin-bottom: 12px; }
h1 { font-size: 3.5rem; margin-bottom: 15px; }
#timer { font-size: 1.8rem; margin-bottom: 15px; }

/* --- Inputs & Buttons --- */
input {
    padding: 12px;
    font-size: 18px;
    border-radius: 10px;
    width: 100%;
    max-width: 350px;
    margin-bottom: 20px;
}

.btn-slot {
    background-color: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    width: 100%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-slot:hover:not(:disabled) { transform: scale(1.02); }
.btn-slot:disabled { background-color: #555; }

/* --- Links/Triggers --- */
.tos-container, .price-container, .gallery-btn-container, .info-container {
    position: relative;
    display: inline-block;
    margin: 10px;
    cursor: pointer;
    text-decoration: underline;
    font-size: 1.1rem;
}

.tos-container { color: var(--primary); }
.info-container { color: var(--warning); }
.price-container { color: var(--success); }

/* --- Shared Popup Styles (TOS, Price, Info) --- */
/* Note: We map colors using local vars to avoid repeating code */
.tos-popup   { --accent: var(--primary); }
.price-popup { --accent: var(--success); }
.info-popup  { --accent: var(--warning); }

.tos-popup, .price-popup, .info-popup {
    visibility: hidden;
    width: 400px;
    max-width: 95vw;
    max-height: 65vh;
    background-color: #1e1e1ecc;
    backdrop-filter: blur(10px);
    color: #fff;
    text-align: left;
    border-radius: 16px;
    padding: 18px 16px;
    position: absolute;
    z-index: 100;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    pointer-events: none;
    overflow-y: auto;
}

.tos-popup.show, .price-popup.show, .info-popup.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tos-popup h3, .price-popup h3, .info-popup h3 {
    margin-top: 0;
    color: var(--accent);
    font-size: 1.5rem;
    text-align: center;
}

.tos-popup h4, .price-popup h4, .info-popup h4 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 1.2rem;
    border-bottom: 1px solid #444;
}

.tos-popup p, .tos-popup li, .price-popup p, .price-popup li, .info-popup p, .info-popup li {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}
.tos-popup ul, .price-popup ul, .info-popup ul { padding-left: 25px; margin: 12px 0; }

.tos-grid { display: flex; justify-content: space-between; gap: 25px; margin-top: 20px; padding-top: 15px; }
.tos-grid-col { flex: 1; }
.tos-grid strong { display: block; margin-bottom: 8px; color: var(--primary); }

/* --- Carousel & Gallery --- */
.carousel-title { margin-top: 60px; font-size: 2rem; color: var(--primary); }

.carousel-container {
    display: flex;
    overflow: hidden; /* Changed for the animation */
    gap: 20px;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    position: relative;
    margin-top: 20px;
}

/* Animation Track */
.carousel-track {
    display: flex;
    gap: 20px;
    animation: scroll-infinite 30s linear infinite;
    width: max-content;
}

@keyframes scroll-infinite {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 10px)); }
}

.carousel-item {
    flex: 0 0 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
}
.carousel-item:hover { transform: translateY(-10px); }
.carousel-item img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; }

/* Gallery Modal specific */
.btn-gallery {
    background-color: transparent;
    border: none;
    color: var(--gallery);
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: underline;
    transition: transform 0.2s;
}
.btn-gallery:hover { transform: scale(1.05); }

.gallery-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.gallery-overlay.show { display: flex; }

.gallery-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

/* --- Info Overlay Modal (The complex one) --- */
.info-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.info-modal-overlay.active { display: flex; }

.info-modal-card {
    background-color: #1e1e1ecc;
    backdrop-filter: blur(10px);
    color: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    padding: 30px;
    border-radius: 16px;
    position: relative;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.info-modal-overlay.active .info-modal-card { transform: scale(1); opacity: 1; }

.info-modal-card h3 {
    margin-top: 0;
    color: var(--warning);
    font-size: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--warning);
    padding-bottom: 10px;
    text-transform: uppercase;
    font-family: var(--font-main);
}

.info-modal-card h4 {
    margin-top: 25px;
    margin-bottom: 8px;
    color: var(--warning);
    font-size: 1.2rem;
    border-left: 4px solid var(--warning);
    padding-left: 10px;
    font-family: var(--font-main);
}

.info-modal-card strong { color: var(--warning); }
.info-modal-card ul { padding-left: 25px; margin: 12px 0; list-style: none; }
.info-modal-card ul li::before { content: "•"; color: var(--warning); display: inline-block; width: 1em; margin-left: -1em; }
.info-modal-card p, .info-modal-card li { font-size: 18px; line-height: 1.5; margin-bottom: 10px; }

.info-modal-close {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 32px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
.info-modal-close:hover { color: var(--warning); }


/* --- Consolidated Media Queries --- */
@media (max-width: 900px) {
    .carousel-item { flex: 0 0 calc(50% - 10px); }
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 5px;
    }
    h1 { font-size: 2.5rem; }
    .slot-card { padding: 15px; }
    .slot-card img { max-width: 100px; }
    .slot-title { font-size: 1.1rem; }
    .btn-slot { padding: 10px 15px; font-size: 1rem; }
    
    .tos-container, .price-container, .gallery-btn-container { margin: 10px 5px; font-size: 1rem; }
    
    .carousel-item { flex: 0 0 80%; }
    .gallery-close { top: 10px; right: 20px; }
    
    /* Popup overrides for Mobile */
    .tos-popup, .price-popup, .info-popup {
        width: 90vw;
        position: fixed;
        bottom: 20px;
        left: 5vw;
        transform: none;
        max-height: 80vh;
    }
}