/* ═══════════════════════════════════════════
   MG Digital — CSS Compartido (styles.css)
   ═══════════════════════════════════════════ */

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

:root {
    --primary: #4F46E5;
    --primary-soft: #818CF8;
    --primary-bg: #EEF2FF;
    --mint: #34D399;
    --mint-bg: #ECFDF5;
    --peach: #FB923C;
    --peach-bg: #FFF7ED;
    --rose: #F472B6;
    --rose-bg: #FDF2F8;
    --sky: #38BDF8;
    --sky-bg: #F0F9FF;
    --lavender: #A78BFA;
    --lavender-bg: #F5F3FF;
    --title: #1E293B;
    --text: #475569;
    --text-light: #64748B;
    --border: #E2E8F0;
    --surface: #F8FAFC;
    --white: #FFFFFF;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--title);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    height: 62px;
}

.logo svg { height: 62px; width: auto; }

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a.active-link { color: var(--primary); font-weight: 700; }

.nav-links a.nav-cta {
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-links a.nav-cta:hover {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--title);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ─── PAGE HEADER ─── */
.page-header {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(160deg, #F8FAFC 0%, var(--primary-bg) 35%, #F5F3FF 65%, var(--white) 100%);
}

.section-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.tag-purple { background: var(--primary-bg); color: var(--primary); }
.tag-mint { background: var(--mint-bg); color: #059669; }

.page-header h1 {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--title);
    margin-bottom: 1rem;
}

.page-header h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── CTA SECTION ─── */
.cta-section {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #F5F3FF 50%, var(--mint-bg) 100%);
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--title);
    margin-bottom: 0.75rem;
}

.cta-section p {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 0.9rem 1.8rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}
.btn-primary:hover {
    background: #4338CA;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.3);
}

.btn-wa {
    background: #25D366;
    color: #fff;
    padding: 0.9rem 1.8rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}
.btn-wa:hover {
    background: #20BD5A;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.3);
}

/* ─── FOOTER ─── */
footer {
    background: var(--title);
    color: var(--text-light);
    padding: 3rem 2rem 2rem;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.footer-brand-mini .logo { display: inline-flex; margin-bottom: 0.5rem; }
.footer-brand-mini .logo svg { height: 28px; }

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.3s;
}
.footer-links a:hover { color: var(--white); }

.footer-legal { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.footer-legal a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.3s;
}
.footer-legal a:hover { color: var(--white); }

.social-links { display: flex; gap: 0.75rem; }

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.8rem;
    color: var(--text-light);
    transition: all 0.3s;
}
.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ─── BOTÓN FLOTANTE WHATSAPP ─── */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4), 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: waPulse 2.5s ease-in-out infinite;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 32px; height: 32px; fill: #fff; }
.wa-tooltip {
    position: absolute;
    right: 72px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--title);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-family: 'Inter', sans-serif;
}
.wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--title);
    border-right: none;
}
.whatsapp-float:hover .wa-tooltip { opacity: 1; }
@keyframes waPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.4), 0 0 0 0 rgba(37,211,102,0.3); }
    50% { box-shadow: 0 4px 16px rgba(37,211,102,0.4), 0 0 0 12px rgba(37,211,102,0); }
}

/* ─── RESPONSIVE BASE ─── */
@media (max-width: 640px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1.5rem 2rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.06);
        gap: 1rem;
    }
    .page-header { padding: 7rem 1.5rem 3rem; }
    .page-header h1 { font-size: 1.8rem; }
    .page-header p { font-size: 0.95rem; }
    .cta-section { padding: 3.5rem 1.5rem; }
    .cta-section h2 { font-size: 1.5rem; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .cta-buttons a { text-align: center; justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    .whatsapp-float { bottom: 18px; right: 18px; width: 56px; height: 56px; }
    .whatsapp-float svg { width: 28px; height: 28px; }
    .wa-tooltip { display: none; }
}

/* ─── BOTTOM TAB BAR (móvil) ─── */
.bottom-tab-bar { display: none; }
@media (max-width: 640px) {
    .bottom-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 800;
        background: rgba(255,255,255,0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
        justify-content: space-around;
        align-items: center;
        padding: 8px 4px env(safe-area-inset-bottom, 10px);
    }
    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        min-width: 54px;
        min-height: 44px;
        padding: 6px 0;
    }
    .tab-item svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .tab-item span {
        font-size: 11px;
        font-weight: 600;
        color: #64748B;
        font-family: 'Inter', sans-serif;
    }
    .tab-item.active span { color: #4F46E5; }
    .tab-item.active svg { color: #4F46E5; }
    .tab-item svg { color: #64748B; }
    .tab-cta { margin-top: -18px; }
    .tab-cta .tab-circle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #4F46E5;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(79,70,229,0.35);
    }
    .tab-cta .tab-circle svg { color: #fff !important; width: 24px; height: 24px; }
    .tab-cta span { color: #4F46E5 !important; }
    .whatsapp-float { bottom: 82px !important; }
    body { padding-bottom: 72px; }
}

/* ─── PROMO LANZAMIENTO ─── */
.promo-launch {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    position: relative;
    overflow: hidden;
}
.promo-launch::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(79,70,229,0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(52,211,153,0.1) 0%, transparent 50%);
    pointer-events: none;
}
.promo-launch-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}
.promo-launch-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #34D399;
    border: 1px solid rgba(52,211,153,0.3);
    background: rgba(52,211,153,0.08);
    margin-bottom: 1.5rem;
}
.promo-launch h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}
.promo-launch-sub {
    font-size: 1.05rem;
    color: #94A3B8;
    line-height: 1.7;
    margin-bottom: 2rem;
}
.promo-launch-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1.5rem;
    text-align: left;
    max-width: 520px;
    margin: 0 auto 2.5rem;
}
.plf-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #CBD5E1;
    font-size: 0.92rem;
    font-weight: 500;
}
.promo-launch-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.promo-launch-note {
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 500;
}
@media (max-width: 640px) {
    .promo-launch-features { grid-template-columns: 1fr; }
    .promo-launch { padding: 3rem 1.5rem; }
}

/* ─── VIEW TRANSITIONS (navegación entre páginas) ─── */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: fadeSlideOut 0.25s ease-in forwards;
}
::view-transition-new(root) {
    animation: fadeSlideIn 0.3s ease-out forwards;
}

@keyframes fadeSlideOut {
    to { opacity: 0; transform: translateY(-8px); }
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SCROLL-DRIVEN ANIMATIONS (elementos que aparecen al scroll) ─── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    animation: revealUp 0.6s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-32px);
    animation: revealFromLeft 0.6s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
}

.reveal-right {
    opacity: 0;
    transform: translateX(32px);
    animation: revealFromRight 0.6s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    animation: revealScale 0.5s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
}

@keyframes revealUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes revealFromLeft {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes revealFromRight {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes revealScale {
    to { opacity: 1; transform: scale(1); }
}

/* ─── MICRO-INTERACCIONES ─── */
.btn-primary,
.btn-wa,
.nav-links a.nav-cta {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-wa::after,
.nav-links a.nav-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-primary:hover::after,
.btn-wa:hover::after,
.nav-links a.nav-cta:hover::after {
    transform: translateX(100%);
}

.social-link {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.social-link:hover {
    transform: translateY(-3px) scale(1.08);
}

.tab-cta .tab-circle {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.tab-cta:active .tab-circle {
    transform: scale(0.92);
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    @view-transition { navigation: none; }
}
