/* Sanagym — estilos principales */

:root {
    --sg-bg: #0f1115;
    --sg-bg-alt: #14171d;
    --sg-surface: #1a1e26;
    --sg-text: #ececec;
    --sg-muted: #9aa0a6;
    --sg-border: #2a2f3a;
    --sg-accent: #6da161;
    --sg-accent-dark: #4a7c59;
    --sg-accent-rgb: 109,161,97;
    --sg-radius: 14px;
    --sg-container: 1180px;
    --sg-shadow: 0 10px 30px rgba(0,0,0,.25);
    --sg-shadow-soft: 0 4px 16px rgba(0,0,0,.06);

    --sg-light-bg: #fafafa;
    --sg-light-bg-alt: #f1f3f5;
    --sg-light-text: #0f1115;
    --sg-light-muted: #5b6470;
    --sg-light-border: #e5e7eb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--sg-light-bg);
    color: var(--sg-light-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: var(--sg-accent); text-decoration: none; }
a:hover { color: var(--sg-accent-dark); }

/* Override global: ningún link del tema lleva subrayado (ni en hero, secciones, botones, etc.) */
.sanagym-main a,
.sanagym-main a:hover,
.sanagym-main a:focus,
.sanagym-main a:active,
.sg-btn,
.sg-btn:hover,
.sg-btn:focus,
.sg-btn:active {
    text-decoration: none !important;
}

.sg-container {
    width: 100%;
    max-width: var(--sg-container);
    margin: 0 auto;
    padding: 0 24px;
}

.sg-skip {
    position: absolute; left: -9999px; top: auto;
    padding: 8px 12px; background: #000; color: #fff; z-index: 100;
}
.sg-skip:focus { left: 16px; top: 16px; }

/* ============================================================
 * HEADER
 * ============================================================ */
.sg-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.9);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--sg-light-border);
}
.sg-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 100px;
    gap: 24px;
}

.sg-header a,
.sg-header a:hover,
.sg-header a:focus,
.sg-header a:active {
    text-decoration: none !important;
    box-shadow: none;
}

.sg-logo {
    display: inline-flex; align-items: center;
    color: var(--sg-light-text);
    text-decoration: none;
    line-height: 0;
}
.sg-logo:hover { color: var(--sg-accent); }
.sg-logo .custom-logo-link,
.sg-logo a {
    display: inline-block;
    line-height: 0;
}
.sg-logo img,
.sg-logo .custom-logo {
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    display: block;
}
.sg-logo__text {
    font-weight: 800;
    letter-spacing: -.01em;
    font-size: 1.4rem;
    line-height: 1;
}

.sg-nav__list {
    display: flex; align-items: center; gap: 4px;
    list-style: none; margin: 0; padding: 0;
}
.sg-nav__list a {
    color: var(--sg-light-text);
    font-weight: 500;
    font-size: .98rem;
    padding: 10px 18px;
    border-radius: 10px;
    transition: color .15s, background .15s;
}
.sg-nav__list a:hover { color: var(--sg-accent); background: var(--sg-light-bg-alt); }

.sg-nav__cta {
    background: var(--sg-light-text);
    color: #fff !important;
    padding: 11px 24px !important;
    border-radius: 999px;
    margin-left: 10px;
    font-weight: 600;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.sg-nav__cta:hover {
    background: var(--sg-accent) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--sg-accent-rgb),.35);
}

.sg-nav-toggle {
    display: none;
    background: none; border: 0; padding: 0;
    cursor: pointer;
    width: 44px; height: 44px;
    border-radius: 10px;
    transition: background .15s;
}
.sg-nav-toggle:hover { background: var(--sg-light-bg-alt); }
.sg-nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--sg-light-text); margin: 5px auto;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.sg-nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sg-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.sg-nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 820px) {
    /* Quitar backdrop-filter en mobile: crea containing block que atrapa el position:fixed del nav */
    .sg-header {
        background: #fff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .sg-header__inner { min-height: 72px; }
    .sg-logo img,
    .sg-logo .custom-logo { max-height: 56px !important; }
    .sg-nav-toggle { display: block; }

    .sg-nav {
        position: fixed !important;
        top: 72px;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - 72px);
        background: #fff !important;
        padding: 32px 24px !important;
        margin: 0 !important;
        transform: translateX(100%);
        transition: transform .3s cubic-bezier(.22,1,.36,1);
        overflow-y: auto;
        z-index: 99;
        display: block !important;
        visibility: visible;
    }
    .sg-nav.is-open { transform: translateX(0); }

    .sg-nav__list {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
    }
    .sg-nav__list li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .sg-nav__list a {
        display: block !important;
        width: 100%;
        font-size: 1.2rem !important;
        font-weight: 500;
        padding: 18px 16px !important;
        border-radius: 12px;
        color: var(--sg-light-text) !important;
        line-height: 1.2;
    }
    .sg-nav__list a.sg-nav__cta {
        margin: 20px 0 0 !important;
        text-align: center;
        background: var(--sg-light-text) !important;
        color: #fff !important;
        padding: 18px 24px !important;
        border-radius: 999px;
    }
    .sg-nav__list a.sg-nav__cta:hover {
        background: var(--sg-accent) !important;
    }
    body.nav-open { overflow: hidden; }
}

/* ============================================================
 * HERO
 * ============================================================ */
.sg-hero {
    min-height: 60vh;
    background-color: #1a1e26;
    background-size: cover;
    background-position: center;
    display: flex; align-items: center;
    color: #fff;
    padding: 80px 0;
}
.sg-hero__inner { text-align: center; max-width: 820px; margin: 0 auto; }
.sg-hero__title {
    margin: 0 0 18px;
    line-height: 1.05;
}
.sg-hero__brand {
    display: block;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -.025em;
}
.sg-hero__location {
    display: block;
    margin-top: 10px;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 500;
    color: #d6d6d6;
    letter-spacing: .01em;
}
.sg-hero__subtitle {
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    color: #d6d6d6;
    margin: 14px auto 32px;
    max-width: 640px;
}

/* ============================================================
 * BOTONES
 * ============================================================ */
.sg-btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
    cursor: pointer;
    line-height: 1;
}
.sg-btn:hover { transform: translateY(-1px); }
.sg-btn--primary {
    background: var(--sg-accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(var(--sg-accent-rgb),.35);
}
.sg-btn--primary:hover {
    background: var(--sg-accent-dark);
    color: #fff;
    box-shadow: 0 10px 28px rgba(var(--sg-accent-rgb),.5);
}

/* ============================================================
 * SECCIONES (one-page)
 * ============================================================ */
.sg-section {
    padding: 100px 0;
}
.sg-section--light {
    background: #ffffff;
    color: var(--sg-light-text);
}
.sg-section--alt {
    background: var(--sg-light-bg-alt);
    color: var(--sg-light-text);
}
.sg-section__header {
    text-align: center;
    margin-bottom: 48px;
}
.sg-section__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -.02em;
    line-height: 1.1;
}
.sg-section__intro {
    color: var(--sg-light-muted);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Imagen grande de Horario / Tarifas */
.sg-figure {
    margin: 0 auto;
    max-width: 1080px;
    background: #fff;
    border: 1px solid var(--sg-light-border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--sg-shadow-soft);
    overflow: hidden;
}
.sg-figure a {
    display: block;
    cursor: zoom-in;
    transition: opacity .2s;
}
.sg-figure a:hover { opacity: .92; }
.sg-figure img {
    width: 100%; height: auto; display: block;
    border-radius: 10px;
}
.sg-section--alt .sg-figure {
    border-color: transparent;
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
}

@media (max-width: 600px) {
    .sg-section { padding: 64px 0; }
    .sg-figure { padding: 8px; border-radius: 14px; }
}

/* ============================================================
 * CONTACTO
 * ============================================================ */
.sg-contact-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr 1.1fr;
    max-width: 1000px;
    margin: 0 auto;
}
@media (max-width: 820px) {
    .sg-contact-grid { grid-template-columns: 1fr; gap: 24px; }
}

.sg-contact-info {
    background: #fff;
    border: 1px solid var(--sg-light-border);
    border-radius: 18px;
    padding: 36px;
    box-shadow: var(--sg-shadow-soft);
}
.sg-section--alt .sg-contact-info { border-color: transparent; }

.sg-contact-row {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 0;
    border-bottom: 1px solid var(--sg-light-border);
}
.sg-contact-row:first-child { padding-top: 0; }
.sg-contact-row:last-of-type { border-bottom: 0; }
.sg-contact-row__label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--sg-light-muted);
    font-weight: 600;
}
.sg-contact-row__value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sg-light-text);
    line-height: 1.4;
}
.sg-contact-row__value--multiline {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.65;
}
a.sg-contact-row__value:hover { color: var(--sg-accent); }

.sg-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--sg-accent);
    font-weight: 500;
}
.sg-link:hover { color: var(--sg-accent-dark); }

.sg-map {
    border: 1px solid var(--sg-light-border);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--sg-shadow-soft);
}
.sg-section--alt .sg-map { border-color: transparent; }
.sg-map iframe {
    width: 100%;
    min-height: 380px;
    border: 0;
    display: block;
}

.sg-empty {
    text-align: center;
    color: var(--sg-light-muted);
    padding: 56px 24px;
    background: #fff;
    border: 1px dashed var(--sg-light-border);
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
 * GALERÍA DE INSTALACIONES
 * ============================================================ */
ul.sg-gallery,
.sg-gallery {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px;
    max-width: 1080px;
}
.sg-gallery__item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: var(--sg-light-bg-alt);
    box-shadow: var(--sg-shadow-soft);
    cursor: zoom-in;
}
.sg-gallery__item::before,
.sg-gallery__item::marker { content: none !important; }
.sg-gallery__link {
    display: block !important;
    width: 100%; height: 100%;
    overflow: hidden;
    border: 0;
}
.sg-gallery__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    transition: transform .4s ease;
}
.sg-gallery__link:hover .sg-gallery__img {
    transform: scale(1.06);
}

@media (max-width: 1024px) {
    ul.sg-gallery,
    .sg-gallery { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }
}
@media (max-width: 600px) {
    ul.sg-gallery,
    .sg-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
}

/* Lightbox */
.sg-lightbox {
    position: fixed; inset: 0;
    background: rgba(15,17,21,.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.sg-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}
.sg-lightbox__img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    object-fit: contain;
}
.sg-lightbox__close {
    position: absolute;
    top: 20px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.sg-lightbox__close:hover {
    background: rgba(255,255,255,.22);
    transform: scale(1.05);
}
.sg-lightbox__nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.sg-lightbox__nav:hover {
    background: rgba(255,255,255,.22);
}
.sg-lightbox__nav--prev { left: 20px; }
.sg-lightbox__nav--next { right: 20px; }
@media (max-width: 600px) {
    .sg-lightbox__nav { width: 40px; height: 40px; }
    .sg-lightbox__nav--prev { left: 8px; }
    .sg-lightbox__nav--next { right: 8px; }
    .sg-lightbox__close { top: 12px; right: 12px; }
}
body.lightbox-open { overflow: hidden; }

/* ============================================================
 * FOOTER
 * ============================================================ */
.sg-footer {
    background: var(--sg-bg);
    color: var(--sg-muted);
    padding: 28px 0;
}
.sg-footer__bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    font-size: .9rem;
}
.sg-footer__bottom-inner small { color: var(--sg-muted); }
.sg-footer a,
.sg-footer a:hover,
.sg-footer a:focus,
.sg-footer a:active {
    text-decoration: none !important;
}
.sg-footer__ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d8d8d8 !important;
    font-size: .9rem;
    padding: 6px 12px;
    border-radius: 999px;
    transition: color .15s, background .15s;
    text-decoration: none !important;
}
.sg-footer__ig svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.sg-footer__ig:hover {
    color: var(--sg-accent) !important;
    background: rgba(255,255,255,.05);
}

/* Scroll-margin para anclas con header sticky */
section[id] { scroll-margin-top: 110px; }

/* ============================================================
 * Páginas estáticas (Aviso legal, Privacidad, Cookies...)
 * ============================================================ */
.sg-page {
    padding: 40px 0 80px;
    background: var(--sg-light-bg);
}
.sg-page__inner {
    max-width: 820px;
}
.sg-page__header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sg-light-border);
}
.sg-page__title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.2;
    margin: 0;
    color: var(--sg-light-text);
}
.sg-page__content {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--sg-light-text);
}
.sg-page__content h2 {
    font-size: 1.4rem;
    margin: 36px 0 12px;
    color: var(--sg-light-text);
}
.sg-page__content h3 {
    font-size: 1.15rem;
    margin: 28px 0 10px;
    color: var(--sg-light-text);
}
.sg-page__content p,
.sg-page__content ul,
.sg-page__content ol {
    margin: 0 0 16px;
}
.sg-page__content ul,
.sg-page__content ol {
    padding-left: 22px;
}
.sg-page__content li { margin-bottom: 6px; }
.sg-page__content a {
    color: var(--sg-accent-dark);
    text-decoration: underline;
}
.sg-page__content a:hover { color: var(--sg-accent); }
.sg-page__content strong { color: var(--sg-light-text); }

/* 404 ----------------------------------------------------- */
.sg-page--404 {
    padding: 60px 0 100px;
    min-height: 55vh;
    display: flex;
    align-items: center;
    text-align: center;
}
.sg-page--404 .sg-page__inner {
    margin-inline: auto;
}
.sg-page--404__code {
    font-size: clamp(5rem, 14vw, 9rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 8px;
    color: var(--sg-accent);
    letter-spacing: -.04em;
}
.sg-page--404 .sg-page__title {
    margin: 0 0 14px;
    border: 0;
    padding: 0;
}
.sg-page--404__lead {
    font-size: 1.05rem;
    color: var(--sg-light-muted);
    margin: 0 auto 32px;
    max-width: 520px;
    line-height: 1.55;
}
.sg-page--404 .sg-btn { display: inline-flex; }

/* ============================================================
 * Footer — enlaces legales
 * ============================================================ */
.sg-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin: 14px 0;
    font-size: .85rem;
}
.sg-footer__legal a {
    color: var(--sg-muted) !important;
    transition: color .15s;
}
.sg-footer__legal a:hover {
    color: #d8d8d8 !important;
}
.sg-footer__legal-sep {
    color: var(--sg-border);
    user-select: none;
}
