/* ============================================
   Matrix Fitness Chile — main.css
   ============================================ */

:root {
    /* Paleta oficial Matrix Fitness */
    --mx-black:        #0A0A0A;   /* Fondos principales oscuros */
    --mx-black-deep:   #000000;   /* Fondo más profundo */
    --mx-thunder:      #231F20;   /* Negro oficial Matrix */
    --mx-red:          #CC0000;   /* Rojo oficial Matrix (Guardsman Red) */
    --mx-red-bright:   #E60000;   /* Hover / acento brillante */
    --mx-red-dark:     #990000;   /* Variante oscura del rojo */
    --mx-ink:          #0A0A0A;   /* Texto cuerpo */
    --mx-steel:        #5C6675;   /* Texto secundario */
    --mx-line:         #E5E5E5;   /* Bordes / separadores */
    --mx-cream:        #F5F5F5;   /* Fondo claro alterno */
    --mx-off-white:    #FAFAFA;   /* Fondo principal claro */
    --mx-white:        #FFFFFF;
    --mx-success:      #16794C;
    --mx-error:        #B91C1C;

    --font-display: 'Montserrat', system-ui, sans-serif;
    --font-body:    'Montserrat', system-ui, sans-serif;

    --max-w: 1320px;
    --pad-x: clamp(20px, 4vw, 64px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--mx-ink);
    background: var(--mx-off-white);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- Utilities ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }
.eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mx-red);
    font-weight: 700;
}
.eyebrow.light { color: rgba(255,255,255,0.75); }
.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--mx-thunder);
}
.section-title.light { color: var(--mx-white); }

/* ---------- Header / Nav ---------- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.3s ease;
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 76px;
}
.nav-logo {
    display: flex; align-items: center;
    color: var(--mx-white);
}
.nav-logo-img {
    width: 150px;
    height: auto;
    display: block;
}
.nav-links {
    display: flex; align-items: center; gap: 40px;
    list-style: none;
}
.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    position: relative;
}
.nav-links a:hover { color: var(--mx-white); }
.nav-links a::after {
    content: '';
    position: absolute; left: 0; bottom: -6px;
    width: 0; height: 2px;
    background: var(--mx-red);
    transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-cta {
    background: var(--mx-red);
    color: var(--mx-white);
    padding: 11px 22px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover { background: var(--mx-red-bright); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

.nav-toggle {
    display: none;
    width: 28px; height: 20px;
    position: relative;
}
.nav-toggle span {
    position: absolute; left: 0;
    width: 100%; height: 2px;
    background: var(--mx-white);
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 16px; }
.nav-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        top: 76px; left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--mx-black);
        padding: 20px var(--pad-x) 32px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-links li { width: 100%; }
    .nav-links a { display: block; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .nav-cta { display: inline-block; margin-top: 12px; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: flex-end;
    padding: 140px 0 80px;
    background: var(--mx-black);
    color: var(--mx-white);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(135deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.55) 50%, rgba(10,10,10,0.85) 100%),
        var(--hero-bg, none) center/cover no-repeat;
    z-index: 0;
}
.hero::after {
    /* Acento rojo en esquina superior derecha */
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 380px; height: 380px;
    background: radial-gradient(circle at top right, rgba(204,0,0,0.35) 0%, transparent 65%);
    z-index: 0;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: end;
    width: 100%;
}
.hero-text { max-width: 720px; }
.hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(48px, 8vw, 96px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-top: 24px;
}
.hero h1 strong {
    font-weight: 900;
    color: var(--mx-red);
}
.hero h1 .accent {
    display: block;
    font-weight: 900;
}
.hero-side {
    display: flex; flex-direction: column;
    gap: 24px;
    padding-bottom: 12px;
}
.hero-lead {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(255,255,255,0.82);
    max-width: 460px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 16px 28px;
    font-weight: 700; font-size: 14px;
    border-radius: 2px;
    transition: all 0.25s ease;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.btn-primary {
    background: var(--mx-red);
    color: var(--mx-white);
}
.btn-primary:hover { background: var(--mx-red-bright); transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    color: var(--mx-white);
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--mx-white); }
.btn .arrow { transition: transform 0.25s ease; }
.btn:hover .arrow { transform: translateX(4px); }

.hero-meta {
    position: absolute;
    bottom: 32px; right: var(--pad-x);
    display: flex; gap: 48px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
}
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 32px; }
    .hero-meta { display: none; }
    .hero { padding: 120px 0 60px; }
}

/* ---------- Stats strip ---------- */
.stats-strip {
    background: var(--mx-cream);
    padding: 64px 0;
    border-bottom: 1px solid var(--mx-line);
    position: relative;
}
.stats-strip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--mx-red);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}
.stat-item .num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--mx-thunder);
}
.stat-item .num .accent { color: var(--mx-red); }
.stat-item .label {
    margin-top: 8px;
    font-size: 14px;
    color: var(--mx-steel);
    line-height: 1.4;
}
@media (max-width: 700px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* ---------- Section base ---------- */
.section { padding: clamp(80px, 12vw, 140px) 0; }
.section-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: end;
    margin-bottom: 64px;
}
.section-head p {
    color: var(--mx-steel);
    max-width: 480px;
    font-size: 17px;
    line-height: 1.6;
}
@media (max-width: 800px) {
    .section-head { grid-template-columns: 1fr; gap: 24px; align-items: start; margin-bottom: 48px; }
}

/* ---------- Productos ---------- */
.productos { background: var(--mx-off-white); }
.productos-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}
.producto-card {
    position: relative;
    background: var(--mx-white);
    border: 1px solid var(--mx-line);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex; flex-direction: column;
    min-height: 420px;
}
.producto-card:nth-child(1) { grid-column: span 7; }
.producto-card:nth-child(2) { grid-column: span 5; }
.producto-card:nth-child(3) { grid-column: span 4; }
.producto-card:nth-child(4) { grid-column: span 4; }
.producto-card:nth-child(5) { grid-column: span 4; }
.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.18);
}
.producto-img {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--mx-cream);
    min-height: 220px;
}
.producto-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.producto-card:hover .producto-img img { transform: scale(1.05); }
.producto-body {
    padding: 28px 28px 32px;
    border-top: 3px solid var(--mx-red);
}
.producto-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.015em;
    color: var(--mx-thunder);
    margin-bottom: 10px;
}
.producto-body p {
    color: var(--mx-steel);
    font-size: 15px;
    line-height: 1.55;
}
.producto-tag {
    position: absolute; top: 20px; left: 20px;
    background: var(--mx-red);
    color: var(--mx-white);
    padding: 6px 12px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    z-index: 2;
    font-weight: 700;
}
@media (max-width: 900px) {
    .producto-card:nth-child(n) { grid-column: span 12; }
}

/* ---------- Nosotros ---------- */
.nosotros {
    background: var(--mx-black);
    color: var(--mx-white);
    position: relative;
    overflow: hidden;
}
.nosotros::before {
    content: '';
    position: absolute;
    top: 0; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--mx-red) 0%, transparent 65%);
    opacity: 0.18;
    z-index: 0;
}
.nosotros::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -150px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--mx-red-dark) 0%, transparent 60%);
    opacity: 0.15;
    z-index: 0;
}
.nosotros .container { position: relative; z-index: 1; }
.nosotros-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    align-items: center;
}
.nosotros-img {
    aspect-ratio: 4/5;
    background: var(--mx-black-deep);
    overflow: hidden;
    position: relative;
    border-left: 4px solid var(--mx-red);
}
.nosotros-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: contrast(1.05);
}
.nosotros-text h2 { color: var(--mx-white); }
.nosotros-text p {
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.65;
    color: rgba(255,255,255,0.82);
    max-width: 560px;
}
.nosotros-text p + p { margin-top: 16px; }
@media (max-width: 900px) {
    .nosotros-grid { grid-template-columns: 1fr; gap: 40px; }
    .nosotros-img { aspect-ratio: 4/3; }
}

/* ---------- Markets cards ---------- */
.markets { background: var(--mx-cream); }
.markets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.market-item {
    background: var(--mx-white);
    padding: 36px 28px;
    border: 1px solid var(--mx-line);
    border-top: 3px solid var(--mx-thunder);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.market-item:hover {
    transform: translateY(-3px);
    border-top-color: var(--mx-red);
}
.market-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--mx-thunder);
    color: var(--mx-red);
    margin-bottom: 24px;
}
.market-item:hover .market-icon { background: var(--mx-red); color: var(--mx-white); }
.market-item h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--mx-thunder);
    margin-bottom: 8px;
}
.market-item p { font-size: 14px; color: var(--mx-steel); line-height: 1.5; }
@media (max-width: 800px) { .markets-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .markets-grid { grid-template-columns: 1fr; } }

/* ---------- Contacto ---------- */
.contacto { background: var(--mx-black-deep); color: var(--mx-white); position: relative; overflow: hidden; }
.contacto::before {
    content: '';
    position: absolute;
    top: -100px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--mx-red) 0%, transparent 60%);
    opacity: 0.12;
    z-index: 0;
}
.contacto .container { position: relative; z-index: 1; }
.contacto-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    align-items: start;
}
.contacto-info h2 { color: var(--mx-white); }
.contacto-info p { color: rgba(255,255,255,0.75); font-size: 16px; line-height: 1.6; margin-top: 20px; max-width: 420px; }
.contacto-info .info-block { margin-top: 36px; }
.contacto-info .info-block strong {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mx-red);
    margin-bottom: 8px;
    font-weight: 700;
}
.contacto-info .info-block span {
    font-size: 16px;
    color: rgba(255,255,255,0.88);
    line-height: 1.5;
}

/* Form */
.contacto-form {
    background: var(--mx-white);
    color: var(--mx-ink);
    padding: 48px;
    border-radius: 2px;
    border-top: 4px solid var(--mx-red);
}
.contacto-form h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--mx-thunder);
    margin-bottom: 28px;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.form-row.full { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; }
.form-field label {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mx-steel);
    margin-bottom: 6px;
    font-weight: 600;
}
.form-field label .req { color: var(--mx-red); }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 14px 14px;
    background: var(--mx-off-white);
    border: 1px solid var(--mx-line);
    border-radius: 2px;
    font-size: 15px;
    color: var(--mx-ink);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--mx-red);
    background: var(--mx-white);
}
.form-field textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.form-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6675' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 42px;
}
.form-submit {
    width: 100%;
    background: var(--mx-red);
    color: var(--mx-white);
    padding: 16px 24px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 2px;
    transition: background 0.25s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.form-submit:hover { background: var(--mx-red-bright); }
.form-submit:disabled { opacity: 0.6; cursor: wait; }
.form-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--mx-steel);
    line-height: 1.5;
}
.form-note a { color: var(--mx-red); }

.form-message {
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 2px;
    font-size: 14px;
}
.form-message.success { background: #E7F4EE; color: var(--mx-success); border: 1px solid #B4DCC8; }
.form-message.error   { background: #FDE8E8; color: var(--mx-error);   border: 1px solid #F8C5C5; }

@media (max-width: 900px) {
    .contacto-grid { grid-template-columns: 1fr; gap: 40px; }
    .contacto-form { padding: 32px 24px; }
    .form-row { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--mx-black-deep);
    color: rgba(255,255,255,0.6);
    padding: 60px 0 32px;
    border-top: 3px solid var(--mx-red);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand { color: var(--mx-white); }
.footer-brand p { margin-top: 16px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.6); max-width: 320px; }
.footer-col h5 {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mx-white);
    margin-bottom: 18px;
    font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--mx-red); }
.footer-socials { display: flex; gap: 12px; margin-top: 20px; }
.footer-socials a {
    width: 38px; height: 38px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.footer-socials a:hover { background: var(--mx-red); border-color: var(--mx-red); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px;
    flex-wrap: wrap; gap: 12px;
}
@media (max-width: 800px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 500px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}
