/* =====================================================================
   RAJGHARANA CENTRAL — PRODUCT DETAIL STYLESHEET (Step 6)
   =====================================================================
   Product-page-only layout. Design tokens, buttons, forms, breadcrumbs,
   section headings, badges, the product card, alerts and `.media`
   image-fallback all come from assets/css/style.css and are reused as-is.

   Contents:
     1. Product detail layout (gallery + info)
     2. Gallery / thumbnails
     3. Lightbox (zoom)
     4. Purchase panel (price, stock, quantity, actions)
     5. Description / specs
     6. Responsive adjustments
   ===================================================================== */


/* =====================================================================
   1. PRODUCT DETAIL LAYOUT
   ===================================================================== */

.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
}


/* =====================================================================
   2. GALLERY / THUMBNAILS
   ===================================================================== */

.product-gallery__main {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__zoom {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: var(--color-text);
}

.product-gallery__zoom svg {
  width: 18px;
  height: 18px;
}

/* Hide the zoom trigger when the main image itself has no real photo to
   enlarge (see .media.img-fallback in style.css). */
.product-gallery__main.img-fallback .product-gallery__zoom {
  display: none;
}

.product-gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.product-gallery__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 85px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  scroll-snap-align: start;
  transition: border-color var(--transition-fast);
}

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

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover,
.product-gallery__thumb:focus-visible {
  border-color: var(--color-primary);
}


/* =====================================================================
   3. LIGHTBOX (ZOOM)
   ===================================================================== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-mobile-overlay);
  background: rgba(23, 20, 20, 0.85);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-overlay.is-visible {
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-mobile-nav);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.lightbox__panel {
  position: relative;
  max-width: min(90vw, 900px);
  max-height: 90vh;
}

.lightbox__panel img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-inverse);
}

.lightbox__close svg {
  width: 20px;
  height: 20px;
}


/* =====================================================================
   4. PURCHASE PANEL
   ===================================================================== */

.product-info__category {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.product-info__title {
  margin-bottom: var(--space-3);
}

.product-info__rating-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.product-info__price-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.product-info__price {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.product-info__price--regular {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.product-info__stock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.product-info__stock.is-in-stock {
  color: var(--color-success);
}

.product-info__stock.is-out-of-stock {
  color: var(--color-error);
}

.product-info__sku {
  margin-bottom: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.product-info__short-desc {
  margin-bottom: var(--space-5);
  color: var(--color-text);
}

.product-purchase {
  margin-bottom: var(--space-4);
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--space-4);
  border: var(--border-width) solid var(--color-border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.quantity-stepper__label {
  display: none;
}

.quantity-stepper__btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  color: var(--color-text);
  background: var(--color-bg);
}

.quantity-stepper__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quantity-stepper__input {
  width: 56px;
  height: 44px;
  text-align: center;
  border: 0;
  border-left: var(--border-width) solid var(--color-border-default);
  border-right: var(--border-width) solid var(--color-border-default);
  background: var(--color-surface);
  color: var(--color-text);
  -moz-appearance: textfield;
}

.product-purchase__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.purchase-feedback {
  margin-top: var(--space-4);
}

.product-info__wishlist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.product-info__wishlist svg {
  width: 18px;
  height: 18px;
}


/* =====================================================================
   5. DESCRIPTION / SPECS
   ===================================================================== */

.product-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
}

.product-description h2,
.product-specs h2 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-4);
}

.product-description p {
  color: var(--color-text);
  line-height: var(--lh-normal);
}

.product-specs__list {
  margin: 0;
}

.product-specs__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border-default);
  font-size: var(--fs-sm);
}

.product-specs__row dt {
  font-weight: 600;
  color: var(--color-text-muted);
}

.product-specs__row dd {
  margin: 0;
  color: var(--color-text);
}


/* =====================================================================
   6. RESPONSIVE ADJUSTMENTS
   ===================================================================== */

@media (min-width: 768px) {
  .product-purchase__actions {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

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

  .product-gallery {
    position: sticky;
    top: calc(var(--space-7) * 1.5);
  }
}
