/* ============================================
   TECNO JOSS — Optimizado para móvil Chrome
   ============================================ */

:root {
    --accent:  #38bdf8;
    --accent2: #818cf8;
    --accent3: #34d399;
    --bg:      #03060f;
    --glass:   rgba(8, 18, 40, 0.85);
    --border:  rgba(56, 189, 248, 0.18);
    --text:    #f0f4ff;
    --muted:   #64748b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', system-ui, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Crea contexto de apilamiento sin coste extra */
    isolation: isolate;
}

/* =====================
   FONDO — sin animación CSS continua
   Solo 2 orbs. JS los mueve en scroll con translate (no filter en movimiento)
   ===================== */
.bg-glow {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none; overflow: hidden;
    /* Capa propia de composición para que no repinte el resto */
    will-change: transform;
}
.glow-orb {
    position: absolute; border-radius: 50%;
    /* blur solo en la capa de composición — no se repinta en scroll */
    will-change: transform;
    /* Sin animación CSS aquí — movimiento manejado por JS con rAF */
}
.glow-1 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(56,189,248,0.45), transparent 70%);
    filter: blur(60px);
    top: -70px; left: -50px;
}
.glow-2 {
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(129,140,248,0.4), transparent 70%);
    filter: blur(55px);
    bottom: 20%; right: -40px;
}

/* =====================
   BARRA DE SCROLL
   ===================== */
.scroll-bar {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 3px; z-index: 999;
    background: rgba(255,255,255,0.05);
    /* Promovemos a capa propia para que solo ella se repinte */
    will-change: auto;
}
.scroll-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 0 2px 2px 0;
    /* transform en lugar de width para evitar layout */
    transform-origin: left;
    will-change: width;
}

/* =====================
   MODELO 3D
   ===================== */
.canvas-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%; height: 55vh;
    z-index: 1;
    /* Capa propia — el modelo 3D ya usa WebGL, aislarlo evita repaints */
    will-change: transform;
    contain: strict;
}
model-viewer {
    width: 100%; height: 100%;
    --poster-color: transparent;
}

/* =====================
   NAV
   ===================== */
.glass-nav {
    position: fixed; top: 0; left: 0;
    width: 100%; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100;
    /* En móvil quitamos backdrop-filter — es el mayor asesino de FPS */
    background: rgba(3,6,15,0.92);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: background 0.3s;
    /* Promover capa propia */
    will-change: background;
}
.glass-nav.scrolled { background: rgba(3,6,15,0.95); }
/* Solo activamos backdrop-filter en desktop donde la GPU puede manejarlo */
@media (min-width: 768px) {
    .glass-nav {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(3,6,15,0.6);
    }
}

.logo {
    font-family: 'Syne', system-ui, sans-serif;
    font-weight: 800; font-size: 17px; letter-spacing: 3px;
}
.logo span { color: var(--accent); }

.nav-pill {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 500;
    color: var(--accent3);
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.25);
    padding: 5px 11px; border-radius: 100px;
}
.live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent3);
    /* Usar opacity en lugar de scale para animar — más barato */
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* =====================
   SECCIONES
   ===================== */
main { position: relative; z-index: 2; }

.scroll-section {
    min-height: 100vh;
    display: flex; align-items: flex-start;
    padding: 70px 20px 20px;
    position: relative;
    /* contain: layout evita que cambios internos fuercen reflow global */
    contain: layout;
}

.hero-section {
    padding-top: 72px;
    padding-bottom: calc(55vh + 10px);
}

/* =====================
   HERO
   ===================== */
.hero-content {
    width: 100%;
    opacity: 0; transform: translateY(20px);
    /* GPU-friendly: solo opacity y transform */
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}
.hero-content.visible {
    opacity: 1; transform: translateY(0);
    /* Limpiar will-change una vez termina la animación */
    will-change: auto;
}

.badge-top {
    display: inline-block;
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--border);
    background: rgba(56,189,248,0.08);
    padding: 5px 12px; border-radius: 100px;
    margin-bottom: 16px;
}

.hero-title {
    font-family: 'Syne', system-ui, sans-serif;
    font-size: clamp(40px, 11vw, 80px);
    font-weight: 800; line-height: 1;
    margin-bottom: 14px;
    display: flex; flex-direction: column;
}
.hero-title .accent-word {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub { font-size: 15px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.stat-pill {
    font-size: 11px; padding: 6px 12px; border-radius: 100px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    /* Sin backdrop-filter aquí — usamos fondo semitransparente simple */
    white-space: nowrap;
}

.scroll-hint {
    font-size: 12px; color: var(--muted); display: block;
    /* Solo translateY — sin opacity para reducir recomposición */
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* =====================
   TARJETAS
   Solo el vidrio donde importa, sin blur en móvil
   ===================== */
.glass-card {
    background: var(--glass);
    padding: 28px 24px;
    border-radius: 24px;
    /* Sin backdrop-filter en móvil */
    border: 1px solid var(--border);
    max-width: 360px; width: 100%;
    opacity: 0; transform: translateY(36px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
    position: relative; overflow: hidden;
    /* contain evita repaints que se propagan al padre */
    contain: layout paint;
}
/* En desktop sí activamos el blur */
@media (min-width: 768px) {
    .glass-card {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(8,18,40,0.75);
    }
}

.glass-card::before {
    content: '';
    position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56,189,248,0.4), transparent);
}
.glass-card.visible {
    opacity: 1; transform: translateY(0);
    will-change: auto;
}
.glass-card.left   { margin-right: auto; }
.glass-card.right  { margin-left: auto; }
.glass-card.center { margin: 0 auto; }

.feature-icon {
    font-size: 26px; margin-bottom: 14px; display: block;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-family: 'Syne', system-ui, sans-serif;
    font-size: clamp(26px, 6.5vw, 38px);
    font-weight: 800; line-height: 1.05;
    margin-bottom: 12px; color: #fff;
}
p { font-size: 14px; color: var(--muted); line-height: 1.7; }

.feature-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.feature-list li { font-size: 13px; color: rgba(240,244,255,0.7); }

/* =====================
   VISUALIZADOR AUDIO
   Sin gradiente — color sólido en móvil es más rápido
   ===================== */
.audio-visualizer {
    display: flex; align-items: flex-end; gap: 4px;
    height: 44px; margin-top: 20px;
}
.audio-visualizer span {
    flex: 1; background: var(--accent2);
    border-radius: 3px; min-height: 5px;
    animation: audioBar 1.2s ease-in-out infinite;
    will-change: transform;
    /* Animamos con scaleY en vez de height — evita layout thrashing */
    transform-origin: bottom;
}
.audio-visualizer span:nth-child(1){animation-delay:.00s}
.audio-visualizer span:nth-child(2){animation-delay:.15s}
.audio-visualizer span:nth-child(3){animation-delay:.30s}
.audio-visualizer span:nth-child(4){animation-delay:.05s}
.audio-visualizer span:nth-child(5){animation-delay:.20s}
.audio-visualizer span:nth-child(6){animation-delay:.35s}
.audio-visualizer span:nth-child(7){animation-delay:.10s}
.audio-visualizer span:nth-child(8){animation-delay:.25s}
/* scaleY en lugar de height — compositor puro, 0 layout cost */
@keyframes audioBar {
    0%,100% { transform: scaleY(0.15); opacity: 0.5; }
    50%      { transform: scaleY(1);    opacity: 1; }
}

/* =====================
   ANILLO BATERÍA
   ===================== */
.battery-ring { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.ring-fill {
    fill: none; stroke: url(#ringGrad); stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314; stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.6s cubic-bezier(0.4,0,0.2,1);
    will-change: stroke-dashoffset;
}
.ring-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-num { font-family: 'Syne', system-ui, sans-serif; font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.ring-sub  { font-size: 10px; color: var(--muted); text-align: center; margin-top: 2px; }

/* =====================
   PRECIO Y CTA
   ===================== */
.price-block { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 16px; flex-wrap: wrap; }
.price-label { font-size: 12px; color: var(--muted); }
.price-amount {
    font-family: 'Syne', system-ui, sans-serif; font-size: 34px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent3), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.buy-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; border: none; padding: 17px 24px; border-radius: 14px;
    font-family: 'Syne', system-ui, sans-serif; font-weight: 700; font-size: 15px;
    cursor: pointer;
    /* Solo transform en active, no box-shadow — el shadow es caro en móvil */
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    /* Tamaño mínimo táctil recomendado por Google: 48px */
    min-height: 48px;
}
.buy-btn:active { transform: scale(0.97); }
.btn-arrow { font-size: 18px; }
.buy-note { font-size: 11px; text-align: center; margin-top: 12px; color: rgba(100,116,139,0.8); }

/* =====================
   FOOTER — sin backdrop-filter en móvil
   ===================== */
.footer-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 100;
    background: rgba(3,6,15,0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 11px; color: var(--muted);
}
@media (min-width: 768px) {
    .footer-bar {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        background: rgba(3,6,15,0.65);
    }
}
.footer-link { color: var(--accent); text-decoration: none; }

/* =====================
   BOTÓN FLOTANTE WHATSAPP
   ===================== */
.wa-float {
    position: fixed;
    bottom: 72px; right: 20px;
    z-index: 200;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.wa-float:hover  { transform: scale(1.08); }
.wa-float:active { transform: scale(0.94); }

/* Pulso de atención — llama la vista sin ser molesto */
.wa-float::after {
    content: '';
    position: absolute;
    inset: 0; border-radius: 50%;
    background: rgba(37,211,102,0.45);
    animation: waPulse 2.5s ease-out infinite;
    z-index: -1;
}
@keyframes waPulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* =====================
   TABLET / DESKTOP
   ===================== */
@media (min-width: 768px) {
    .canvas-container { height: 100vh; bottom: auto; top: 0; }
    .hero-section { padding-top: 80px; padding-bottom: 40px; align-items: center; }
    .scroll-section { padding: 80px 8% 40px; }
    .glass-card { max-width: 420px; padding: 36px 32px; }
    .hero-title { font-size: clamp(50px, 8vw, 90px); }
    .stat-pill { font-size: 12px; }
        }
@media (min-width: 1024px) {
    .canvas-container { width: 50%; left: 50%; }
    .glass-card.left  { margin-right: 0; }
    .glass-card.right { margin-left: 0; margin-right: auto; }
}

/* =====================
                               REDUCE MOTION — respeta configuración del SO
   ===================== */
@media (prefers-reduced-motion: reduce) {
    .live-dot, .scroll-hint, .audio-visualizer span { animation: none; }
    .hero-content, .glass-card { transition: none; opacity: 1; transform: none; }
}