/* ===========================================================================
   Ficha de producto — estructura mobile-first para editor manual
   =========================================================================== */

.pdp {
  min-height: 100vh;
  min-width: 0;
  padding: clamp(1rem, 4vw, 2.5rem) 1rem calc(7rem + env(safe-area-inset-bottom));
  background:
    radial-gradient(760px 420px at 8% 0%, rgba(90, 180, 233, 0.16), transparent 64%),
    linear-gradient(180deg, #050709 0%, #070b12 58%, #050709 100%);
}

.pdp [hidden] {
  display: none !important;
}

.pdp__container,
.pdp__layout,
.pdp__media,
.pdp__info,
.pdp__details,
.pdp__content-section {
  min-width: 0;
}

.pdp__container {
  width: min(100%, 1200px);
  margin: 0 auto;
}

/* ---------- Ruta ---------- */

.pdp__breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.pdp__breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.pdp__breadcrumb a:hover {
  color: var(--accent);
}

.pdp__breadcrumb a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.pdp__breadcrumb-sep {
  opacity: 0.55;
}

/* ---------- Layout ---------- */

.pdp__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "media"
    "info"
    "details";
  gap: 1rem;
}

.pdp__media { grid-area: media; }
.pdp__info { grid-area: info; }
.pdp__details { grid-area: details; }

/* ---------- Imagen ---------- */

.pdp__media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(250px, 78vw, 380px);
  margin: 0;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  overflow: hidden;
  border: 1px solid rgba(90, 180, 233, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 48%, rgba(90, 180, 233, 0.16), transparent 64%),
    linear-gradient(145deg, rgba(17, 25, 36, 0.96), rgba(8, 12, 18, 0.98));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

.pdp__media::after {
  position: absolute;
  right: 10%;
  bottom: 8%;
  left: 10%;
  height: 12%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  filter: blur(18px);
  content: "";
}

.pdp__img {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  height: clamp(225px, 68vw, 350px);
  object-fit: contain;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.5));
}

/* ---------- Panel de compra ---------- */

.pdp__info {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.15rem, 4vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(14, 21, 31, 0.98), rgba(10, 15, 23, 0.98));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

.pdp__eyebrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.pdp__context {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pdp__context-sep {
  margin: 0 0.3rem;
  color: var(--accent);
}

.pdp__status {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(0, 230, 118, 0.34);
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.12);
  color: #76f1ad;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.pdp__status.is-agotado {
  border-color: rgba(255, 79, 118, 0.38);
  background: rgba(255, 79, 118, 0.12);
  color: #ff9eb3;
}

.pdp__brand {
  margin: 0.15rem 0 -0.25rem;
  color: #a8dcf8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pdp__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 7vw, 2.35rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.pdp__subtitle {
  max-width: 62ch;
  margin: 0;
  color: #b8c4d5;
  font-size: clamp(0.92rem, 2.8vw, 1rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.pdp__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin: 0.1rem 0;
  color: var(--accent);
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 16px rgba(1, 145, 198, 0.28);
}

.pdp__price-old {
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 600;
  text-decoration: line-through;
  text-shadow: none;
}

.pdp__discount {
  align-self: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.14);
  color: #76f1ad;
  font-size: 0.38em;
  font-weight: 900;
  text-shadow: none;
}

.pdp__data {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.pdp__data div {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.pdp__data dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdp__data dd {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ---------- Sabores y cantidad ---------- */

.pdp__selectors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  align-items: end;
  padding-top: 0.15rem;
}

.pdp__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.pdp__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdp__select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 2.25rem 0 0.8rem;
  border: 1px solid rgba(90, 180, 233, 0.28);
  border-radius: 11px;
  background: var(--footer-surface-soft);
  color: #e9f6ff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.pdp__select:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.76;
}

.pdp__select.needs-selection {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.18);
}

.pdp__select:focus-visible,
.pdp__qty-btn:focus-visible,
.pdp__cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pdp__stepper {
  display: inline-grid;
  grid-template-columns: 44px minmax(42px, auto) 44px;
  align-items: center;
  width: max-content;
  min-height: 46px;
  padding: 2px;
  border: 1px solid rgba(90, 180, 233, 0.28);
  border-radius: 11px;
  background: var(--footer-surface-soft);
}

.pdp__qty-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: #e9f6ff;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
}

.pdp__qty-btn:hover {
  background: rgba(90, 180, 233, 0.13);
}

.pdp__qty-btn:active {
  transform: translateY(1px);
}

.pdp__qty-btn--plus {
  color: var(--cta);
}

.pdp__qty-value {
  min-width: 42px;
  color: #e9f6ff;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pdp__added-note,
.pdp__hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pdp__added-note {
  color: #76f1ad;
  font-weight: 700;
}

.pdp__hint {
  color: var(--muted);
}

/* ---------- CTA ---------- */

.pdp__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cta-strong) 0%, var(--cta) 100%);
  box-shadow: 0 8px 22px rgba(0, 200, 83, 0.25);
  color: #04140a;
  cursor: pointer;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.16s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pdp__cta:hover {
  background: linear-gradient(135deg, var(--cta) 0%, var(--cta-soft) 100%);
  box-shadow: 0 10px 26px rgba(0, 200, 83, 0.34);
}

.pdp__cta:active {
  transform: translateY(1px);
}

.pdp__cta.is-added {
  border-color: var(--cta);
  background: rgba(0, 230, 118, 0.08);
  box-shadow: none;
  color: #76f1ad;
}

.pdp__cta.is-added:hover {
  background: rgba(0, 230, 118, 0.14);
  box-shadow: none;
}

.pdp__cta--ghost {
  border-color: rgba(90, 180, 233, 0.3);
  background: rgba(90, 180, 233, 0.14);
  box-shadow: none;
  color: #e9f6ff;
}

.pdp__cta--ghost:hover {
  background: rgba(90, 180, 233, 0.22);
  box-shadow: none;
}

/* ---------- Información completa ---------- */

.pdp__details {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(12, 18, 27, 0.98), rgba(8, 12, 18, 0.98));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

.pdp__details-head {
  margin-bottom: 0.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.pdp__details-kicker {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdp__details-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  font-weight: 900;
  line-height: 1.15;
}

.pdp__details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.pdp__content-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.pdp__content-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pdp__content-section h3 {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
}

.pdp__prose {
  max-width: 72ch;
  color: #b8c4d5;
  font-size: 0.95rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.pdp__prose p {
  margin: 0 0 0.95rem;
}

.pdp__prose p:last-child {
  margin-bottom: 0;
}

.pdp__benefits {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}

.pdp__benefit {
  position: relative;
  padding-left: 1.15rem;
  color: #d2dbe7;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.pdp__benefit::before {
  position: absolute;
  top: 0.62em;
  left: 0.1rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
  content: "";
}

.pdp__usage {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: usage-step;
}

.pdp__usage li {
  position: relative;
  min-height: 44px;
  padding: 0.7rem 0 0.7rem 3.25rem;
  color: #d2dbe7;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  counter-increment: usage-step;
}

.pdp__usage li::before {
  position: absolute;
  top: 0.45rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(90, 180, 233, 0.28);
  border-radius: 10px;
  background: rgba(90, 180, 233, 0.1);
  color: #a8dcf8;
  font-size: 0.82rem;
  font-weight: 900;
  content: counter(usage-step, decimal-leading-zero);
}

/* ---------- Barra de compra móvil ---------- */

.pdp__bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(150px, 1.25fr);
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(90, 180, 233, 0.2);
  background: rgba(8, 12, 18, 0.96);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.pdp__bar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.pdp__bar-info {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.pdp__bar-strong {
  min-width: 0;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp__bar .pdp__price-old,
.pdp__bar .pdp__discount {
  display: none;
}

.pdp__bar-sub {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp__bar-cta {
  min-height: 46px;
  padding-inline: 0.6rem;
  font-size: 0.86rem;
}

/* ===========================================================================
   480+ — selectores en una fila cuando hay espacio real
   =========================================================================== */

@media (min-width: 480px) {
  .pdp {
    padding-inline: 1.25rem;
  }

  .pdp__selectors {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pdp__field--quantity {
    align-items: flex-start;
  }
}

/* ===========================================================================
   Tablet (768–1023) — imagen + panel de compra, información debajo
   =========================================================================== */

@media (min-width: 768px) {
  .pdp {
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) 3rem;
  }

  .pdp__layout {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    grid-template-areas:
      "media info"
      "details details";
    gap: 1.25rem;
    align-items: stretch;
  }

  .pdp__media {
    min-height: 450px;
    padding: 1rem;
  }

  .pdp__img {
    width: min(100%, 410px);
    height: 410px;
  }

  .pdp__info {
    justify-content: center;
    padding: clamp(1.4rem, 3vw, 2rem);
  }

  .pdp__title {
    font-size: clamp(2rem, 4vw, 2.7rem);
  }

  .pdp__details {
    padding: clamp(1.6rem, 3vw, 2.25rem);
  }

  .pdp__content-section {
    padding: 1.5rem 0;
  }

  .pdp__benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .pdp__benefit {
    min-height: 100%;
    padding: 0.9rem 1rem 0.9rem 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
  }

  .pdp__benefit::before {
    top: 1.45rem;
    left: 1rem;
  }

  .pdp__bar {
    display: none;
  }
}

/* ===========================================================================
   Desktop (1024+) — lectura amplia y beneficios en cuadrícula
   =========================================================================== */

@media (min-width: 1024px) {
  .pdp__breadcrumb {
    margin-bottom: 1rem;
  }

  .pdp__layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.5rem;
  }

  .pdp__media {
    min-height: 520px;
    padding: 1.25rem;
  }

  .pdp__img {
    width: min(100%, 470px);
    height: 470px;
  }

  .pdp__info {
    padding: clamp(1.8rem, 3vw, 2.5rem);
  }

  .pdp__data {
    display: grid;
  }

  .pdp__hint {
    display: none;
  }

  .pdp__details {
    padding: 2.25rem 2.5rem;
  }

  .pdp__details-head {
    padding-bottom: 1.25rem;
  }

  .pdp__content-section {
    padding: 1.8rem 0;
  }

  .pdp__content-section h3 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
  }

  .pdp__prose {
    font-size: 1rem;
    line-height: 1.8;
  }

  .pdp__benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pdp__usage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdp__bar,
  .pdp__cta {
    transition: none;
  }
}
