/* Product detail page (PDP) */

.product-page-section {
  padding: 2rem 0 4rem;
  background: var(--c-soft);
}

.product-page-container {
  width: min(75rem, calc(100% - 2 * var(--space-4)));
}

.product-page-section .breadcrumbs .current {
  color: var(--c-brand);
  font-weight: 600;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 0.5rem;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.main-image-box {
  position: relative;
  width: 100%;
  max-height: 480px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: #d6e4eb;
  border: 1px solid rgb(108 86 133 / 0.08);
  border-radius: 1.5rem;
  overflow: hidden;
}

.main-image-box .stock-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.main-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.main-img.is-fading {
  opacity: 0;
}

.main-img-empty {
  width: 40%;
  aspect-ratio: 1;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.45);
}

.zoom-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--c-brand);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.zoom-btn:hover,
.zoom-btn:focus-visible {
  background: rgb(255 255 255 / 0.85);
  transform: scale(1.04);
}

.thumbnail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.thumb-btn {
  width: 4.5rem;
  height: 4.5rem;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.thumb-btn:hover,
.thumb-btn.is-active {
  border-color: #e6861a;
  box-shadow: 0 4px 12px rgb(230 134 26 / 0.4);
}

.product-info-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-sku {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bea987;
}

.product-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--c-brand);
  overflow-wrap: anywhere;
}

.product-short-desc {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #555;
}

.price-container {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.current-price {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--c-brand);
}

.current-price__value {
  white-space: nowrap;
}

.current-price--muted {
  font-size: 1.35rem;
}

.price-unit {
  margin-left: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}

.purchase-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quantity-picker {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid rgb(108 86 133 / 0.15);
  border-radius: 0.75rem;
}

.qty-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  color: var(--c-brand);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
}

.qty-input {
  width: 2.5rem;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-brand);
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-add-cart {
  flex: 1 1 10rem;
  min-height: 3rem;
}

.purchase-unavailable {
  margin: 0 0 1.5rem;
  color: var(--c-danger);
  font-weight: 600;
}

.quick-specs-box {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid rgb(108 86 133 / 0.08);
  border-radius: 1rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgb(0 0 0 / 0.06);
  font-size: 0.875rem;
}

.spec-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.spec-label {
  color: #777;
}

.spec-val {
  font-weight: 700;
  color: var(--c-brand);
  text-align: right;
}

.product-tabs {
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid rgb(108 86 133 / 0.08);
  border-radius: 1.25rem;
}

.product-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgb(108 86 133 / 0.08);
  padding-bottom: 0.75rem;
}

.product-tabs__btn {
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.product-tabs__btn.is-active,
.product-tabs__btn:hover {
  background: rgb(230 134 26 / 0.35);
  color: var(--c-brand);
}

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

.product-tabs__body {
  max-width: 48rem;
  color: #444;
  line-height: 1.65;
  font-size: 0.975rem;
}

.product-tabs__body p {
  margin: 0 0 0.85rem;
}

.product-tabs__empty {
  margin: 0;
  color: var(--c-muted);
}

.specs-table {
  margin: 0;
  display: grid;
  gap: 0;
}

.specs-table__row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.4fr) 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgb(108 86 133 / 0.06);
  font-size: 0.9375rem;
}

.specs-table__row dt {
  margin: 0;
  color: #777;
}

.specs-table__row dd {
  margin: 0;
  font-weight: 600;
  color: var(--c-brand);
}

@media (min-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .product-info-panel {
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top) + 1rem);
  }

  .main-image-box {
    height: 440px;
    max-height: 480px;
    aspect-ratio: auto;
  }
}

@media (max-width: 767px) {
  .product-page-section {
    padding: 1.25rem 0 3rem;
  }

  .main-image-box {
    max-height: min(70vw, 360px);
    border-radius: 1.15rem;
    padding: 0.85rem;
  }

  .thumb-btn {
    width: 3.75rem;
    height: 3.75rem;
  }

  .purchase-action-group {
    flex-direction: column;
    align-items: stretch;
  }

  .purchase-action-group .cart-add-control {
    flex: 0 0 auto;
    width: 100%;
  }

  .btn-add-cart {
    flex: 0 0 auto;
    width: 100%;
    min-height: 3rem;
  }

  .specs-table__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .product-tabs {
    padding: 1rem;
    border-radius: 1rem;
  }
}

@supports (-webkit-touch-callout: none) {
  .product-page-section {
    overflow-x: clip;
  }

  .main-image-box,
  .product-info-panel {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-img,
  .thumb-btn,
  .zoom-btn,
  .product-tabs__btn {
    transition: none;
  }
}
