/* ═══════════════════════════════════════════
   Centro de Entrenamiento VIDA — Custom Styles
   Complementa Tailwind CSS con estilos personalizados
   ═══════════════════════════════════════════ */

/* ── Fuentes (alojadas en local) ──────────── */
/* Variables: un archivo cubre los pesos 400–700. Subconjunto latino
   de Google Fonts (incluye todos los caracteres del español). */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/oswald-latin.woff2') format('woff2');
}

/* ── Iconos SVG (sprite al inicio del <body>) ── */
/* Mismo tamaño y alineación que tenían con Font Awesome */
.icon {
    display: inline-block;
    height: 1em;
    width: auto;
    overflow: visible;
    vertical-align: -0.125em;
    fill: currentColor;
}

/* ── Animación de entrada (sustituye a AOS) ── */
/* js/main.js añade .aos-ready solo en escritorio y sin reduced-motion;
   sin JS, el contenido se ve siempre. */
.aos-ready [data-aos] {
    opacity: 0;
    transform: translate3d(0, 100px, 0);
}

/* La transición solo existe al aparecer: al ocultar es instantáneo */
.aos-ready [data-aos].aos-animate {
    opacity: 1;
    transform: none;
    transition-property: opacity, transform;
    transition-duration: 0.6s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ── Logo container on dark backgrounds ──── */
.logo-container {
    border-radius: 10px;
    padding: 4px 12px;
}

/* ── Smooth scroll ────────────────────────── */
/* Los anclajes (#centros…) quedan por debajo de la barra fija de 5rem */
html {
    scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ── Selection color ──────────────────────── */
::selection {
    background-color: #2ECDA7;
    color: #ffffff;
}

/* ── Custom Scrollbar ─────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F0F2F5;
}

::-webkit-scrollbar-thumb {
    background: #2ECDA7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #25a888;
}

/* ── Navbar ────────────────────────────────── */
#navbar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

/* Active nav link */
/* Texto pequeño en verde oscuro (#1A7660, contraste ≥ 4,5:1 en todos los fondos); la barra
   decorativa conserva el verde de marca */
.nav-link.active {
    color: #1A7660;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #2ECDA7;
    border-radius: 1px;
}

/* ── Hamburger animation ──────────────────── */
#menu-toggle.open .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#menu-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle.open .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── Swiper customization ─────────────────── */
.swiper-button-next,
.swiper-button-prev {
    color: #2ECDA7 !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(46, 205, 167, 0.9);
    color: #ffffff !important;
}

.swiper-pagination-bullet {
    background: #D1D5DB !important;
    opacity: 0.5 !important;
    width: 10px !important;
    height: 10px !important;
}

/* Área táctil de 24×24 px (WCAG 2.5.8) sin cambiar el punto visible */
.swiper {
    --swiper-pagination-bullet-horizontal-gap: 7px;
}

.swiper-pagination-bullet {
    position: relative;
}

.swiper-pagination-bullet::after {
    content: '';
    position: absolute;
    inset: -7px;
}

.swiper-pagination-bullet-active {
    background: #2ECDA7 !important;
    opacity: 1 !important;
    width: 30px !important;
    border-radius: 5px !important;
}

/* ── Counters ─────────────────────────────── */
.counter::before {
    content: '+';
}

/* ── Mobile menu active state ─────────────── */
#mobile-menu.open {
    transform: translateX(0) !important;
}

#mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Back to top visible ──────────────────── */
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Service card glow on hover ───────────── */
.service-card:hover {
    box-shadow: 0 0 30px rgba(46, 205, 167, 0.08),
                0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ── Schedule grid (estilo tarjeta centros) ── */
.schedule-grid {
    border-collapse: separate;
    border-spacing: 3px;
}

.schedule-grid th {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666C7A;
    padding: 4px 2px;
    text-align: center;
}

.schedule-grid td {
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    line-height: 1.3;
}

.schedule-grid td span {
    display: block;
    font-size: 0.5rem;
    font-weight: 600;
    margin-top: 1px;
}

/* La hora es cabecera de fila (<th>) pero conserva el aspecto de celda */
.schedule-grid th.time-cell {
    font-size: 0.6rem;
    letter-spacing: normal;
    line-height: 1.3;
    padding: 6px 8px 6px 4px;
}

.schedule-grid .time-cell {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: #1A7660;
    text-align: right;
    padding-right: 8px;
    white-space: nowrap;
    background: transparent;
}

.schedule-grid .cell-open {
    background: rgba(46, 205, 167, 0.08);
    color: #1A1A1A;
}

.schedule-grid .cell-grupos {
    background: rgba(212, 164, 75, 0.2);
    color: #81642E;
    border: 1px solid rgba(212, 164, 75, 0.4);
}

.schedule-grid .cell-grupos span {
    color: #81642E;
}

.schedule-grid .cell-senior {
    background: rgba(46, 205, 167, 0.2);
    color: #1A7660;
    border: 1px solid rgba(46, 205, 167, 0.4);
}

.schedule-grid .cell-senior span {
    color: #1A7660;
}

.schedule-grid .cell-empty {
    background: rgba(0, 0, 0, 0.04);
}

/* En móviles muy estrechos (< 375 px) la tabla se compacta para que
   quepan los cinco días sin desplazamiento horizontal */
@media (max-width: 374px) {
    .schedule-grid {
        border-spacing: 2px;
    }

    .schedule-grid td {
        padding: 5px 1px;
        font-size: 0.55rem;
    }

    .schedule-grid th.time-cell {
        padding: 5px 4px 5px 0;
    }
}

/* ── Centro card accordion ─────────────────── */
.centro-toggle-icon {
    transition: transform 0.3s ease;
}

.centro-schedule {
    border-top: 1px solid transparent;
    transition: max-height 0.4s ease, border-color 0.3s ease;
}

.centro-toggle[aria-expanded="true"] + .centro-schedule {
    border-top-color: rgba(0, 0, 0, 0.08);
}

/* ── Foco visible al navegar con teclado ──── */
:focus-visible {
    outline: 2px solid #1A7660;
    outline-offset: 2px;
}

/* Los campos del formulario quitan el contorno con `focus:outline-none` */
#trabaja-form :is(input, textarea):focus-visible {
    outline: 2px solid #1A7660;
    outline-offset: 1px;
}

/* ── Menos movimiento si el usuario lo pide ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
