/* Components — Android / móvil estrecho (Pixel, Samsung, etc.) */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Móvil: un solo scrollport (html). No poner overflow-x en body: iOS crea scroll anidado. */
@media (max-width: 880px) {
  html {
    overflow-x: hidden;
    overflow-y: scroll;
    max-width: 100%;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }

  body {
    overflow: visible;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    overscroll-behavior-x: none;
  }

  main,
  .catalog-section,
  .catalog-section .container,
  .page-hero,
  .section {
    overflow: visible;
  }

  main,
  .site-header,
  .site-footer,
  .section,
  .hero,
  .page-hero,
  .game-page,
  .ia-app {
    max-width: 100%;
    min-width: 0;
  }

  .site-header {
    overflow: visible;
  }

  .container {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  :where(img, video, iframe, svg, canvas, picture, embed, object) {
    max-width: 100%;
  }

  .compare-page-form,
  .compare-page-form select,
  .compare-page-form .search-select-wrap,
  .game-check-row,
  .game-check-row select,
  .game-check-row .search-select-wrap,
  .compare-result,
  .compare-summary,
  .hero-grid,
  .hero-shell,
  .hero-metrics,
  .game-detail-head,
  .game-hero {
    min-width: 0;
    max-width: 100%;
  }

  .spec-table-card,
  .compare-spec-block .spec-table-card {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  pre,
  code,
  .req-html {
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
  }
}

.site-header {
  padding-top: env(safe-area-inset-top, 0px);
}

/* Header móvil: evitar choque logo ↔ Fuentes ↔ menú */
@media (max-width: 880px) {
  .site-header .container.header-inner {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .site-header .header-inner {
    gap: 6px 8px;
    min-height: 56px;
  }

  .site-header .logo {
    min-width: 0;
    overflow: hidden;
    flex-shrink: 1;
    padding: 2px 0;
  }

  .site-header .logo-gpu-mark {
    display: none !important;
  }

  .site-header .logo-wordmark {
    font-size: 0.72rem;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-header .logo-word-com,
  .site-header .logo-word-ponents {
    letter-spacing: 0.06em;
  }

  .site-header .header-end {
    flex-shrink: 0;
    gap: 6px;
    position: relative;
    z-index: 30;
    overflow: visible;
  }

  .site-header .header-actions {
    gap: 4px;
    z-index: 31;
    flex-shrink: 0;
    overflow: visible;
  }

  .site-header .lang-toggle {
    padding: 1px;
    flex-shrink: 0;
    position: relative;
    z-index: 32;
    overflow: visible;
  }

  .site-header .header-fuentes {
    display: none;
  }

  .site-header .nav-toggle {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    position: relative;
    z-index: 29;
  }

  .site-header .lang-btn {
    padding: 6px 8px;
    min-width: 32px;
    min-height: 32px;
    font-size: 0.68rem;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
  }
}

@media (min-width: 600px) and (max-width: 880px) {
  .site-header .header-fuentes {
    display: inline-flex;
    padding: 6px 9px;
    font-size: 0.65rem;
  }
}

@media (max-width: 420px) {
  .site-header .header-fuentes {
    display: none;
  }
}

/* Footer móvil — secciones ordenadas, sin desborde horizontal */
@media (max-width: 880px) {
  .site-footer {
    margin-top: 48px;
    padding: 32px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer .container {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 22px 18px;
    padding-bottom: 24px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
    padding-bottom: 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .footer-logo {
    margin-bottom: 10px;
  }

  .footer-tagline {
    max-width: none;
    font-size: 0.84rem;
    line-height: 1.55;
    margin-bottom: 14px;
  }

  .footer-social {
    margin-bottom: 12px;
  }

  .footer-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .footer-pill {
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.68rem;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
  }

  .footer-affiliates-note {
    margin-top: 14px;
    margin-bottom: 0;
  }

  .footer-col {
    min-width: 0;
  }

  .footer-col-title {
    margin-bottom: 10px;
    font-size: 0.68rem;
  }

  .footer-nav {
    gap: 8px;
  }

  .footer-nav a {
    font-size: 0.84rem;
    display: block;
    padding: 3px 0;
  }

  .footer-nav a:hover {
    transform: none;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .footer-col:last-child .footer-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 20px;
  }

  .footer-copy,
  .footer-affiliate {
    font-size: 0.78rem;
    line-height: 1.55;
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-col:last-child .footer-nav {
    grid-template-columns: 1fr;
  }

  .footer-pills {
    grid-template-columns: 1fr;
  }
}

/* Evita zoom al enfocar inputs en Chrome Android */
@media (max-width: 768px) {
  input,
  select,
  textarea,
  .search-select-input,
  .ia-composer-input {
    font-size: 16px !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav-link,
  .btn-primary,
  .btn-steam,
  .btn-epic,
  .btn-instant-gaming,
  .hero-shortcut,
  .lang-btn,
  .nav-toggle,
  .header-fuentes,
  .ia-composer-send,
  .ia-welcome-chip,
  .game-screenshot-btn {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.18);
  }

  .nav-link,
  .btn-primary,
  .hero-shortcut,
  .nav-toggle {
    min-height: 44px;
  }

  .site-header .lang-btn {
    min-height: 32px;
  }

  .ia-composer-send {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .site-header .header-inner {
    min-height: 56px;
    gap: 6px 6px;
  }

  .site-header .header-end {
    gap: 4px;
  }

  .site-header .header-actions {
    gap: 4px;
  }

  .site-header .lang-btn {
    min-width: 28px;
    padding: 5px 6px;
    font-size: 0.68rem;
    min-height: 0;
  }

  .site-header .nav-toggle {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .site-header.nav-open .main-nav {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .compare-page-form,
  .game-check-row {
    gap: 10px;
  }

  .compare-page-form select,
  .compare-page-form .search-select-wrap,
  .game-check-row .search-select-wrap,
  .game-check-row select {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .game-detail-head,
  .game-hero {
    padding: 18px 16px;
    margin-bottom: 20px;
    min-height: 150px;
  }

  .game-hero.has-banner,
  .game-detail-head.has-banner {
    min-height: 200px;
  }

  .game-hero-title {
    font-size: 1.32rem;
  }

  .game-meta-row {
    gap: 6px;
    margin: 10px 0 14px;
  }

  .game-meta-pill {
    font-size: 0.76rem;
    padding: 5px 10px;
  }

  .game-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .game-hero-actions .btn-steam,
  .game-hero-actions .btn-epic,
  .game-hero-actions .btn-instant-gaming {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .game-screenshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .req-box {
    padding: 14px;
  }

  .req-html {
    font-size: 0.82rem;
    overflow-wrap: anywhere;
  }

  .game-search-bar {
    padding: 14px;
  }

  .game-grid-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ia-page-body .site-header .header-fuentes {
    display: none;
  }

  .ia-app {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    min-height: calc(100dvh - 60px);
  }

  .ia-app-title {
    font-size: 1.05rem;
  }

  .ia-app-sub {
    font-size: 0.74rem;
  }

  .ia-pc-badge {
    max-width: min(100%, 180px);
  }

  .ia-msg-content {
    max-width: 92%;
  }

  .ia-composer {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .ia-composer-box {
    padding-left: 14px;
  }

  .ia-composer-note {
    font-size: 0.68rem;
    padding: 0 4px;
  }

  /* Compert IA: input fijo visible sobre teclado */
  .ia-page-body .ia-app {
    min-height: 100dvh;
    max-height: 100dvh;
    padding-bottom: 0;
  }

  .ia-page-body .ia-app-body {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }

  body.cookie-consent-active .ia-page-body .ia-app-body {
    padding-bottom: calc(108px + 50px + env(safe-area-inset-bottom, 0px));
  }

  body.keyboard-open .ia-page-body .ia-app-body,
  body.ia-composer-focused .ia-page-body .ia-app-body {
    padding-bottom: calc(108px + var(--vv-keyboard-offset, 0px));
  }

  .ia-page-body .ia-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 850;
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 8px max(12px, env(safe-area-inset-left, 0px))
      max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
    background: linear-gradient(180deg, rgba(10, 14, 23, 0) 0%, rgba(10, 14, 23, 0.94) 28%, rgba(10, 14, 23, 0.98) 100%);
    border-top: 1px solid var(--border);
    transition: bottom 0.12s ease-out;
  }

  body.cookie-consent-active:not(.keyboard-open):not(.ia-composer-focused) .ia-page-body .ia-composer {
    bottom: 50px;
  }

  body.keyboard-open .ia-page-body .ia-composer,
  body.ia-composer-focused .ia-page-body .ia-composer {
    bottom: var(--vv-keyboard-offset, 0px) !important;
  }

  body.keyboard-open .ia-page-body .ia-composer-note,
  body.ia-composer-focused .ia-page-body .ia-composer-note {
    display: none;
  }
}

@media (max-width: 768px) {
  .page-home {
    overflow-x: hidden;
  }

  .header-inner {
    min-height: 56px;
  }

  .page-home .hero {
    padding: 12px 0 32px;
  }

  .page-home .hero-shell {
    padding: 20px 16px 18px;
    border-radius: 18px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-home .hero-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    min-width: 0;
  }

  .page-home .hero-copy,
  .page-home .hero-tool {
    min-width: 0;
  }

  .page-home .hero-eyebrow {
    font-size: 0.65rem;
    padding: 4px 10px;
    margin-bottom: 10px;
  }

  .page-home .hero h1 {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
    line-height: 1.15;
    margin-bottom: 10px;
  }

  .page-home .hero-sub {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 16px;
    max-width: none;
  }

  .page-home .hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding: 4px 2px;
    gap: 0;
  }

  .page-home .hero-metric {
    min-width: 0;
    padding: 8px 2px;
    text-align: center;
  }

  .page-home .hero-metric strong {
    display: block;
    font-size: clamp(0.78rem, 3.2vw, 1.05rem);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-home .hero-metric span {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-home .hero-metric-divider {
    display: none;
  }

  .page-home .hero-metric:not(:last-child) {
    border-right: 1px solid var(--border);
  }

  .page-home .hero-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .page-home .hero-shortcut {
    justify-content: center;
    min-width: 0;
    padding: 9px 6px;
    font-size: 0.72rem;
    gap: 5px;
    text-align: center;
  }

  .page-home .hero-shortcut img {
    flex-shrink: 0;
  }

  .page-home .hero-tool .compare-widget {
    border: none;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: none;
    padding: 14px 12px 16px;
    border-radius: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-home .compare-widget-head {
    margin-bottom: 10px;
  }

  .page-home .compare-widget-title {
    font-size: 0.98rem;
  }

  .page-home .compare-widget-sub {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .page-home .compare-tabs {
    gap: 3px;
    padding: 3px;
    margin-bottom: 12px;
  }

  .page-home .tab {
    flex: 1;
    min-width: 0;
    padding: 10px 4px;
    font-size: 0.68rem;
    gap: 3px;
    min-height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-home .tab-icon {
    flex-shrink: 0;
  }

  .page-home .tab-icon-gpu {
    width: 20px;
    max-height: 11px;
  }

  .page-home .tab-icon-cpu {
    width: 14px;
    max-height: 14px;
  }

  .page-home .compare-form {
    gap: 8px;
  }

  .page-home .compare-form .vs-badge {
    padding: 2px 10px;
    font-size: 0.78rem;
  }

  .page-home .compare-form .search-select-wrap,
  .page-home .compare-form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-home .compare-form .btn-primary {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
  }

  .spec-table-card,
  .compare-spec-block .spec-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 4px;
  }

  .spec-table {
    min-width: 520px;
  }

  .compare-page .spec-table {
    min-width: 0;
  }

  .compare-page .spec-table-card {
    overflow-x: visible;
  }

  .mipc-page .container,
  .detector-page .container,
  .games-page .container {
    overflow-x: hidden;
  }
}

@media (max-width: 380px) {
  .page-home .hero-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-home .hero-shortcut-compert {
    grid-column: span 2;
  }

  .page-home .tab {
    font-size: 0;
    gap: 0;
  }

  .page-home .tab .tab-icon {
    width: auto;
    max-height: 16px;
  }
}

@media (max-width: 360px) {
  .logo-word-com,
  .logo-word-ponents {
    letter-spacing: 0.05em;
  }

  .game-grid-catalog {
    grid-template-columns: 1fr;
  }
}

