:root {
    --bg-dark: #0f0f13;
    --bg-secondary: #16161a;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --red-primary: #d31118;
    --red-dark: #cc0000;
    --gradient-main: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    --font-main: 'Montserrat', sans-serif;
    --spacing-section: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 20px;
}

h2.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-main);
}

.highlight {
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary,
.btn-cta,
.btn-outline {
    display: inline-block;
    padding: 12px 28px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-main);
    color: var(--text-main);
    border: none;
    font-weight: 800;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(211, 17, 24, 0.6);
    transform: translateY(-2px);
    color: var(--text-main);
}

.btn-cta {
    background: var(--gradient-main);
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 16px 40px;
    border: none;
    margin-top: 30px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(204, 0, 0, 0.4);
}

.btn-outline {
    border: 2px solid var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
}

/* Header */
header {
    background-color: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--red-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background-image: url('assets/herobg.png');
    /* User selected image */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Fallback if image fails or path differs */
.hero {
    background-color: black;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 15, 19, 0.95) 0%, rgba(15, 15, 19, 0.7) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 600px;
}

/* Sections */
.section {
    padding: var(--spacing-section) 0;
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    justify-content: center;
}

/* Gallery / Instalaciones */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Schedule Section */
.schedule-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.schedule-card {
    background: rgba(211, 17, 24, 0.1);
    border: 2px solid var(--red-primary);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

.schedule-day {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.schedule-time {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Head Coach Section */
.coach-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.coach-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .coach-card {
        flex-direction: row;
        align-items: stretch;
    }
}

.coach-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(211, 17, 24, 0.3);
}

.coach-img-wrapper {
    flex: 1;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.coach-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.coach-info {
    flex: 1.5;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.coach-name {
    font-size: 2rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.coach-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}

.coach-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.coach-social a {
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
}

.coach-social a:hover {
    color: var(--red-primary);
    transform: scale(1.1);
}

/* Cards (Benefits) */
.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--red-primary);
}

.icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-muted);
}

/* Testimonials */
.testimonial {
    background: var(--bg-dark);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.stars {
    color: var(--red-primary);
    margin-bottom: 15px;
    letter-spacing: 5px;
}

.testimonial p {
    font-style: italic;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.client {
    font-weight: 700;
    color: var(--text-main);
}

/* Indicadores de Carrusel Móvil (dots) */
.carousel-indicators {
    display: none;
    /* Oculto por defecto en PC, se mostrará en móvil */
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--red-primary);
    transform: scale(1.2);
}

/* Pricing Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 50px auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 5px;
    position: relative;
    /* Necesario para el slider absoluto */
}

/* Sliding Pill Element */
.sliding-pill {
    position: absolute;
    top: 8px;
    /* Igual al padding del contenedor */
    left: 8px;
    /* Valor inicial se ajusta por JS */
    height: calc(100% - 16px);
    width: 0;
    /* JS calculará el ancho */
    background: var(--gradient-main);
    border-radius: 40px;
    box-shadow: 0 4px 15px rgba(211, 17, 24, 0.4);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.tab-btn {
    position: relative;
    z-index: 2;
    /* Para que el texto quede por encima del slider */
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 30px;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--text-main);
    /* El background y sombreado ahora los tiene el .sliding-pill */
}

.tab-btn:not(.active):hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.plan-category-title {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
}

.plan-category-title h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    letter-spacing: 2px;
    display: inline-block;
    position: relative;
    margin: 0;
}

.plan-category-title h3::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-main);
    border-radius: 2px;
}

.pricing-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.pricing-content.active {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Plans */
.plan-card {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    transition: transform 0.3s;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.plan-card .btn-outline,
.plan-card .btn-primary {
    margin-top: auto;
}

.plan-card:hover,
.plan-card.fade-in.visible:hover {
    transform: scale(1.03);
    border-color: var(--red-primary);
}

.plan-card.featured {
    border: 2px solid var(--red-dark);
    background: rgba(204, 0, 0, 0.05);
}

.plan-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.price {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 30px;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-card ul {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
}

.plan-card ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-card ul li::before {
    content: "✓";
    color: var(--red-primary);
    margin-right: 10px;
    font-weight: bold;
}

.tag {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--red-dark);
    color: white;
    padding: 5px 15px;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
}

/* FAQ Accordion */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: left;
    padding: 20px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-question:hover,
.faq-question.active {
    color: var(--red-primary);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p {
    color: var(--text-muted);
    padding-bottom: 20px;
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: #000;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-map {
    width: 100%;
    height: 100%;
    min-height: 250px;
}

.footer-map iframe {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: 8px;
}

.footer-info p {
    color: var(--text-muted);
    margin-top: 10px;
}

.social-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-links h3 {
    margin: 0;
}

.social-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.social-links a:hover {
    color: var(--red-primary);
}

.copyright {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-link {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dev-link:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(211, 17, 24, 0.5);
}

/* Floating Copied Alert */
.copy-alert {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--bg-secondary);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid var(--red-primary);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(211, 17, 24, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
    text-align: center;
    font-size: 1rem;
}

.copy-alert.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: 40px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-icon {
    width: 25px;
    height: 25px;
    fill: white;
    /* Optical alignment due to the speech bubble tail */
    margin-top: -1px;
    margin-left: 1px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #1ebe56;
    animation: none;
}

@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Premium Entrance Animations */
.slide-down {
    animation: slideDown 0.6s ease-out both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zoom-in {
    animation: zoomIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out both;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add custom glow to highlighted text */
.highlight {
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(211, 17, 24, 0.3);
}

/* Responsive - Tablets (iPad Pro/Air) */
@media (max-width: 1080px) {
    .nav-link {
        display: none;
    }

    nav .btn-primary {
        padding: 8px 16px;
        font-size: 0.8rem;
        border-radius: 30px;
        margin-right: 15px;
        white-space: nowrap;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.5rem;
    }

    /* Disable parallax on tablet as well to prevent Safari bugs */
    .hero {
        background-attachment: scroll;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .footer-map iframe {
        width: 100%;
        max-width: 600px;
        height: 250px;
    }

    .footer-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .social-links {
        align-items: center;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }

    .social-links h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 5px !important;
    }
}

/* Responsive - Mobile Phones */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .btn-cta {
        font-size: 1rem;
        padding: 14px 30px;
        width: auto;
    }

    .nav-link {
        display: none;
    }

    nav .btn-primary {
        padding: 6px 12px;
        font-size: 0.65rem;
        border-radius: 40px;
        margin-right: 10px;
        white-space: nowrap;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.5rem;
    }

    /* Disable parallax on mobile to prevent background-image bug in iOS Safari */
    .hero {
        background-image: url('assets/herobg-mobile.png');
        height: 90vh;
        /* Reducido de 100vh para que la imagen no se corte tanto a los lados */
        min-height: 550px;
        background-attachment: scroll;
        background-position: center;
        /* Centrado para la imagen portrait */
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    #testimonios .grid-3 {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 20px;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scroll-padding-left: 20px;
        align-items: stretch;
    }

    #testimonios .grid-3::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari/Opera */
    }

    #testimonios .testimonial {
        flex: 0 0 80%;
        scroll-snap-align: center;
    }

    .carousel-indicators {
        display: flex;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .social-links {
        align-items: center;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }

    .social-links h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .social-links a {
        margin: 0;
    }

    /* Add extra padding to the bottom so the footer is never cut off by iOS/Android toolbars */
    .copyright {
        padding-bottom: 40px;
    }

    /* Keep Whatsapp button higher on mobile to avoid bottom bars */
    .whatsapp-float {
        bottom: 75px;
    }

    /* Raise the copied alert to avoid iOS Safari bottom bar */
    .copy-alert {
        bottom: 90px;
    }
}

/* Responsive - Very Small Phones (e.g., iPhone SE, XR narrow view) */
@media (max-width: 400px) {
    .logo {
        font-size: 1rem;
    }

    .logo-img {
        height: 35px;
    }

    nav .btn-primary {
        padding: 5px 10px;
        font-size: 0.55rem;
        margin-right: 5px;
        white-space: nowrap;
    }

    .mobile-menu-btn {
        font-size: 1.2rem;
    }

    .copy-alert {
        font-size: 0.8rem;
        padding: 10px 20px;
    }
}