:root {
    /* Institucional */
    --cs-navy: #003563;
    --cs-navy-dark: #153662;
    --cs-blue: #659ABC;
    --cs-gray: #D8D8D9;

    /* Country Club */
    --country-green: #4F772C;
    --country-lime: #AEBD38;
    --country-gold: #F3C010;

    /* El Sunzal */
    --sunzal-yellow: #F7E300;
    --sunzal-orange: #FAAF08;
    --sunzal-sand: #D6C194;

    /* Corinto */
    --corinto-teal: #1E656D;
    --corinto-cream: #F1F3CE;
    --corinto-terracotta: #752A07;

    /* Tipografía */
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Playfair Display', serif;

    --nav-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: #222;
    background-color: #fafafa;
}

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

/* =========================
   NAVBAR
========================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2.5rem;
    background: rgba(0, 53, 99, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 52px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease;
}

.brand:hover .brand-logo {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    transition: opacity 0.2s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--sunzal-yellow);
    transition: width 0.25s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-social a {
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-social a:hover {
    background: var(--sunzal-yellow);
    color: var(--cs-navy);
    border-color: var(--sunzal-yellow);
    transform: translateY(-2px);
}

/* =========================
   HERO CAROUSEL (full screen)
========================= */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    margin-top: 0;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hero-slide {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nav-height) 2rem 2rem;
    color: #fff;
    position: relative;
}

.hero-slide-content {
    max-width: 850px;
    text-align: center;
    animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-slide h1 {
    font-family: var(--font-secondary);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.hero-slide p {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 300;
    max-width: 680px;
    margin: 0 auto 2.25rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Botones del hero - blancos en todos los slides */
.hero-slide .btn-primary {
    background: #fff;
    color: var(--cs-navy);
}
.hero-slide .btn-primary:hover {
    background: #fff;
    color: var(--cs-navy);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

/* Controles del carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(8px);
}

.carousel-btn:hover {
    background: var(--sunzal-yellow);
    color: var(--cs-navy);
    border-color: var(--sunzal-yellow);
    transform: translateY(-50%) scale(1.08);
}

.carousel-btn-prev { left: 1.5rem; }
.carousel-btn-next { right: 1.5rem; }

.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.7rem;
    z-index: 5;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
    padding: 0;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.dot.is-active {
    background: var(--sunzal-yellow);
    width: 32px;
    border-radius: 6px;
}

/* =========================
   BOTONES
========================= */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    display: inline-block;
    cursor: pointer;
    border: 0;
}

.btn-primary {
    background: var(--sunzal-yellow);
    color: var(--cs-navy);
}

.btn-primary:hover {
    background: var(--sunzal-orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(250, 175, 8, 0.35);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: #fff;
    color: var(--cs-navy);
    transform: translateY(-2px);
}

/* =========================
   SECTION HEADER
========================= */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--cs-blue);
    margin-bottom: 0.75rem;
}

.eyebrow-light {
    color: var(--sunzal-yellow);
}

.section-header h2 {
    font-family: var(--font-secondary);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: var(--cs-navy);
    margin-bottom: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
}

.section-header p {
    color: #666;
    font-size: 1.05rem;
}

/* =========================
   DEPENDENCIAS (grid)
========================= */
.dependencias-section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dependencias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.dep-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 53, 99, 0.12);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.dep-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 53, 99, 0.2);
}

.dep-card-image {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

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

.dep-card-body {
    padding: 1.5rem 1.5rem 1.75rem;
}

.dep-card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.3rem 0.7rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

.dep-card[data-theme="country"] .dep-card-tag {
    background: var(--country-lime);
    color: var(--cs-navy);
}

.dep-card[data-theme="sunzal"] .dep-card-tag {
    background: var(--sunzal-yellow);
    color: var(--cs-navy);
}

.dep-card[data-theme="corinto"] .dep-card-tag {
    background: var(--corinto-teal);
    color: #fff;
}

.dep-card h3 {
    font-family: var(--font-secondary);
    font-size: 1.6rem;
    color: var(--cs-navy);
    margin-bottom: 0.4rem;
    font-weight: 400;
}

.dep-card p {
    color: #666;
    font-size: 0.95rem;
}

/* =========================
   LIVE
========================= */
.live-section {
    padding: 5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 53, 99, 0.2);
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-fallback {
    text-align: center;
    margin-top: 1.25rem;
    color: #666;
    font-size: 0.95rem;
}

.video-fallback a {
    color: var(--cs-navy);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--sunzal-yellow);
    transition: opacity 0.2s ease;
}

.video-fallback a:hover {
    opacity: 0.75;
}

.video-card {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 53, 99, 0.2);
    background: #000;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 50px rgba(0, 53, 99, 0.3);
}

.video-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 53, 99, 0.15), rgba(0, 53, 99, 0.55));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

.live-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #f00;
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.play-button {
    transition: transform 0.25s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.video-card:hover .play-button {
    transform: scale(1.1);
}

.watch-label {
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

/* Mareas */
.tides-block {
    margin-top: 4rem;
    scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.tides-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.tides-header h3 {
    font-family: var(--font-secondary);
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    color: var(--cs-navy);
    font-weight: 400;
    margin-bottom: 0.4rem;
}

.tides-header p {
    color: #666;
    font-size: 1rem;
}

.tide-card {
    max-width: 620px;
    margin: 0 auto;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 53, 99, 0.18);
    background: #fff;
    border: 1px solid #eef1f5;
    padding: 1.5rem 1.5rem 1.2rem;
}

.tide-widget {
    font-family: var(--font-primary);
    color: #333;
}

.tide-loading,
.tide-error {
    text-align: center;
    color: #8a97a5;
    padding: 2.5rem 0;
    margin: 0;
}

/* Estado actual */
.tide-now {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tide-now-level {
    font-family: var(--font-secondary);
    font-size: 1.85rem;
    color: var(--cs-navy);
    line-height: 1;
}

.tide-now-state {
    font-size: 0.92rem;
    font-weight: 500;
}

.tide-now-state.up { color: var(--cs-blue); }
.tide-now-state.down { color: var(--sunzal-orange); }

/* Curva */
.tide-svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 0.6rem 0 1rem;
    overflow: visible;
}

.tide-curve {
    fill: none;
    stroke: var(--cs-navy);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tide-ext { fill: var(--cs-navy); }

.tide-ext-lbl {
    fill: #6b7886;
    font-size: 12px;
    text-anchor: middle;
    font-family: var(--font-primary);
}

.tide-nowline {
    stroke: var(--sunzal-orange);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: 0.6;
}

.tide-nowdot {
    fill: var(--sunzal-orange);
    stroke: #fff;
    stroke-width: 2;
}

/* Próximas mareas */
.tide-next {
    margin: 0.25rem 0 0.4rem;
}

.tide-next-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0;
    border-top: 1px solid #f0f2f5;
    font-size: 0.95rem;
}

.tide-next-ico { font-size: 0.85rem; }
.tide-next-ico.up { color: var(--cs-blue); }
.tide-next-ico.down { color: var(--sunzal-orange); }

.tide-next-name { flex: 1; color: #555; }
.tide-next-time { font-weight: 600; color: var(--cs-navy); }
.tide-next-delta { color: #97a2ad; font-size: 0.85rem; min-width: 86px; text-align: right; }
.tide-next-h { font-weight: 600; color: var(--cs-navy); min-width: 64px; text-align: right; }

/* Hoy */
.tide-today {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    border-top: 1px solid #f0f2f5;
    padding-top: 0.85rem;
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.tide-today-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cs-blue);
}

.tide-today-item { color: #556; }
.tide-today-item b { color: var(--cs-navy); font-weight: 600; }
.tide-today-ico { font-size: 0.7rem; margin-right: 0.15rem; }
.tide-today-ico.up { color: var(--cs-blue); }
.tide-today-ico.down { color: var(--sunzal-orange); }

/* Crédito */
.tide-credit {
    text-align: center;
    margin: 0.95rem 0 0;
    color: #9aa6b1;
    font-size: 0.74rem;
}

.tide-credit a {
    color: var(--cs-navy);
    text-decoration: none;
    border-bottom: 1px solid var(--sunzal-yellow);
}

/* =========================
   CONTACT
========================= */
.contact-section {
    background: linear-gradient(135deg, var(--cs-navy), var(--cs-navy-dark));
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
}

.contact-inner {
    max-width: 700px;
    margin: 0 auto;
}

.contact-section h2 {
    font-family: var(--font-secondary);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: #fff;
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.contact-section p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.contact-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.contact-social a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.contact-social a:hover {
    color: var(--sunzal-yellow);
}

/* =========================
   FOOTER
========================= */
footer {
    background: #0a1f3a;
    color: rgba(255, 255, 255, 0.6);
    padding: 2.5rem 2rem;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: rgba(255, 255, 255, 0.65);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
    background: var(--sunzal-yellow);
    color: var(--cs-navy);
    transform: translateY(-3px);
}

.footer-inner p {
    font-size: 0.9rem;
    margin: 0;
}

/* =========================
   MEMBER MODAL
========================= */
.member-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.member-modal[hidden] { display: none; }

.member-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 53, 99, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.member-modal-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.member-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: 0;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.member-modal-close:hover {
    background: #f3f3f3;
    color: var(--cs-navy);
}

.member-modal-logo {
    height: 70px;
    width: auto;
    margin: 0 auto 1rem;
}

.member-modal-content h3 {
    font-family: var(--font-secondary);
    color: var(--cs-navy);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.member-modal-content > p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.member-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.member-form input {
    padding: 0.85rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    text-align: center;
    letter-spacing: 3px;
    color: var(--cs-navy);
    transition: border-color 0.2s ease;
    width: 100%;
}

.member-form input:focus {
    outline: none;
    border-color: var(--cs-navy);
}

.member-form input.is-invalid {
    border-color: #e53935;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.member-error {
    color: #e53935;
    font-size: 0.85rem;
    margin: 0;
}

.member-form .btn {
    margin-top: 0.5rem;
    width: 100%;
    background: var(--cs-navy);
    color: #fff;
}

.member-form .btn:hover {
    background: var(--cs-navy-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 53, 99, 0.35);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .navbar {
        padding: 0.75rem 1.25rem;
        gap: 0.75rem;
    }

    .nav-links {
        gap: 1.25rem;
        font-size: 0.85rem;
    }

    .brand-logo {
        height: 44px;
    }

    .nav-social a {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 700px) {
    :root {
        --nav-height: 130px;
    }

    .navbar {
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        padding: 0.75rem 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 1rem;
        font-size: 0.85rem;
    }

    .carousel-btn {
        width: 42px;
        height: 42px;
    }

    .carousel-btn-prev { left: 0.5rem; }
    .carousel-btn-next { right: 0.5rem; }

    .hero-slide {
        padding-top: calc(var(--nav-height) + 1rem);
    }
}

@media (max-width: 480px) {
    .hero-buttons,
    .contact-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons .btn,
    .contact-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .dependencias-section,
    .live-section,
    .contact-section {
        padding: 3rem 1.25rem;
    }
}
