/* ===== Variables y base ===== */
:root {
    --primary: #821417;
    --primary-dark: #6d1013;
    --cream: #FFF4E1;
    --bg: #F7F7F7;
    --surface: #FFFFFF;
    --text: #212121;
    --text-secondary: #616161;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-heading: 'Sora', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Nav ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.nav-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
}

.nav-links a {
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

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

.nav-cta {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.nav-cta:hover {
    background: var(--primary-dark);
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    padding: 0.5rem;
    margin-right: -0.5rem;
    color: var(--text);
    cursor: pointer;
    transition: color 0.15s ease;
}

.menu-toggle:hover {
    color: var(--primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

.mobile-menu {
    border-top: 1px solid #f3f4f6;
    background: var(--surface);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1.5rem;
}

.mobile-menu-links a {
    padding: 0.75rem 0;
    transition: color 0.15s ease;
}

.mobile-menu-links a:hover {
    color: var(--primary);
}

.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .nav-inner {
        padding: 0.875rem 3rem;
    }

    .nav-links {
        display: flex;
    }

    .menu-toggle,
    .mobile-menu {
        display: none;
    }
}

/* ===== Hero ===== */
.hero {
    background: var(--cream);
    padding: 3.5rem 1.5rem 7rem;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-phone {
    display: flex;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 3rem 7rem;
    }

    .hero-inner {
        grid-template-columns: 1.2fr 1fr;
        text-align: left;
    }

    .hero h1 {
        font-size: 3.75rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        margin-left: 0;
        margin-right: 0;
    }

    .hero .store-badges {
        justify-content: flex-start;
    }
}

/* ===== Badges de tiendas ===== */
.store-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.store-badges .badge-appstore {
    height: 48px;
    width: auto;
}

/* El badge de Google Play trae padding interno propio: se compensa con mayor altura */
.store-badges .badge-googleplay {
    height: 62px;
    width: auto;
    margin: -7px 0;
}

/* ===== Marco de teléfono ===== */
.phone-frame {
    background: var(--surface);
    border: 8px solid var(--text);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 280px;
}

@media (min-width: 768px) {
    .phone-frame {
        width: 300px;
    }
}

/* ===== Separadores de onda ===== */
.wave-divider {
    display: block;
    width: 100%;
    height: 60px;
    position: absolute;
    left: 0;
}

.wave-divider--bottom {
    bottom: 0;
}

.wave-divider--top {
    top: 0;
    transform: rotate(180deg);
}

/* ===== Secciones genéricas ===== */
.section {
    padding: 6rem 1.5rem;
}

.section-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 2.25rem;
    }
}

/* ===== Cómo funciona ===== */
.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1.25rem;
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Features ===== */
.features-section {
    background: var(--cream);
    position: relative;
    padding-top: 7rem;
    padding-bottom: 7rem;
}

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.feature-card img {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    width: 100%;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .features {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Galería (carrusel scroll-snap) ===== */
.gallery-section .section-header {
    margin-bottom: 3rem;
}

.gallery-wrap {
    position: relative;
}

.gallery-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to left, var(--bg), transparent);
    pointer-events: none;
}

.gallery-track {
    display: flex;
    justify-content: safe center;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 1.5rem 1.5rem;
    scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    text-align: center;
}

.gallery-item .phone-frame {
    width: 240px;
    border-width: 6px;
    border-radius: 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.gallery-item figcaption {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.gallery-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .gallery-item .phone-frame {
        width: 260px;
    }
}

/* ===== FAQ ===== */
.faq-section {
    background: var(--cream);
    position: relative;
    padding-top: 7rem;
}

.faq-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.faq-section .section-header {
    margin-bottom: 3rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-list details {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #f3f4f6;
}

.faq-list summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 1.125rem;
    list-style: none;
    cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-icon {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

details[open] .faq-icon {
    transform: rotate(45deg);
}

.faq-list details p {
    color: var(--text-secondary);
    margin-top: 1rem;
    line-height: 1.6;
}

/* ===== Footer CTA ===== */
.footer-cta {
    background: var(--primary);
    padding: 5rem 1.5rem;
    text-align: center;
    color: var(--cream);
}

.footer-inner {
    max-width: 42rem;
    margin: 0 auto;
}

.footer-cta h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-cta > .footer-inner > p {
    margin-bottom: 2.5rem;
    opacity: 0.9;
    font-size: 1.125rem;
}

.footer-cta .store-badges {
    margin-bottom: 3rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 244, 225, 0.2);
    padding-top: 2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-copy {
    font-size: 0.875rem;
    opacity: 0.6;
}

@media (min-width: 768px) {
    .footer-cta h2 {
        font-size: 2.25rem;
    }
}

/* ===== Páginas secundarias (legales y 404) ===== */
.nav-inner--narrow {
    max-width: 64rem;
    margin: 0 auto;
}

.subnav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.subnav-links a {
    transition: color 0.15s ease;
}

.subnav-links a:hover {
    color: var(--primary);
}

.page-header {
    background: var(--surface);
    border-bottom: 1px solid #f3f4f6;
    padding: 3rem 1.5rem;
}

.page-header-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-header p {
    color: var(--text-secondary);
}

.page-main {
    padding: 3rem 1.5rem;
}

.page-main-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toc {
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.toc h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.toc ol {
    list-style: none;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.legal-content {
    padding: 2rem;
}

.legal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    line-height: 1.7;
}

.legal-content ul {
    list-style-type: disc;
}

.legal-content ol {
    list-style-type: decimal;
}

.legal-content ul li,
.legal-content ol li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--primary);
    text-decoration: underline;
}

.legal-content a:hover {
    opacity: 0.8;
}

.page-links {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2rem;
}

.page-links a:hover {
    text-decoration: underline;
}

.page-footer {
    background: var(--primary);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--cream);
}

.page-footer .brand-link {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: -0.025em;
}

.page-footer .footer-copy {
    margin-top: 1rem;
}

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    background: var(--cream);
}

.error-box {
    text-align: center;
    max-width: 32rem;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 120px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-box h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-box p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.button-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.button-primary:hover {
    background: var(--primary-dark);
}

@media (min-width: 768px) {
    .page-header h1 {
        font-size: 3rem;
    }

    .legal-content {
        padding: 3rem;
    }

    .error-code {
        font-size: 160px;
    }

    .error-box h1 {
        font-size: 2.25rem;
    }
}
