/**
 * Rediseño de la ficha de juego (single-game) — mobile y desktop.
 *
 * Restyle de las clases EXISTENTES del shortcode [game_details] y del
 * template: no cambia ningún markup con lógica de compra (.buy-with-wallet y
 * su JS quedan intactos). Se encola después de style.css, así que gana en
 * cascada sin !important salvo contra estilos inline heredados.
 */

:root {
  --gc-bg: #f5f6fa;
  --gc-surface: #ffffff;
  --gc-ink: #0f172a;
  --gc-ink-soft: #475569;
  --gc-ink-mute: #94a3b8;
  --gc-line: #e2e8f0;
  --gc-brand: #4f46e5;
  --gc-brand-2: #7c3aed;
  --gc-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --gc-green: #059669;
  --gc-green-bg: #ecfdf5;
  --gc-amber: #f59e0b;
  --gc-red: #dc2626;
  --gc-radius: 16px;
  --gc-radius-sm: 10px;
  --gc-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .07);
  --gc-shadow-lift: 0 4px 8px rgba(15, 23, 42, .06), 0 16px 40px rgba(15, 23, 42, .12);
}

body.single-game {
  background: var(--gc-bg);
  color: var(--gc-ink);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────── Contenedor y migas ─────────────────────────── */

.single-game .game-detail-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px clamp(14px, 3vw, 28px) 48px;
}

.single-game .game-breadcrumb {
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--gc-ink-mute);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.single-game .game-breadcrumb a {
  color: var(--gc-ink-soft);
  text-decoration: none;
}

.single-game .game-breadcrumb a:hover {
  color: var(--gc-brand);
}

.single-game .game-single-content {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* ─────────────────────────────── Cabecera ───────────────────────────────── */

.single-game .game-header {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: clamp(18px, 3vw, 32px);
  margin-bottom: 22px;
}

.single-game .game-image {
  position: sticky;
  top: 96px;
  border-radius: var(--gc-radius-sm);
  overflow: hidden;
  background: #0b1020;
}

.single-game .game-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform .5s ease;
}

.single-game .game-image:hover img {
  transform: scale(1.03);
}

.single-game .game-info {
  min-width: 0;
}

.single-game .game-info h1 {
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--gc-ink);
  margin: 0 0 14px;
}

/* Precio + stock */

.single-game .price-tag {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 18px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--gc-ink);
}

.single-game .price-tag .woocommerce-Price-amount {
  background: var(--gc-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.single-game .stock {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 6px 12px;
  border-radius: 999px;
}

.single-game .stock.in-stock {
  color: var(--gc-green);
  background: var(--gc-green-bg);
  border: 1px solid #a7f3d0;
}

.single-game .stock.in-stock::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gc-green);
  margin-right: 7px;
  vertical-align: 1px;
}

/* Compra */

.single-game .buy-button-container {
  margin: 6px 0 4px;
}

.single-game .buy-with-wallet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  padding: 16px 28px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--gc-grad);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.single-game .buy-with-wallet::before {
  content: "\f0e7"; /* rayo Font Awesome: entrega instantánea */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 15px;
}

.single-game .buy-with-wallet:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(99, 102, 241, .45);
  filter: brightness(1.05);
}

.single-game .buy-with-wallet[disabled] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.single-game .wallet-balance {
  margin-top: 10px;
  font-size: 14px;
  color: var(--gc-ink-soft);
  text-align: left;
}

.single-game .login-required {
  margin: 6px 0;
  padding: 14px 18px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--gc-radius-sm);
  font-size: 15px;
  color: var(--gc-ink-soft);
}

.single-game .login-required a {
  color: var(--gc-brand);
  font-weight: 700;
  text-decoration: none;
}

/* Franja de confianza bajo el botón (la pinta el template) */

.single-game .gc-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 2px;
  padding-top: 16px;
  border-top: 1px solid var(--gc-line);
  font-size: 13.5px;
  color: var(--gc-ink-soft);
}

.single-game .gc-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.single-game .gc-trust-row i {
  color: var(--gc-brand);
  font-size: 14px;
}

/* ─────────────── TOC: de caja rota a chips de navegación ────────────────── */

.single-game .toc-container {
  background: transparent;
  border: none;
  padding: 0;
  margin: 6px 0 20px;
}

.single-game .toc-title {
  display: none;
}

.single-game .toc-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 4px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.single-game .toc-list::-webkit-scrollbar {
  display: none;
}

.single-game .toc-list li {
  margin: 0;
  flex: 0 0 auto;
}

.single-game .toc-list a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  color: var(--gc-ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s ease;
}

.single-game .toc-list a:hover {
  border-color: var(--gc-brand);
  color: var(--gc-brand);
  background: #eef2ff;
}

/* ──────────────────────── Secciones de contenido ────────────────────────── */

.single-game .seo-description,
.single-game .game-video-section,
.single-game .game-specs,
.single-game .game-faq {
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 22px;
}

.single-game .game-single-content h2 {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--gc-ink);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gc-line);
  position: relative;
}

.single-game .game-single-content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--gc-grad);
}

.single-game .seo-description p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--gc-ink-soft);
  margin: 0;
}

.single-game .video-container {
  position: relative;
  border-radius: var(--gc-radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0b1020;
}

.single-game .video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Specs */

.single-game .specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.single-game .spec-item {
  background: var(--gc-bg);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  padding: 14px 16px;
  transition: border-color .15s ease;
}

.single-game .spec-item:hover {
  border-color: #c7d2fe;
}

.single-game .spec-item h4 {
  margin: 0 0 6px;
}

.single-game .spec-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gc-ink-mute);
}

.single-game .spec-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--gc-ink);
  text-decoration: none;
  word-break: break-word;
}

.single-game a.spec-value:hover {
  color: var(--gc-brand);
}

.single-game .official-website-link {
  color: var(--gc-ink-mute);
  font-size: 12px;
  margin-left: 4px;
}

.single-game .official-website-link:hover {
  color: var(--gc-brand);
}

/* FAQ */

.single-game .faq-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.single-game .faq-item {
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  overflow: hidden;
  background: var(--gc-surface);
}

.single-game .faq-question {
  margin: 0;
}

.single-game .faq-question button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: var(--gc-ink);
}

.single-game .faq-question button:hover {
  color: var(--gc-brand);
}

.single-game .toggle-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--gc-brand);
  font-weight: 700;
  transition: transform .2s ease;
}

.single-game .faq-question button[aria-expanded="true"] .toggle-icon {
  transform: rotate(45deg);
}

.single-game .faq-answer {
  padding: 0 18px 16px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--gc-ink-soft);
}

.single-game .faq-answer[aria-hidden="true"] {
  display: none;
}

/* ─────────────────────────── Relacionados ───────────────────────────────── */

.single-game .game-related {
  margin-top: 34px;
  padding-top: 0;
  border-top: none;
}

.single-game .game-related h3 {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 800;
  color: var(--gc-ink);
  margin-bottom: 18px;
  padding-bottom: 12px;
}

.single-game .related-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.single-game .related-game {
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  overflow: hidden;
  box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.single-game .related-game:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: var(--gc-shadow-lift);
}

.single-game .related-game img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.single-game .related-game h4 {
  margin: 12px 14px 4px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--gc-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.single-game .related-price {
  margin: 0 14px 14px;
  font-size: 17px;
  font-weight: 800;
  color: var(--gc-brand);
}

/* ─────────────────────────────── Reviews ────────────────────────────────── */

.single-game .reviews-section {
  max-width: 1200px !important;
  margin: 34px auto 0 !important;
  padding: 0 clamp(14px, 3vw, 28px);
}

.single-game .rating-summary {
  background: var(--gc-surface) !important;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius) !important;
  box-shadow: var(--gc-shadow);
}

.single-game .review-card {
  border: 1px solid var(--gc-line);
  box-shadow: var(--gc-shadow) !important;
  border-radius: var(--gc-radius-sm) !important;
}

.single-game .add-review {
  background: var(--gc-surface) !important;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius) !important;
  box-shadow: var(--gc-shadow);
}

.single-game .add-review textarea {
  min-height: 110px;
  resize: vertical;
  font: inherit;
}

.single-game .add-review button[type="submit"] {
  background: var(--gc-grad) !important;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}

.single-game .add-review button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(99, 102, 241, .35);
}

/* ─────────────────────────────── Móvil ──────────────────────────────────── */

@media (max-width: 860px) {
  .single-game .game-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .single-game .game-image {
    position: static;
    max-width: 340px;
    margin: 0 auto;
  }

  .single-game .game-image img {
    aspect-ratio: 16 / 10;
  }

  .single-game .game-info h1 {
    text-align: left;
  }

  .single-game .buy-with-wallet {
    max-width: none;
  }

  .single-game .specs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-game .related-games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-game .related-game img {
    height: 140px;
  }

  .single-game .rating-summary > div {
    flex-direction: column;
    gap: 1.25rem !important;
  }
}

@media (max-width: 480px) {
  .single-game .specs-grid {
    grid-template-columns: 1fr;
  }

  .single-game .related-games-grid {
    gap: 10px;
  }

  .single-game .related-game h4 {
    font-size: 13px;
  }

  .single-game .related-price {
    font-size: 15px;
  }
}
