/* =============================================================================
   Del Plaza — product
   Product page, gallery zoom & responsive adjustments
   Extracted from css/style.css during the modular asset refactor.
   DESIGN_BIBLE-aligned palette, Univers typography, civic grid discipline.
   ============================================================================= */

/* =============================================================================
   Product Page — DESIGN_BIBLE §1, §4, §6, §7, §8
   Blue Dress product template at /product.php
   ============================================================================= */

/* ---- Product Page Spacing ---- */
.product-page {
  padding-top: 0;
}

/* ---- Product Breadcrumb ---- */
.product-breadcrumb {
  padding: var(--spacing-xs) 0 var(--spacing-xxs);
}

.product-breadcrumb .breadcrumb {
  margin-bottom: 0;
}

.product-breadcrumb .breadcrumb-item {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: normal;
}

.product-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--cognac);
  content: "›";
}

.product-breadcrumb .breadcrumb-item a {
  color: var(--color-content-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.product-breadcrumb .breadcrumb-item a:hover {
  color: var(--cognac);
}

.product-breadcrumb .breadcrumb-item.active {
  color: var(--color-content-heading);
  font-weight: 600;
}

/* ---- Product Gallery — 4:5 Aspect Ratio ---- */
.product-gallery {
  background-color: var(--color-surface-card);
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.product-gallery__viewport {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--parchment-cream);
}

.product-gallery__slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.product-gallery__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  z-index: 1;
}

.product-gallery__slide.active {
  opacity: 1;
  z-index: 2;
}

.product-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Gallery Navigation Arrows ---- */
.product-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--muted-silver);
  color: var(--slate-charcoal);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 0 0 3px 3px;
  transition: all 0.25s var(--ease-out);
  backdrop-filter: blur(4px);
}

.product-gallery__nav:hover {
  background-color: var(--deep-navy);
  color: #ffffff;
  border-color: var(--deep-navy);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-gallery__nav:active {
  background-color: var(--imperial-plum);
  border-color: var(--imperial-plum);
  transform: translateY(-50%) translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-gallery__nav--prev {
  left: var(--spacing-xxs);
}

.product-gallery__nav--next {
  right: var(--spacing-xxs);
}

/* ---- Gallery Footer — Counter & Thumbnails ---- */
.product-gallery__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-xxs) var(--spacing-xs);
  background-color: #ffffff;
  border-top: 1px solid var(--muted-silver);
}

.product-gallery__counter {
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ash-grey);
  min-width: 3rem;
}

.product-gallery__thumbnails {
  display: flex;
  gap: var(--spacing-nano);
}

.product-gallery__thumb {
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0 0 3px 3px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: all 0.25s var(--ease-out);
  opacity: 0.55;
}

.product-gallery__thumb:hover {
  opacity: 0.8;
  border-color: var(--cognac);
}

.product-gallery__thumb.active {
  opacity: 1;
  border-color: var(--deep-navy);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Product Details ---- */
.product-details {
  padding: var(--spacing-xxs);
}

.product-details__overline {
  display: block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--color-content-muted);
  margin-bottom: var(--spacing-nano);
  letter-spacing: normal;
}

.product-details__title {
  font-family: 'Univers Condensed', var(--font-primary);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.10;
  color: var(--color-content-heading);
  margin-bottom: var(--spacing-xxs);
}

/* ---- Title Row & Wishlist (sign-out placement pattern) ---- */
.product-details__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xxs);
}

.product-details__wishlist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--slate-charcoal);
  cursor: pointer;
  transition: color 0.2s var(--ease-out);
}

.product-details__wishlist i {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
}

.product-details__wishlist:hover,
.product-details__wishlist.is-wished {
  color: var(--imperial-plum);
}



/* ---- Price ---- */
.product-details__price {
  margin: var(--spacing-xs) 0 var(--spacing-xs);
  display: flex;
  align-items: baseline;
  gap: var(--spacing-quark);
}

.product-details__price-currency {
  font-family: 'Univers Extended', var(--font-primary);
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  font-weight: 400;
  color: var(--cognac);
}

.product-details__price-amount {
  font-family: 'Univers Extended', var(--font-primary);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 400;
  color: var(--cognac);
  line-height: 1;
}

/* ---- Divider ---- */
.product-details__divider {
  height: 1px;
  background-color: var(--muted-silver);
  margin: var(--spacing-xs) 0;
}

/* ---- Description ---- */
.product-details__description {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  line-height: 1.7;
  color: var(--color-content-primary);
  margin-bottom: var(--spacing-xs);
}

/* ---- SKU ---- */
.product-details__sku {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-nano);
  margin-bottom: var(--spacing-xxs);
  padding: var(--spacing-quark) 0;
}

.product-details__sku-label {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: var(--ash-grey);
}

.product-details__sku-value {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--slate-charcoal);
}

/* ---- Key Features ---- */
.product-details__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-xs);
}

.product-details__features li {
  font-family: var(--font-primary);
  font-weight: 700;
  font-stretch: expanded;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--color-content-primary);
  padding-left: var(--spacing-xxs);
  position: relative;
}

.product-details__features li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--cognac);
  font-weight: 500;
}

/* ---- Size Selector ---- */
.product-details__size-selector {
  margin-bottom: var(--spacing-xs);
}

.product-details__size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-nano);
}

.product-details__stock-status {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--tawny-umber);
}

.product-details__label {
  display: block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-content-heading);
  margin-bottom: 0;
  letter-spacing: normal;
}

.product-details__size-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-nano);
}

.product-details__size-btn {
  min-width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--color-content-primary);
  background-color: #ffffff;
  border: 1px solid var(--muted-silver);
  cursor: pointer;
  border-radius: 0 0 6px 6px;
  transition: all 0.2s var(--ease-out);
  padding: 0 var(--spacing-nano);
}

.product-details__size-btn:hover {
  border-color: var(--cognac);
  color: var(--cognac);
}

.product-details__size-btn.active {
  background-color: var(--deep-navy);
  border-color: var(--deep-navy);
  color: #ffffff;
}

.product-details__size-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-details__size-btn:disabled,
.product-details__size-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: var(--muted-silver);
  border-color: var(--ash-grey);
  color: var(--ash-grey);
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ---- Add to Cart CTA ---- */
.product-details__cta {
  width: 100%;
  margin-bottom: var(--spacing-xs);
  padding: var(--spacing-xxs) var(--spacing-xs);
}

/* ---- Guarantee Badge ---- */
.product-details__guarantee {
  display: flex;
  align-items: center;
  gap: var(--spacing-nano);
  padding: var(--spacing-xxxs) var(--spacing-xs);
  background-color: var(--parchment-cream);
  border-left: 3px solid var(--cognac);
  border-radius: var(--border-radius-sticker);
}

.product-details__guarantee i {
  font-size: 1.125rem;
  color: var(--cognac);
  flex-shrink: 0;
}

.product-details__guarantee span {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-content-primary);
}

.product-details__guarantee strong {
  font-weight: 600;
  color: var(--deep-navy);
}

/* =============================================================================
   Product Promo Section — Typography-driven
   DESIGN_BIBLE §1 (Ethos), §6 (Typography)
   ============================================================================= */
.product-promo {
  padding: var(--spacing-xxxl) 0 var(--spacing-xl);
  margin-top: var(--spacing-xl);
  background-color: var(--color-surface-card);
  border-top: 1px solid var(--muted-silver);
  border-bottom: 1px solid var(--muted-silver);
}

.product-promo__inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.product-promo__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
  color: #ffffff;
  background-color: var(--cognac);
  border-radius: 0 0 3px 3px;
  margin-bottom: var(--spacing-xs);
}

.product-promo__heading {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.15;
  color: var(--deep-navy);
  margin-bottom: var(--spacing-xs);
}

.product-promo__text {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
  line-height: 1.7;
  color: var(--color-content-primary);
  margin-bottom: var(--spacing-xs);
}

.product-promo__text strong {
  font-weight: 500;
  color: var(--cognac);
}

.product-promo__divider {
  width: 3rem;
  height: 2px;
  background-color: var(--cognac);
  margin: var(--spacing-xs) auto;
}

.product-promo__footer {
  display: block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--ash-grey);
  letter-spacing: normal;
}

/* =============================================================================
   Product Page — Responsive Adjustments
   ============================================================================= */
@media (max-width: 991.98px) {
  .product-gallery__viewport {
    aspect-ratio: 3 / 4;
  }

  .product-details {
    padding: var(--spacing-xs) 0;
  }

  .product-promo {
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-lg);
  }
}

@media (max-width: 575.98px) {
  .product-gallery__viewport {
    aspect-ratio: 4 / 5;
  }

  .product-gallery__thumb {
    width: 2.75rem;
    height: 2.75rem;
  }

  .product-gallery__nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .product-details__cta {
    padding: var(--spacing-xxxs) var(--spacing-xs);
  }
}

/* =============================================================================
   Product Gallery — Zoom Feature
   DESIGN_BIBLE §8 (Interactive Physics), §13 (Micro-interactions)
   Desktop: hover-to-enlarge — transform-origin tracks the cursor.
   Touch:   double-tap to enlarge at the tap point, drag to pan,
            double-tap again to exit zoom.
   ============================================================================= */

.product-gallery__viewport {
  cursor: zoom-in;
  touch-action: manipulation; /* allow scroll, suppress double-tap browser zoom */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.product-gallery__viewport.is-touch-zoomed {
  cursor: zoom-out;
  touch-action: none; /* zoomed state — panning is handled in JS */
}

.product-gallery__img {
  transform-origin: 50% 50%;
  transition: transform 0.35s var(--ease-out);
  backface-visibility: hidden;
}

/* While any zoom is active, prepare the compositor for live transforms */
.product-gallery__viewport.is-zooming .product-gallery__img,
.product-gallery__viewport.is-touch-zoomed .product-gallery__img {
  will-change: transform;
}

/* Apply the scale transform on hover zoom — the actual enlargement */
.product-gallery__viewport.is-zooming .product-gallery__img {
  transform: scale(1.9);
}

/* Fast tracking while the cursor/finger moves — tactile, immediate */
.product-gallery__viewport.is-zooming .product-gallery__img.is-tracking,
.product-gallery__viewport.is-touch-zoomed .product-gallery__img.is-tracking {
  transition: transform 60ms linear;
}

/* ---- Zoom Hint (touch devices) ---- */
.product-gallery__zoom-hint {
  position: absolute;
  bottom: var(--spacing-xxs);
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background-color: rgba(60, 71, 122, 0.88);
  color: var(--parchment-cream);
  font-family: var(--font-primary);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.5;
  padding: var(--spacing-quark) var(--spacing-nano);
  border-radius: 0 0 3px 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
  letter-spacing: normal;
}

.product-gallery__zoom-hint.is-visible {
  opacity: 1;
}

