/* ================================================================
   UNIVERSAL RESPONSIVE POLISH v2
   Aplicado a todas las páginas. Previene overflow horizontal,
   normaliza márgenes, asegura tap targets, ajusta hero sizes.
   ================================================================ */

/* === HARD STOP: nada debe causar scroll horizontal === */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

/* Imágenes, videos, embeds — nunca exceden viewport */
img, video, iframe, svg, canvas, picture, object, embed {
  max-width: 100%;
}
img, video {
  height: auto;
}

/* === Tablet (601-1024) === */
@media (min-width: 601px) and (max-width: 1024px) {
  .container,
  .nav-inner,
  .topnav,
  .admin-nav-inner {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  section { padding-top: 80px !important; padding-bottom: 80px !important; }
  .hero { padding-top: 60px !important; padding-bottom: 88px !important; }

  section h2 { font-size: clamp(28px, 4.2vw, 44px) !important; }

  .services-grid,
  .speakers-grid:not(.has-scroll) { grid-template-columns: 1fr 1fr !important; }

  .btn, .btn-primary, .btn-ghost, .cta, .cta-ghost {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* === Mobile (≤600) === */
@media (max-width: 600px) {
  /* Cualquier container/section/main respeta viewport */
  .container, .nav-inner, .topnav, .admin-nav-inner,
  main, section, header, footer,
  article, aside {
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Hero: nunca min-height 100vh en mobile (deja hueco gigante) */
  .hero {
    min-height: auto !important;
  }
  .hero .container { padding-bottom: 40px !important; }

  /* Tap targets */
  button:not(.icon-btn):not(.hamburger):not(.pf):not(.tab):not(.filter):not(.chip):not(.atab):not(.cmd-item):not(.cp-swatch):not(.range-btn):not(.set-nav):not(.atab),
  a.btn, a.cta, a.cta-ghost,
  .btn-primary, .btn-ghost,
  .topnav-btn, .contact-btn,
  input[type="submit"] {
    min-height: 44px;
  }

  /* Form inputs cómodos */
  .form-grid input, .form-grid select, .form-grid textarea,
  .contact-form input, .contact-form textarea,
  #login-form input {
    min-height: 44px;
    font-size: 16px !important; /* Prevent iOS zoom on focus */
  }

  /* Section padding compacto */
  section { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* Footer apila siempre */
  .footer-inner {
    flex-direction: column !important;
    gap: 14px !important;
    text-align: center !important;
  }

  /* Reduce el copyright bar */
  body > div[style*="© 2026"] {
    font-size: 9px !important;
    letter-spacing: 1.2px !important;
    padding: 10px 8px !important;
  }
  body > div[style*="© 2026"] strong {
    letter-spacing: 2px !important;
  }

  /* H-scroll containers: contenidos en viewport */
  [class*="-grid"][style*="overflow-x"],
  .testimonios-grid, .services-grid:not(.serv-grid),
  .speakers-grid, .agenda-days, .testimonios-wall,
  .grid, .product-grid, .gallery {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* === Mobile chico (≤400) === */
@media (max-width: 400px) {
  section { padding-top: 40px !important; padding-bottom: 40px !important; }
  section h2 { font-size: clamp(22px, 5.5vw, 28px) !important; }
  .container, .nav-inner, .topnav {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Hero titles más controlados */
  .hero-title, .hero h1 {
    font-size: clamp(34px, 9vw, 56px) !important;
    letter-spacing: -1px !important;
  }
}

/* === Touch hover fix: cards no se quedan "pegadas" después de tap === */
@media (hover: none) {
  .card:hover, .product:hover, .speaker:hover, .feature:hover,
  .service-card:hover, .testimonio:hover, .te:hover,
  .day:hover, .integ-card:hover, .why-stat:hover,
  .sec-card:hover, .anim-tilt:hover, .anim-3d:hover,
  .serv:hover, .plan:hover, .trabajos-cta:hover,
  .gallery-item:hover img {
    transform: none !important;
  }
}

/* === Focus states accesibles === */
*:focus-visible {
  outline: 2px solid var(--primary, #7c5cff);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus, a:focus, input:focus, select:focus, textarea:focus {
  outline: none;
}

/* ================================================================
   PER-PAGE TWEAKS — fixes específicos donde sé que rompe
   ================================================================ */

/* SIR landing — hero gradient orbs no overflow */
@media (max-width: 600px) {
  .bg-orb { width: 400px !important; height: 400px !important; }
  .orb1 { left: -150px !important; top: -150px !important; }
  .orb2 { right: -150px !important; }
}

/* 01 Landing pro — hero-card no rompe en chico */
@media (max-width: 600px) {
  .hero-card {
    position: static !important;
    margin: 14px auto 0 !important;
    max-width: 100% !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }
  .hero-image { margin-top: 24px; }
  .hero-photo { aspect-ratio: 4/4 !important; }
}

/* 02 Evento — hero sin min-height 100vh + image hidden */
@media (max-width: 900px) {
  .hero[class*=""] {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .hero-image[class] {
    display: none !important;
  }
}
@media (max-width: 600px) {
  .countdown {
    width: 100%;
  }
  .countdown div {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 8px 2px !important;
  }
  .countdown strong { font-size: clamp(18px, 6vw, 26px) !important; }
  .countdown span { font-size: 9px !important; }

  .inscripcion-card {
    grid-template-columns: 1fr !important;
    padding: 24px 18px !important;
    gap: 24px !important;
  }
  .inscripcion-card h2 { font-size: clamp(26px, 7vw, 38px) !important; }
}

/* 03 Menú — galería mobile-friendly */
@media (max-width: 600px) {
  .galeria-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
  }
  .g1 { grid-column: 1 / -1 !important; aspect-ratio: 16/10; }
  .tabs { gap: 1px !important; padding: 3px !important; }
  .tab { padding: 8px 6px !important; font-size: 10px !important; }
  .topnav-links { padding: 0 !important; }
}

/* 04 Fotógrafa — intro + FILTROS visibles sin scroll oculto */
@media (max-width: 700px) {
  /* Filtros TODOS visibles, envuelven en 2 filas si hace falta */
  .filters-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .filters {
    overflow-x: visible !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .filter {
    flex-shrink: 0 !important;
    padding: 7px 13px !important;
    font-size: 12px !important;
  }
  .year-select-wrap {
    justify-content: space-between !important;
    width: 100% !important;
    font-size: 12px !important;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .result-count { flex: 1 1 100%; text-align: center; font-size: 11px !important; }
}
@media (max-width: 600px) {
  .intro {
    padding: 100px 18px 40px !important;
  }
  .intro h1 {
    font-size: clamp(34px, 9vw, 50px) !important;
    line-height: 1.05 !important;
  }
  .intro p { font-size: 11px !important; }
  .nav { padding: 12px 16px !important; }
  .filters-wrap { top: 56px !important; padding: 12px 14px !important; }
  .gallery { padding: 16px 14px 24px !important; }
  .gallery-item { flex: 0 0 82vw !important; }
  .about, .contacto { padding: 56px 18px !important; }
  .about-text h2 { font-size: clamp(28px, 8vw, 40px) !important; margin-bottom: 18px !important; }
  .about-text p { font-size: 15px !important; }
  .contacto h2 { font-size: clamp(32px, 9vw, 44px) !important; }
  .contacto p { font-size: 12px !important; margin-bottom: 32px !important; }
  /* Email del contacto: word-break para que NUNCA salga */
  .mail {
    font-size: clamp(18px, 5.5vw, 28px) !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
  .socials { gap: 22px !important; margin-top: 36px !important; }
  .socials a { font-size: 11px !important; }
  .footer {
    padding: 20px 18px !important;
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
    font-size: 10px !important;
  }
}
@media (max-width: 400px) {
  .filter { font-size: 11px !important; padding: 6px 10px !important; }
}

/* 05 Blog — cats nav visible (wrap en vez de scroll oculto) */
@media (max-width: 700px) {
  .cats-inner {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px 10px !important;
    width: auto !important;
    padding: 10px 16px !important;
  }
  .cat-link, .cats-inner a {
    font-size: 11px !important;
    flex-shrink: 0 !important;
    padding: 4px 8px !important;
  }
}

/* 05 Blog — featured + article mobile */
@media (max-width: 600px) {
  .masthead-grid {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    padding: 12px 16px !important;
    gap: 8px !important;
  }
  .logo { font-size: clamp(32px, 8vw, 44px) !important; }
  .masthead-nav, .date {
    justify-content: center !important;
    text-align: center !important;
  }
  .featured {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 32px 0 !important;
  }
  .featured-img { aspect-ratio: 16/10 !important; }
  .featured h1 { font-size: clamp(26px, 7vw, 36px) !important; line-height: 1.15 !important; }
  .article-wrap {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 40px 0 60px !important;
  }
  .article-title { font-size: clamp(28px, 8vw, 42px) !important; }
  .article-body p { font-size: 16px !important; line-height: 1.6 !important; }
  .article-body h3 { font-size: clamp(20px, 6vw, 26px) !important; }
  blockquote { font-size: clamp(16px, 5vw, 20px) !important; padding: 14px 18px !important; }
  .share-bar { padding: 14px 0 !important; gap: 6px !important; }
  .share-bar > span { width: 100% !important; }
  .author-card { flex-direction: column !important; }
}

/* 06 Tienda — cart drawer y modales en mobile */
@media (max-width: 600px) {
  .nav-inner { padding: 12px 14px !important; gap: 8px !important; }
  .nav-actions { gap: 6px; }
  .wish-btn, .cart-btn { padding: 0 10px !important; font-size: 12px; }
  .hero h1 { font-size: clamp(30px, 9vw, 48px) !important; }
  .cart, #wishlist { width: 100vw !important; max-width: 100vw !important; }
  .cart-head, .cart-foot { padding: 18px 20px !important; }
  .cart-body { padding: 14px 20px !important; }
  .product-filters { gap: 5px !important; }
  .pf { padding: 6px 11px !important; font-size: 11px !important; }
  .pm-info { padding: 22px 18px !important; }
  .pm-info h3 { font-size: clamp(20px, 6vw, 28px) !important; }
  .pm-price { font-size: clamp(24px, 7vw, 32px) !important; }
  .pm-checkout { padding: 24px 18px !important; }
}

/* 07 SaaS — sections compactas */
@media (max-width: 600px) {
  .hero { padding: 40px 0 60px !important; }
  .hero-title { font-size: clamp(36px, 10vw, 64px) !important; letter-spacing: -2px !important; }
  .hero-sub { font-size: 15px !important; }
  .video-cta {
    flex-direction: column !important;
    padding: 16px !important;
    border-radius: 16px !important;
    text-align: center;
  }
  .vp-play { margin: 0 auto; }
  .video-cta strong, .video-cta span { text-align: center !important; }
  .logos-row { gap: 8px !important; }
  .logo-pill { font-size: 11px !important; padding: 6px 12px !important; }
  .roi-card { grid-template-columns: 1fr !important; border-radius: 14px !important; }
  .roi-controls, .roi-result { padding: 22px 18px !important; }
  .roi-result strong#roi-saving { font-size: clamp(36px, 11vw, 56px) !important; }
  .compare-table { font-size: 12px !important; border-radius: 12px !important; }
  .ct-row { padding: 11px 14px !important; }
  .security-grid { gap: 12px !important; }
  .sec-card { padding: 22px 18px !important; }
  .plans { gap: 14px !important; }
  .plan { padding: 26px 22px !important; }
  .plan-featured { transform: none !important; }
  .cta-inner { flex-direction: column !important; text-align: center; }
}

/* 08 Dashboard — sidebar y modales */
@media (max-width: 600px) {
  .main { padding: 60px 14px 50px !important; }
  .topbar h1 { font-size: 20px !important; }
  .topbar p { font-size: 11px !important; }
  .search { min-width: 0 !important; flex: 1 !important; padding: 6px 10px !important; }
  .search input { font-size: 14px !important; }
  .btn-primary { font-size: 11px !important; padding: 7px 12px !important; }
  .kpi { padding: 14px !important; }
  .kpi strong { font-size: clamp(20px, 7vw, 28px) !important; }
  .card { padding: 14px !important; }
  .card h3 { font-size: 14px !important; }
  .chart-card canvas { height: 180px !important; }
  .cal-day { min-height: 50px !important; padding: 4px !important; font-size: 10px; }
  .cal-day > span { font-size: 10px !important; }
  .cal-weekday { font-size: 9px !important; padding: 6px 0 !important; }
  .ev { font-size: 8px !important; padding: 1px 3px !important; }
  .settings { grid-template-columns: 1fr !important; }
  .settings-nav { flex-direction: row !important; overflow-x: auto; gap: 4px; position: relative !important; top: 0 !important; }
  .set-nav { flex-shrink: 0; padding: 8px 12px !important; font-size: 12px !important; white-space: nowrap; }
  .inbox { grid-template-columns: 1fr !important; min-height: 480px !important; }
  .inbox-list { max-height: 200px !important; }
}

/* 09 Kanban — topbar y columnas */
@media (max-width: 600px) {
  .topbar { padding: 10px 12px !important; gap: 8px !important; }
  .top-left, .top-right { gap: 6px !important; }
  .logo { font-size: 14px !important; }
  .divider { display: none; }
  .board-picker { flex: 1; min-width: 0 !important; padding: 6px 10px !important; font-size: 12px !important; }
  .icon-btn { width: 30px !important; height: 30px !important; font-size: 13px !important; }
  #search { flex: 1 1 100% !important; padding: 6px 10px !important; font-size: 12px !important; }
  .filter-group { width: 100% !important; gap: 4px !important; }
  .mini-select { flex: 1; padding: 6px !important; font-size: 11px !important; }
  .btn-primary { padding: 6px 10px !important; font-size: 11px !important; }
  .back-link { display: none !important; }
  .board { padding: 12px !important; gap: 10px !important; }
  .column { flex: 0 0 78vw !important; max-width: 320px; padding: 8px !important; }
  .task { padding: 8px !important; }
}

/* === Page-mount fade override: avoid double-animation === */
@media (prefers-reduced-motion: reduce) {
  body { animation: none !important; }
}
