/* Ficha de producto */
.page-producto .section:first-of-type,
.product-breadcrumb {
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
  scroll-margin-top: 4rem;
}

.main-image-container,
.product-gallery picture,
.product-gallery .main-product-image {
  position: relative;
  aspect-ratio: 3/4;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  overflow: hidden;
  background: var(--color-bone-100, #f3efe9);
}

.product-gallery picture img,
.product-gallery .main-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnails {
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.thumb-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
}

.thumb-btn:focus-visible {
  outline: 3px solid var(--color-gold-600, #b08a3e);
  outline-offset: 2px;
}

.thumbnail-image {
  width: 72px;
  height: 96px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 6px);
}

.thumbnail-image.active,
.thumbnail-image:focus-visible {
  border-color: var(--color-gold-600, #b08a3e);
  outline: none;
}

/* Barra fija móvil */
.product-sticky-bottom {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0));
  background: color-mix(in srgb, var(--color-ink-900) 92%, transparent);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg, 0 14px 36px rgba(0,0,0,.2));
}

.product-sticky-bottom .product-sticky-price {
  font-size: var(--text-lg, 1.2rem);
  font-weight: 600;
  font-family: var(--font-serif, Georgia, serif);
}

.product-sticky-bottom .btn-whatsapp {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-pill, 999px);
  font-weight: 500;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .product-sticky-bottom {
    display: flex;
  }
  .page-producto main {
    padding-bottom: 5.5rem;
  }
  .page-producto .whatsapp-fab {
    bottom: 5.5rem;
  }
}

.product-thumb-related {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--color-bone-100, #f3efe9);
}

.product-thumb-related img,
.product-thumb-related picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lightbox */
.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.product-lightbox[hidden] {
  display: none;
}

.product-lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  cursor: pointer;
}

.product-lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(100vw, 900px);
  max-height: min(90dvh, 100vh);
}

.product-lightbox-img {
  max-width: 100%;
  max-height: min(86dvh, 88vh);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm, 6px);
}

.product-lightbox-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #fff;
  color: #0a0a0a;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0, 0, 0, 0.15));
}

.product-lightbox-close:focus-visible {
  outline: 3px solid var(--color-gold-600, #b08a3e);
  outline-offset: 2px;
}
