/* =============================================
   MEJORES ROBOTS ASPIRADORES — PREMIUM CRO v1
   Mobile-First | Alta Conversión | Afiliados Amazon
   ============================================= */

/* 1. VARIABLES */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.12);
  --border-glow: rgba(99, 102, 241, 0.30);
  --amazon: #f59e0b;
  --amazon-hover: #d97706;
  --amazon-glow: rgba(245, 158, 11, 0.30);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --green: #22c55e;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.07);
  --shadow-hover: 0 10px 36px rgba(99,102,241,0.18);
  --shadow-cta: 0 4px 18px rgba(245,158,11,0.35);
  --transition: 0.22s ease;
}

/* 2. RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text-main); background: var(--bg-main); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* 3. LAYOUT */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* 4. HEADER */
.site-header { background: rgba(255,255,255,0.95); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; box-shadow: 0 1px 14px rgba(0,0,0,0.06); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 62px; gap: 16px; }
.logo-text { font-size: 1.15rem; font-weight: 900; color: var(--text-main); }
.logo-text span { color: var(--primary); }
.nav-links { display: none; gap: 4px; align-items: center; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a { color: var(--text-main); font-weight: 500; font-size: 0.88rem; padding: 6px 11px; border-radius: 8px; transition: background var(--transition), color var(--transition); }
.nav-links a:hover, .nav-links a.active { background: var(--primary-glow); color: var(--primary-dark); }
.header-trust { display: none; background: #ede9fe; color: #4338ca; font-size: 0.72rem; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
@media (min-width: 1040px) { .header-trust { display: inline-flex; align-items: center; gap: 5px; } }
.hamburger { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; background: none; border: 1.5px solid var(--border); cursor: pointer; padding: 6px; border-radius: 8px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text-main); border-radius: 2px; transition: all 0.3s ease; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 768px) { .hamburger { display: none; } }
.mobile-nav { display: none; flex-direction: column; gap: 2px; padding: 10px 16px 14px; border-top: 1px solid var(--border); background: white; }
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--text-main); font-weight: 500; font-size: 0.9rem; padding: 10px 12px; border-radius: 8px; }
.mobile-nav a:hover { background: var(--primary-glow); }

/* 5. HERO */
.hero { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%); color: white; padding: 64px 0 56px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 60% 40%, rgba(99,102,241,0.25) 0%, transparent 70%); pointer-events: none; }
.hero-tag { display: inline-block; background: rgba(99,102,241,0.25); border: 1px solid rgba(99,102,241,0.5); color: #a5b4fc; font-size: 0.72rem; font-weight: 700; padding: 5px 14px; border-radius: 20px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 900; line-height: 1.2; margin-bottom: 16px; }
.hero h1 span { color: #a5b4fc; }
.hero-sub { font-size: 1rem; color: #cbd5e1; max-width: 560px; margin: 0 auto 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-badge { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; font-size: 0.82rem; font-weight: 600; padding: 8px 16px; border-radius: 30px; transition: background var(--transition); }
.hero-badge:hover { background: rgba(99,102,241,0.35); color: white; }

/* 6. TRUST BAR */
.trust-bar { background: white; border-bottom: 1px solid var(--border); padding: 12px 0; }
.trust-bar-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; align-items: center; }
.trust-item { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.trust-item strong { color: var(--text-main); }
.ti-icon { color: var(--green); font-weight: 700; }
.trust-sep { color: var(--border); display: none; }
@media (min-width: 768px) { .trust-sep { display: inline; } }

/* 7. SECTIONS */
.section { padding: 56px 0; }
.section-white { background: white; }
.section-gray { background: var(--bg-main); }
.section-header { text-align: center; margin-bottom: 36px; }
.section-title { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 900; margin-bottom: 10px; }
.section-sub { color: var(--text-muted); font-size: 0.95rem; max-width: 520px; margin: 0 auto; }

/* 8. PRODUCT CARDS */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card { background: white; border: 2px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--transition), border-color var(--transition); position: relative; }
.product-card:hover { box-shadow: var(--shadow-hover); border-color: var(--primary); }
.card-winner { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.card-top-badge { display: block; text-align: center; font-size: 0.68rem; font-weight: 800; padding: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.tb-indigo { background: var(--primary); color: white; }
.tb-yellow { background: #fef3c7; color: #92400e; }
.tb-light { background: #f1f5f9; color: #475569; }
.card-img-wrap { height: 180px; display: flex; align-items: center; justify-content: center; padding: 20px; background: #f8fafc; }
.card-img-wrap img { max-height: 140px; object-fit: contain; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.card-name { font-size: 1.05rem; font-weight: 800; color: var(--text-main); }
.card-type-tag { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.card-score-row { display: flex; align-items: center; gap: 12px; }
.score-num { font-size: 2rem; font-weight: 900; color: var(--primary); line-height: 1; }
.score-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; display: block; }
.score-stars { font-size: 0.78rem; color: var(--amazon); }
.card-specs { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-spec { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 6px 0; border-bottom: 1px solid var(--border); }
.spec-label { color: var(--text-muted); font-weight: 600; }
.spec-val { font-weight: 700; color: var(--text-main); }
.spec-val.green { color: #16a34a; }
.spec-val.indigo { color: var(--primary); }
.card-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* 9. BUTTONS */
.btn-amazon { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--amazon); color: #0f172a; font-weight: 800; font-size: 0.88rem; padding: 13px 18px; border-radius: var(--radius); transition: background var(--transition), box-shadow var(--transition); box-shadow: var(--shadow-cta); border: none; cursor: pointer; }
.btn-amazon:hover { background: var(--amazon-hover); color: #0f172a; box-shadow: 0 6px 24px rgba(245,158,11,0.45); }
.btn-secondary { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--primary-glow); color: var(--primary-dark); font-weight: 700; font-size: 0.85rem; padding: 11px 16px; border-radius: var(--radius); border: 1.5px solid var(--border-glow); transition: background var(--transition); }
.btn-secondary:hover { background: rgba(99,102,241,0.2); }

/* 10. COMPARISON TABLE */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.compare-table { width: 100%; border-collapse: collapse; background: white; font-size: 0.88rem; }
.compare-table thead th { background: var(--text-main); color: white; padding: 14px 16px; text-align: left; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.compare-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.compare-table tbody tr:hover { background: var(--primary-glow); }
.compare-table td { padding: 14px 16px; vertical-align: middle; }
.table-prod { display: flex; align-items: center; gap: 10px; }
.table-prod-name { font-weight: 700; font-size: 0.88rem; display: block; }
.table-prod-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 2px; }
.tpb-nocable { background: #ede9fe; color: #4338ca; }
.tpb-cable { background: #f0fdf4; color: #166534; }
.score-pill { background: var(--primary-glow); color: var(--primary-dark); font-weight: 800; padding: 4px 10px; border-radius: 8px; font-size: 0.85rem; }
.table-cta { background: var(--amazon); color: #0f172a; font-weight: 700; font-size: 0.78rem; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.table-cta:hover { background: var(--amazon-hover); color: #0f172a; }

/* 11. FAQ */
.faq-section .accordion { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.acc-item { background: white; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.acc-trigger { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: none; border: none; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--text-main); text-align: left; gap: 12px; }
.acc-trigger:hover { background: var(--primary-glow); }
.acc-body { display: none; padding: 0 20px 16px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }
.acc-item.open .acc-body { display: block; }
.acc-icon { flex-shrink: 0; transition: transform 0.22s ease; }
.acc-item.open .acc-icon { transform: rotate(180deg); }

/* 12. CTA BLOCK */
.cta-block { background: linear-gradient(135deg, #1e1b4b, #312e81); color: white; border-radius: var(--radius-lg); padding: 48px 32px; text-align: center; }
.cta-block h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 900; margin-bottom: 12px; }
.cta-block p { color: #c7d2fe; margin-bottom: 24px; font-size: 0.95rem; }

/* 13. FOOTER */
.site-footer { background: var(--text-main); color: #94a3b8; padding: 28px 0 20px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-copy { font-size: 0.82rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { font-size: 0.82rem; color: #94a3b8; }
.footer-links a:hover { color: white; }
.footer-disclaimer { font-size: 0.75rem; color: #64748b; line-height: 1.6; border-top: 1px solid #1e293b; padding-top: 16px; }

/* 14. MOBILE — CORRECCIONES CRÍTICAS (360px+)
   ─────────────────────────────────────────────
   90% tráfico móvil (TikTok). Prioridad máxima.
   ──────────────────────────────────────────── */

/* ── Scroll táctil fluido en TODAS las tablas ── */
.table-wrapper,
.ficha-tecnica,
.vs-mini,
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Indicador visual de scroll horizontal en iOS */
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Ancho mínimo para que las tablas no colapsen en columnas */
.ficha-tecnica table,
.vs-mini table,
.compare-table {
  min-width: 480px;
}

/* Hint de scroll — sombra derecha cuando hay contenido oculto */
.table-wrapper,
.ficha-tecnica,
.vs-mini {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(to right, white 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
    radial-gradient(farthest-side at 0 50%, rgba(99,102,241,0.12), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(99,102,241,0.12), transparent) 0 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

/* ── Word-break global: evita truncamiento en 360px ── */
body {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Selectores específicos con mayor prioridad donde más duele */
.card-name,
.card-spec,
.spec-val,
.table-prod-name,
.ficha-tecnica td,
.acc-trigger,
.acc-body,
.prose p,
.prose h2,
.review-title,
.guide-title {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Fechas, modelos y valores técnicos largos */
.score-pill,
.review-tag,
.guide-tag,
.card-top-badge {
  word-break: normal; /* los badges no deben partirse */
  white-space: normal;
}

/* ── Grids: min-width: 0 evita overflow en flex/grid ── */
.header-inner > * { min-width: 0; }
.card-body        { min-width: 0; }
.review-layout > * { min-width: 0; }
.guide-layout > *  { min-width: 0; }
.pros-cons > *     { min-width: 0; }

/* ── Padding reducido en móvil ── */
@media (max-width: 767px) {
  .section      { padding: 36px 0; }
  .container    { padding: 0 16px; }
  .cta-block    { padding: 32px 20px; }
  .hero         { padding: 40px 0 36px; }

  /* Hero review y guías */
  .review-hero  { padding: 32px 0 28px; }
  .guide-hero   { padding: 36px 0 30px; }

  /* Logo: evita desbordamiento en 360px */
  .logo-text    { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

  /* Accordion: texto más cómodo en pantalla pequeña */
  .acc-trigger  { font-size: 0.88rem; padding: 14px 16px; }
  .acc-body     { font-size: 0.85rem; padding: 0 16px 14px; }

  /* Ficha técnica: celdas más compactas */
  .ficha-tecnica td { padding: 9px 12px; font-size: 0.82rem; }
  .ficha-tecnica th { padding: 10px 12px; font-size: 0.76rem; }

  /* Tabla comparativa global */
  .compare-table td,
  .compare-table thead th { padding: 10px 12px; font-size: 0.8rem; }

  /* vs-mini tabla */
  .vs-mini td,
  .vs-mini thead th { padding: 9px 12px; font-size: 0.8rem; }

  /* Product cards de guías */
  .product-cards { grid-template-columns: 1fr !important; }

  /* Score en hero: más pequeño para que quepa */
  .score-hero .score-big { font-size: 2.4rem; }
}

/* ── CTA STICKY MOBILE — barra fija en el footer ────────
   En escritorio: columna derecha sticky.
   En móvil: barra fija abajo, solo elementos de conversión.
   Padding-bottom en main para que el contenido no quede
   tapado por la barra fija.
   ───────────────────────────────────────────────────── */

/* Reserva espacio en el contenido para la barra fija */
@media (max-width: 900px) {
  main.section { padding-bottom: 88px; }
}

/* La barra fija de conversión — solo visible en móvil */
.mobile-cta-bar {
  display: none; /* oculto en escritorio */
}

@media (max-width: 900px) {
  /* Ocultar el CTA lateral — reemplazado por la barra fija */
  .sticky-cta {
    display: none;
  }

  /* Mostrar la barra fija */
  .mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: white;
    border-top: 2px solid var(--primary);
    padding: 10px 16px 12px;
    /* safe-area-inset para iPhone con notch inferior */
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 10px;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(99,102,241,0.15);
  }

  .mobile-cta-bar .mcta-info {
    flex: 1;
    min-width: 0;
  }

  .mobile-cta-bar .mcta-model {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-cta-bar .mcta-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.1;
  }

  .mobile-cta-bar .mcta-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--amazon);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-cta);
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition);
  }

  .mobile-cta-bar .mcta-btn:hover,
  .mobile-cta-bar .mcta-btn:active {
    background: var(--amazon-hover);
    color: #0f172a;
  }

  /* Score badge junto al precio */
  .mobile-cta-bar .mcta-score {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
  }
}

/* ── Reveal: sin animación en móvil (performance) ── */
@media (max-width: 767px) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── 14. REVEAL ANIMATIONS */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }

/* 15. UPDATED CHIP */
.updated-chip { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }

/* ══ SHIMMER — destello de luz en botones Amazon ══════════════
   Un rayo blanco translúcido barre el botón cada 3s.
   CSS-only, sin JS, sin repaint de layout. Reduce-motion safe.
   ══════════════════════════════════════════════════════════ */
.btn-amazon,
.mcta-btn {
  position: relative;
  overflow: hidden;
}

.btn-amazon::after,
.mcta-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.38) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: shimmer-sweep 3s ease-in-out infinite;
  pointer-events: none;
}

.mcta-btn::after {
  animation-delay: 1.5s;
}

@keyframes shimmer-sweep {
  0%   { left: -75%; opacity: 0; }
  10%  { opacity: 1; }
  50%  { left: 130%; opacity: 1; }
  51%  { opacity: 0; }
  100% { left: 130%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-amazon::after,
  .mcta-btn::after { animation: none; }
}

/* ══ OVERRIDE CRÍTICO: ficha-tecnica y vs-mini — scroll táctil ══
   Los <style> locales de los HTML de análisis definen overflow:hidden
   que gana en cascada. !important lo neutraliza sin tocar cada HTML.
   ══════════════════════════════════════════════════════════════ */
.ficha-tecnica,
.vs-mini {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Hyphens en contenido largo — previene overflow en 320px */
body,
.card-name, .card-spec, .spec-val,
.table-prod-name, .ficha-tecnica td,
.acc-trigger, .acc-body,
.prose p, .prose h2,
.review-title, .guide-title {
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Footer: evitar que la barra fija tape el disclaimer en móvil */
@media (max-width: 900px) {
  .site-footer {
    padding-bottom: calc(20px + 80px);
  }
}

