/* ════════════════════════════════════════════
   PÁGINA DE PRODUCTO
   ════════════════════════════════════════════ */

/* ── Layout principal ──
   padding-top viene de inline style en producto.php (PHP sabe si hay barra).
── */
.prod-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Breadcrumb ── */
.prod-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: #999;
  padding: 1.25rem 0 1.5rem;
}
.prod-breadcrumb a { color: #888; text-decoration: none; }
.prod-breadcrumb a:hover { color: #111; }
.prod-breadcrumb span:not(:last-child) { color: #ccc; }

/* ── Skeleton ── */
.prod-skeleton {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3.5rem;
  align-items: start;
  padding-bottom: 4rem;
}
.prod-skeleton-gallery { display: flex; flex-direction: column; gap: 1rem; }
.prod-skeleton-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.prod-skeleton-side { display: flex; flex-direction: column; padding-top: .5rem; }
.skel-block {
  background: #f0f0f0;
  border-radius: .75rem;
  animation: skel-pulse 1.4s ease-in-out infinite;
}
.skel-line {
  background: #f0f0f0;
  border-radius: .5rem;
  animation: skel-pulse 1.4s ease-in-out infinite;
  height: 14px;
  width: 100%;
}
@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ── Grid principal ── */
.prod-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3.5rem;
  align-items: stretch;
  padding-bottom: 5rem;
}

/* ── Galería 2×2 (estilo Adidas) ── */
.prod-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.prod-gallery-cell {
  aspect-ratio: 4/5;
  background: #f3f3f3;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}
.prod-gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .45s ease;
  display: block;
}
.prod-gallery-cell:hover img { transform: scale(1.04); }

/* ── Lightbox ── */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lb-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.lb-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
}
.lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  transition: transform .2s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-img.zoomed { cursor: zoom-out; }
.lb-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background .15s;
  z-index: 10000;
}
.lb-close:hover { background: rgba(255,255,255,.25); }
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background .15s;
  z-index: 10000;
}
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-nav.prev { left: 1.25rem; }
.lb-nav.next { right: 1.25rem; }
.lb-nav:disabled { opacity: .2; cursor: default; }
.lb-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  letter-spacing: .05em;
  z-index: 10000;
}
.prod-gallery-placeholder {
  font-size: 3.5rem;
  opacity: .12;
  user-select: none;
}

/* ── Sidebar ──
   El padre se estira a la misma altura que la galería (align-items:stretch en el grid).
   El inner es sticky y "viaja" mientras dure la galería, deteniéndose antes de relacionados.
── */
/* prod-sidebar se estira a la misma altura que la galería (align-items:stretch en prod-layout).
   prod-sidebar-inner viaja sticky dentro de ese espacio. */
.prod-sidebar { position: relative; }
.prod-sidebar-inner {
  position: sticky;
  top: 80px; /* sobreescrito por inline style PHP */
}

.prod-tag {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: #FF6B35;
  margin-bottom: .625rem;
}
.prod-name {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: #111;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.prod-price-row {
  display: flex;
  align-items: baseline;
  gap: .875rem;
  flex-wrap: wrap;
}
.prod-price {
  font-size: 1.625rem;
  font-weight: 800;
  color: #111;
}
.prod-price-note {
  font-size: .75rem;
  color: #999;
}

.prod-sep {
  height: 1px;
  background: #ebebeb;
  margin: 1.5rem 0;
}

/* ── Colores ── */
.prod-colors-section { margin-bottom: 1.5rem; }
.prod-colors {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-top: .5rem;
}
.color-swatch-btn:focus { outline: none; }

/* ── Tallas ── */
.prod-sizes-section { margin-bottom: 1.5rem; }
.prod-sizes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
}
.prod-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #888;
}
.prod-size-guide-btn {
  background: none;
  border: none;
  font-size: .78rem;
  color: #111;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.prod-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Override .size-btn para tema claro */
.size-btn {
  border-color: #ddd;
  color: #333;
  background: #fff;
  border-radius: .5rem;
  min-width: 54px;
  padding: .625rem .75rem;
  font-size: .85rem;
}
.size-btn:hover {
  border-color: #111;
  color: #111;
}
.size-btn.active {
  background: #111;
  border-color: #111;
  color: #fff;
}
.size-btn.out-of-stock {
  color: #ccc;
  border-color: #eee;
  background: #fafafa;
  text-decoration: line-through;
}

.prod-size-error {
  font-size: .8rem;
  color: #dc2626;
  margin-top: .5rem;
}

/* ── CTAs ── */
.prod-ctas {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.prod-btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #111;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background .15s, transform .12s;
}
.prod-btn-add svg { width: 18px; height: 18px; }
.prod-btn-add:hover { background: #222; transform: scale(1.01); }
.prod-btn-add:active { transform: scale(.99); }
.prod-btn-add:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.prod-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .875rem 1.5rem;
  background: transparent;
  color: #111;
  font-size: .85rem;
  font-weight: 600;
  border: 1.5px solid #ddd;
  border-radius: 9999px;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.prod-btn-outline:hover { border-color: #111; background: #f5f5f5; }

/* ── Acordeones ── */
.prod-accordions { display: flex; flex-direction: column; }
.prod-acc { border-bottom: 1px solid #ebebeb; }
.prod-acc:first-child { border-top: 1px solid #ebebeb; }
.prod-acc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
  color: #111;
  user-select: none;
}
.prod-acc-summary::-webkit-details-marker { display: none; }
.prod-acc-icon {
  width: 16px;
  height: 16px;
  color: #999;
  transition: transform .2s;
  flex-shrink: 0;
}
.prod-acc[open] .prod-acc-icon { transform: rotate(180deg); }
.prod-acc-body {
  padding-bottom: 1.25rem;
  font-size: .875rem;
  color: #666;
  line-height: 1.7;
}
.prod-acc-body p + p { margin-top: .5rem; }

.prod-shipping-list { display: flex; flex-direction: column; gap: .625rem; }
.prod-shipping-row {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .82rem;
  color: #555;
}
.prod-shipping-row svg { width: 15px; height: 15px; color: #999; flex-shrink: 0; }

/* ── Error ── */
.prod-error {
  text-align: center;
  padding: 6rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ── Productos relacionados ── */
.prod-related {
  border-top: 1px solid #ebebeb;
  padding: 3.5rem 0 5rem;
}
.prod-related-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #111;
  margin-bottom: 2rem;
}
.prod-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.prod-related-card {
  display: block;
  text-decoration: none;
  color: #111;
}
.prod-related-img {
  aspect-ratio: 3/4;
  background: #f5f5f5;
  border-radius: .875rem;
  overflow: hidden;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s ease;
}
.prod-related-card:hover .prod-related-img { transform: scale(1.01); }
.prod-related-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-related-tag { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #FF6B35; margin-bottom: .3rem; }
.prod-related-name { font-size: .9rem; font-weight: 600; color: #111; }
.prod-related-price { font-size: .9rem; font-weight: 700; color: #111; margin-top: .2rem; }

/* ── Footer de producto ── */
.prod-footer {
  border-top: 1px solid #ebebeb;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  font-size: .78rem;
  color: #bbb;
}
.prod-footer-logo {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #111;
}
.prod-footer-logo span { color: #FF6B35; }

/* ── Toast en página clara ── */
#toast {
  background: #111;
  border-color: rgba(255,107,53,.4);
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .prod-layout,
  .prod-skeleton {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .prod-sidebar-inner { position: static; }
  .prod-related-grid { grid-template-columns: repeat(2, 1fr); }
  .prod-gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .prod-main { padding: calc(var(--bar-h, 40px) + 70px) 0 0; }
  .prod-name { font-size: 1.5rem; }
  .prod-related-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .prod-gallery { gap: 2px; }
  .prod-sidebar { padding: 0 1rem; }

  /* Tallas más compactas en móvil */
  .size-btn { min-width: 44px; padding: .5rem .6rem; font-size: .8rem; }

  /* Breadcrumb más pequeño */
  .prod-breadcrumb { font-size: .72rem; padding: .75rem 1rem 1rem; }

  /* El grid de galería: 2 columnas igual que desktop pero sin sticky */
  .prod-gallery { grid-template-columns: 1fr 1fr; }

  /* Precio + nota en columna en pantallas muy pequeñas */
  .prod-price-row { flex-direction: column; gap: .25rem; }
}
