/* ─── detail.css — CuriosVault ──────────────────────────── */

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.2rem 2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.breadcrumb-bar a { color: var(--muted); transition: color 0.18s; }
.breadcrumb-bar a:hover { color: var(--accent2); }
.bc-sep { color: var(--border); }
.bc-current { color: var(--text); font-weight: 600; }

/* ── Loading / Error ─────────────────────────────────────── */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 1rem;
  color: var(--muted);
}
.detail-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
  padding: 2rem;
  gap: 0.75rem;
}
.detail-error-icon { font-size: 3.5rem; }
.detail-error h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}
.detail-error p { color: var(--muted); font-size: 0.95rem; }

/* ── Page wrapper ────────────────────────────────────────── */
.detail-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem 5rem;
  animation: fadeUp 0.3s ease both;
}

/* ── Main 2-column layout ────────────────────────────────── */
/*    Left: info + actions  |  Right: image gallery mosaic   */
.detail-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  margin-top: 1.75rem;
  align-items: start;
}

/* ── LEFT column ─────────────────────────────────────────── */
.detail-body {
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin: 0.6rem 0 1.4rem;
}

/* Download / purchase buttons */
.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.detail-download-btn {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  font-size: 0.95rem;
  padding: 0.85rem 1.2rem;
}
.detail-purchase-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--btn-radius);
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  text-decoration: none;
}
.detail-purchase-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(187,45,98,0.06);
}

/* Sections */
.detail-section { margin-bottom: 1.75rem; }
.detail-section-label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.detail-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.75;
}

/* Info card */
.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.75rem;
}
.sidebar-label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.86rem;
}
.info-grid dt { color: var(--muted); font-weight: 500; white-space: nowrap; }
.info-grid dd { color: var(--text); font-weight: 600; text-align: right; }

/* Feature list */
.detail-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.detail-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.detail-feature-list li::before {
  content: "•";
  color: var(--accent2);
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 0.05em;
}

/* Changelog */
.detail-changelog { display: flex; flex-direction: column; gap: 0.55rem; }
.changelog-entry {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}
.changelog-version {
  background: var(--accent3);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Store links */
.store-links { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1.75rem; }
.store-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.store-link:hover {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(187,45,98,0.1);
}
.store-link i { color: var(--accent2); width: 1.1em; text-align: center; }

/* Back link */
.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}
.detail-back-link:hover { color: var(--accent2); }

/* ─────────────────────────────────────────────────────────────
   RIGHT column: IMAGE GALLERY
   
   Layout con screenshots[]:
     [0] = grande arriba, ancho completo
     [1] = abajo izquierda  (mitad del ancho)
     [2] = abajo derecha    (mitad del ancho)
     [3]+ = extras, de a 2 por fila
   
   Visualmente (igual que la referencia):
   ┌─────────────────────────┐
   │          [0]            │
   │     (grande, top)       │
   ├─────────────┬───────────┤
   │    [1]      │    [2]   │
   ├─────────────┼───────────┤
   │    [3]      │    [4]   │
   └─────────────┴───────────┘
──────────────────────────────────────────────────────────────*/
.detail-gallery {
  position: sticky;
  top: calc(var(--nav-h, 64px) + 1.25rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

/* Base style for every gallery cell */
.gal-item {
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  cursor: zoom-in;
  display: block;
  border-radius: 0;
}
.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease, filter 0.25s;
}
.gal-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.82);
}

/* Zoom icon hint */
.gal-item::after {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1.3rem;
  color: rgba(255,255,255,0.9);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.gal-item:hover::after { opacity: 1; }

/* ── [0] solo: un único screenshot ────────────────────── */
.gal-solo {
  grid-column: 1 / span 2;
  aspect-ratio: 16 / 8;
}

/* ── [0] con 2 imgs: arriba full-width ─────────────────── */
.gal-main-2 {
  grid-column: 1 / span 2;
  aspect-ratio: 16 / 8;
}
/* [1] debajo izquierda (mitad) */
.gal-pair-2 {
  grid-column: 1;
  aspect-ratio: 4 / 2.5;
}

/* ── [0] con 3+ imgs: arriba full-width ─────────────────── */
.gal-main {
  grid-column: 1 / span 2;
  aspect-ratio: 16 / 8;
}
/* [1] abajo izquierda */
.gal-sec-a {
  grid-column: 1;
  aspect-ratio: 4 / 2.5;
}
/* [2] abajo derecha */
.gal-sec-b {
  grid-column: 2;
  aspect-ratio: 4 / 2.5;
}
/* [3+] extras — de a 2 por fila */
.gal-extra {
  aspect-ratio: 4 / 2.5;
}

/* Overlay "+N" en el último visible si hay más */
.gal-more::after { display: none !important; }
.gal-more::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.gal-more:hover::before { background: rgba(0,0,0,0.38); }

/* ── LIGHTBOX ─────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.lightbox-img {
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.7);
  transition: transform 0.25s;
  transform: scale(0.97);
}
.lightbox-overlay.open .lightbox-img { transform: scale(1); }

.lightbox-btn {
  position: absolute;
  background: rgba(255,255,255,0.14);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.28); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Related section ─────────────────────────────────────── */
.detail-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.related-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Force related cards to match new card style */
.detail-related .products-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem 1.25rem;
}
.detail-related .card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.detail-related .card-thumb-wrap {
  border-radius: 10px;
  overflow: hidden;
}
.detail-related .card-thumb {
  height: 140px;
  aspect-ratio: unset;
}
.detail-related .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.detail-related .card-body {
  padding: 0.55rem 0.15rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.detail-related .card-title {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-bottom: 0.15rem;
}
/* Ocultar estilos viejos en related */
.detail-related .card-tags      { display: none !important; }
.detail-related .card-meta      { display: none !important; }
.detail-related .platform-links { display: none !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .detail-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .detail-gallery {
    position: static;
    order: -1;
    border-radius: var(--radius);
  }
  .detail-title { font-size: 1.9rem; }
}
@media (max-width: 600px) {
  .detail-wrapper { padding: 1rem 1.25rem 3rem; }
  .breadcrumb-bar { padding: 0.75rem 1.25rem 0; font-size: 0.78rem; }
  .detail-title { font-size: 1.5rem; }
  .detail-actions { flex-direction: column; }
  .detail-download-btn,
  .detail-purchase-btn { flex: unset; width: 100%; }
  .detail-related .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
  }
  .detail-related .card-thumb { height: 110px; }
}
