@charset "UTF-8";

/* Ficha de producto. */

.product-page {
  overflow-x: clip;
  font-variant-numeric: lining-nums;
}

.product-layout {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

/* ---------- Galería ---------- */

.product-gallery {
  position: relative;
  min-width: 0;
}

.gallery-track {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  margin: 0;
  overflow-x: auto;
  padding: 0;
  border-radius: 14rem 14rem 0.9rem 0.9rem;
  background: var(--petal-bg);
  list-style: none;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track:focus-visible {
  box-shadow: var(--focus-ring);
}

.gallery-slide {
  position: relative;
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
}

.gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-zoom--static {
  cursor: default;
}

.gallery-zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-slide .home-photo-label {
  top: auto;
  right: 50%;
  bottom: 1rem;
  width: max-content;
  max-width: 85%;
  transform: translateX(50%);
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  overflow-x: auto;
  padding: 0.2rem;
  list-style: none;
}

.gallery-thumbs button {
  display: block;
  width: 3.75rem;
  height: 3.75rem;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50% 50% 0.4rem 0.4rem / 38% 38% 0.4rem 0.4rem;
  background: var(--petal-bg);
  opacity: 0.7;
  transition: opacity 160ms ease, border-color 160ms ease;
}

.gallery-thumbs button[aria-current="true"] {
  border-color: var(--color-ink);
  opacity: 1;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Información y compra ---------- */

.product-info {
  min-width: 0;
}

.product-kicker {
  margin-bottom: 0.35rem;
  color: #A23259;
  font-size: 0.82rem;
  font-weight: 700;
}

.product-kicker a {
  color: inherit;
  text-decoration-color: var(--color-action);
}

.product-info h1 {
  margin-bottom: 0.3rem;
  font-size: 2.3rem;
  line-height: 1.05;
}

.product-presentation {
  margin-bottom: 0.75rem;
  color: var(--color-muted);
  font-size: 1rem;
  font-weight: 500;
}

.product-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 1rem;
}

.product-status .availability {
  min-height: 2.2rem;
  font-size: 0.85rem;
}

.product-moment {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.product-moment[hidden] {
  display: none;
}

/* El selector de variantes (.variant-picker, .variant-option…) está en componentes.css: lo usa también el selector rápido. */

.product-qty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.product-qty-label {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  font-weight: 700;
}

.qty-stepper--large button {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.5rem;
}

.qty-stepper--large input {
  width: 3.5rem;
  height: 3.25rem;
  font-size: 1.2rem;
}

.product-qty-summary {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.product-note {
  margin-bottom: 1.25rem;
}

.product-note label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-note textarea {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #687365;
  border-radius: 0.6rem;
  background: #FFFFFF;
  resize: vertical;
}

.product-note p {
  margin: 0.3rem 0 0;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.product-actions {
  display: grid;
  gap: 0.75rem;
}

.product-add {
  width: 100%;
  min-height: 3.4rem;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: #FFFFFF;
  font-size: 1rem;
  transition: background-color 160ms ease, transform 120ms ease;
}

.product-add:hover {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #FFFFFF;
}

.product-whatsapp {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid #1D6C34;
  border-radius: var(--radius-pill);
  color: #155529;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.product-whatsapp:hover {
  background: #E6F8EC;
  color: #155529;
}

.product-whatsapp svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
}

.product-notice {
  margin: 0.85rem 0 1.5rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.product-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}

.product-facts > div {
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--petal-bg);
}

.product-facts dt {
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.product-facts dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.product-description h2 {
  margin-bottom: 0.4rem;
  font-size: 1.25rem;
}

.product-description p {
  color: var(--color-ink);
}

/* Barra fija inferior (móvil y tableta). */
.product-bar {
  position: fixed;
  z-index: 32;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-line);
  background: rgb(255 254 252 / 97%);
  box-shadow: 0 -8px 24px rgb(19 38 15 / 12%);
}

.product-bar .qty-stepper output {
  min-width: 4.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.product-bar .product-add {
  min-height: 3rem;
  flex: 1;
  padding-inline: 0.5rem;
  font-size: 0.82rem;
}

.has-product-bar {
  padding-bottom: 5rem;
}

.has-product-bar .whatsapp-float {
  bottom: 5.4rem;
}

/* ---------- Relacionados ---------- */

.related {
  position: relative;
  padding-block: 3rem 4rem;
  background: var(--petal-bg);
}

.related::before {
  position: absolute;
  right: 0;
  bottom: calc(100% - 1px);
  left: 0;
  height: clamp(1.5rem, 4vw, 3rem);
  background: var(--petal-bg);
  content: "";
  -webkit-mask: url("/assets/img/borde-acuarela.svg") center bottom / 100% 100% no-repeat;
  mask: url("/assets/img/borde-acuarela.svg") center bottom / 100% 100% no-repeat;
}

.related-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.related-head h2 {
  margin: 0;
  font-size: 2rem;
}

/* ---------- Foto ampliada ---------- */

.zoom-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0E1B0B;
  color: #FFFFFF;
}

.zoom-dialog::backdrop {
  background: rgb(0 0 0 / 70%);
}

.zoom-stage {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
}

.zoom-stage img {
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
  object-fit: contain;
  transition: transform 260ms ease;
  touch-action: pan-x pan-y pinch-zoom;
}

.zoom-stage img.is-zoomed {
  cursor: zoom-out;
  transform: scale(2.2);
}

.zoom-close {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 50%;
  background: rgb(14 27 11 / 70%);
  color: #FFFFFF;
}

.zoom-close svg {
  width: 1.3rem;
  height: 1.3rem;
}

.zoom-help {
  position: absolute;
  right: 0;
  bottom: 1rem;
  left: 0;
  margin: 0;
  color: #DDE5D8;
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Tableta y escritorio ---------- */

@media (min-width: 48rem) {
  .product-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }

  .product-gallery {
    position: sticky;
    top: 7.5rem;
  }

  .product-info h1 {
    font-size: 2.6rem;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .related-head h2 {
    font-size: 2.6rem;
  }
}

@media (min-width: 64rem) {
  .product-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 3.5rem;
    padding-bottom: 5rem;
  }

  .product-info h1 {
    font-size: 3rem;
  }

  .product-bar {
    display: none;
  }

  .has-product-bar {
    padding-bottom: 0;
  }

  .has-product-bar .whatsapp-float {
    right: 1.4rem;
    bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-thumbs button,
  .variant-option,
  .product-add,
  .zoom-stage img {
    transition: none;
  }

  .variant-option:active,
  .product-add:active {
    transform: none;
  }
}
