/* --- Variables & Reset --- */
:root {
    /* Paleta Oficial Obligatoria */
    --color-green: #199945;
    --color-blue: #199DDA;
    --color-yellow: #FBB81C;
    --color-orange: #F07E10;
    
    /* Neutros */
    --color-text: #222;
    --color-bg: #fff;
    --color-light: #f9f9f9;
    
    /* Espaciado */
    --container-width: 1200px;
    --header-height: 100px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* --- Header --- */
.site-header {
    background: url('img/encabezado.png') center/cover no-repeat;
    height: var(--header-height);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left img {
    height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-nav a {
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.header-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.btn-nav-cta,
.hero-content .btn-primary,
.contacto-form .btn-success {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s, color 0.3s;
    border: none;
    cursor: pointer;
    background: var(--color-orange) !important;
    color: #fff !important;
}

.btn-nav-cta:hover,
.hero-content .btn-primary:hover,
.contacto-form .btn-success:hover {
    background: var(--color-yellow) !important;
    color: var(--color-text) !important;
}

/* --- Popup Modal --- */
.popup-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10000;
}

.popup-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 8px solid #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 56px 20px 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    overflow: hidden;
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FBB81C;
    color: white;
    border: none;
    padding: 10px 16px;
    width: auto;
    height: auto;
    border-radius: 0;
    box-sizing: border-box;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
    z-index: 10001;
    font-size: 16px;
    text-transform: uppercase;
}

.popup-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    max-height: calc(90vh - 96px);
    width: auto;
    height: auto;
    object-fit: contain;
}

/* --- Hero Slider --- */
.hero-slider {
    position: relative;
    padding: 0;
    margin: 0;
}

.carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 600px;
    overflow: hidden;
    background: #000;
}

.carousel .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 500ms ease-in-out;
    z-index: 0;
}

.carousel .slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    z-index: 2;
    pointer-events: none; /* Click through to slider buttons */
}

.hero-content {
    color: #fff;
    text-align: center;
    pointer-events: auto;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0 0 16px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.75);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin: 0 0 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 3px 8px rgba(0,0,0,0.7);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(255, 255, 255, 0.9);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: var(--color-green);
    z-index: 3;
    pointer-events: auto;
    transition: transform 0.2s;
}

.nav-btn:hover { transform: translateY(-50%) scale(1.1); }
.nav-btn.prev { left: 20px; }
.nav-btn.next { right: 20px; }

/* --- Sections General --- */
section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin: 0 0 16px;
    color: var(--color-green);
    font-weight: 800;
}

.text-green { color: var(--color-green); }
.text-white { color: #fff; }
.text-white-op { color: rgba(255,255,255,0.9); text-align: center; margin-top: -10px; }

.section-subtitle {
    text-align: center;
    color: #000000;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* --- Welcome --- */
.section-welcome,
.salones {
    background: url('img/fondo_salones.png') center/cover no-repeat;
}

.section-welcome {
    padding: 60px 0;
    background-color: #fff;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.welcome-text p {
    font-size: 1.1rem;
    color: #444;
}

.welcome-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Salones --- */
.salones {
    position: relative;
    overflow: hidden;
}

.salones-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    position: relative;
}

.salon-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    cursor: pointer;
    position: relative;
}

.salon-card:hover {
    transform: translateY(-5px);
}

.salon-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.salon-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, opacity 500ms ease-in-out;
}

.salon-main-image.is-fading {
    opacity: 0;
}

.salon-card:hover .salon-main-image {
    transform: scale(1.05);
}

.salon-image-container .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.3s;
}

.salon-card:hover .salon-image-container .image-overlay {
    background: rgba(0,0,0,0.12);
}

.card-caption {
    padding: 12px;
    text-align: center;
    font-weight: 700;
    color: var(--color-blue);
    background: #f0f8ff;
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

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

.gallery-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    margin: 5vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: #fff;
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    font-size: 18px;
}

.gallery-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.gallery-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10%;
    cursor: pointer;
}

.gallery-images.layout-amplias {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-images.layout-amplias img {
    height: 100%;
    min-height: 0;
}

.gallery-images.layout-juegos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: center;
    overflow: hidden;
}

.gallery-images.layout-juegos img {
    height: 100%;
    min-height: 0;
}

.gallery-images.layout-juegos img:nth-child(3) {
    grid-column: 1 / span 2;
    justify-self: center;
    width: min(50%, 520px);
}

.gallery-images.layout-arte,
.gallery-images.layout-auditorio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 16px;
    align-content: center;
    overflow: hidden;
}

.gallery-images.layout-arte img,
.gallery-images.layout-auditorio img {
    height: 100%;
    min-height: 0;
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

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

.image-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    margin: 5vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: #fff;
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    font-size: 18px;
}

#modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10%;
}

/* --- Redes --- */
.redes {
    padding: 60px 0;
    background: var(--color-blue); /* Usando azul institucional */
    background: linear-gradient(135deg, var(--color-blue), #1585b8);
}

.redes-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.redes-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.redes-escudo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.redes-escudo img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1); /* Logo blanco */
}

.redes-title {
    color: #fff;
    margin: 0 0 16px;
    font-size: 1.5rem;
    text-align: center;
}

/* Social Embeds Styles */
.fb-embed, .ig-embed {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px;
}
.fb-header, .ig-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.fb-avatar, .ig-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
}
.fb-avatar img,
.ig-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fb-name, .ig-name {
    font-weight: 700;
    font-size: 1rem;
}
.fb-open, .ig-open {
    margin-left: auto;
    background: var(--color-yellow);
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}
.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.ig-item {
    aspect-ratio: 1;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}
.ig-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Contacto --- */
.contacto {
    padding: 60px 0;
    position: relative;
    background: url('img/fondo_salones.png') center/cover no-repeat;
    background-color: #f4f4f4;
    overflow: hidden;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "map info form"
        "map street form";
    gap: 24px;
}

.contacto-map-box {
    grid-area: map;
}

.contacto-info-box {
    grid-area: info;
}

.street-view-box {
    grid-area: street;
}

.contacto-form {
    grid-area: form;
}

.contacto-info-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-top: 4px solid var(--color-green);
}

.contacto-title {
    color: var(--color-green);
    margin: 0 0 20px;
    font-size: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(25, 153, 70, 0.3);
    transition: background 0.2s;
}

.info-item:hover {
    background: var(--color-green);
}

.info-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.link-whatsapp {
    color: var(--color-green);
    font-weight: 700;
    text-decoration: none;
}

.info-item:hover .link-whatsapp {
    color: #fff;
}

.street-view-box iframe {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    border: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.contacto-map {
    height: 100%;
}

.contacto-map iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: 12px;
    border: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.contacto-form form {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-top: 4px solid var(--color-orange);
}

.form-step {
    display: grid;
    gap: 16px;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-text);
}

.form-step input, .form-step textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-step input:focus, .form-step textarea:focus {
    outline: none;
    border-color: var(--color-blue);
}

.input-error {
    border-color: #FF0000 !important;
    background: #fff0f0;
}

.error-tip {
    color: #FF0000;
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.cf-status {
    margin-top: 16px;
    font-weight: 700;
    text-align: center;
}
.cf-status.ok { color: var(--color-green); }
.cf-status.err { color: #FF0000; }

/* --- Footer --- */
.site-footer {
    margin: 0;
    padding: 0;
}

.footer-franja {
    position: relative;
    width: 100%;
    min-height: 80px;
    background: url('img/franja.png') center/cover no-repeat;
    background-color: var(--color-green); /* Fallback */
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-copy {
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    padding: 20px;
}

/* --- Responsive --- */
@media (max-width: 960px) {
    .header-nav {
        display: none; /* En móvil se debería implementar menú hamburguesa */
    }
    .welcome-grid {
        grid-template-columns: 1fr;
    }
    .contacto-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "map"
            "info"
            "street"
            "form";
    }
}

@media (max-width: 640px) {
    .header-inner {
        justify-content: center;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
