/* ============================================================================
   pdp.css — Product Detail Popup (mini landing por producto)
   ============================================================================ */

.pdp {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.pdp.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pdp__overlay {
  position: absolute;
  inset: 0;
  background: var(--a-ink-48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.pdp__panel {
  position: relative;
  background: var(--surface);
  border: var(--border-emphasis);
  max-width: 840px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-raised);
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

.pdp__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--t-14);
  color: var(--text-tertiary);
  padding: var(--s-2);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
  z-index: 10;
  line-height: 1;
}

.pdp__close:hover { color: var(--text-primary); }

/* Layout 2 columnas */
.pdp__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

/* ── Galería ─────────────────────────────────────────────────────────────── */

.pdp__gallery {
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
}

.pdp__slides {
  flex: 1;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.pdp__slide {
  position: absolute;
  inset: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}

.pdp__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Imagen principal dentro del slide */
.pdp__slide img {
  max-height: 88%;
  max-width: 68%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
  position: static;
  top: auto;
  left: auto;
  transform: none;
  opacity: 1 !important;
  filter: drop-shadow(0 8px 32px rgba(26, 23, 20, 0.10));
}

/* Slide legal (advertencias) */
.pdp__slide--legal {
  flex-direction: column;
  gap: var(--s-3);
  background: var(--surface);
}

.pdp__slide--legal img {
  max-width: 80%;
  max-height: 70%;
}

.pdp__gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-top: var(--border-hairline);
  flex-shrink: 0;
}

.pdp__gallery-btn {
  width: var(--s-7);
  height: var(--s-7);
  border: var(--border-emphasis);
  border-radius: var(--r-circle);
  font-size: var(--t-14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tr-color);
}

.pdp__gallery-btn:hover {
  background: var(--interactive-bg-hover);
  color: var(--interactive-fg-hover);
  border-color: var(--interactive-bg-hover);
}

.pdp__gallery-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pdp__dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pdp__dot {
  width: 5px;
  height: 5px;
  border-radius: var(--r-circle);
  background: var(--a-ink-24);
  transition: width var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-radius var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.pdp__dot.is-active {
  background: var(--accent-primary);
  width: 14px;
  border-radius: 3px;
}

/* ── Info ────────────────────────────────────────────────────────────────── */

.pdp__info {
  padding: var(--s-7) var(--s-6);
  padding-right: var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  border-left: var(--border-hairline);
}

.pdp__tag {
  color: var(--accent-primary);
}

.pdp__name {
  font-size: var(--t-fluid-h2);
  line-height: var(--lh-tight);
}

.pdp__format {
  color: var(--text-tertiary);
  margin-top: calc(var(--s-2) * -1);
}

.pdp__price {
  font-family: var(--font-display);
  font-size: var(--t-fluid-h3);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-h3);
  color: var(--text-primary);
  font-variation-settings: 'opsz' 144;
}

.pdp__desc {
  font-size: var(--t-16);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  border-top: var(--border-hairline);
  padding-top: var(--s-4);
}

/* Acciones: al final del info */
.pdp__actions {
  margin-top: auto;
  padding-top: var(--s-5);
  border-top: var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.pdp__actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.pdp__buy {
  width: 100%;
  justify-content: space-between;
  padding-block: var(--s-3);
}

body.pdp-open { overflow: hidden; }


/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .pdp {
    padding: 0;
    align-items: flex-end;
  }

  .pdp__panel {
    max-height: 94vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .pdp__inner {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .pdp__slides {
    aspect-ratio: 1 / 1;
  }

  .pdp__info {
    border-left: 0;
    border-top: var(--border-hairline);
    padding: var(--s-5);
  }

  .pdp__actions-row {
    flex-wrap: wrap;
  }
}
