/* catalog.detail.css */

.catalog-detail { padding: var(--space-xl) 0 var(--space-3xl); }

/* Product layout: gallery left, info right */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 6vw, 4rem);
  align-items: start;
}

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.product-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0;
  border-radius: var(--card-radius);
  background: var(--color-surface-alt);
  aspect-ratio: 1;
  -webkit-overflow-scrolling: touch;
}
.product-gallery::-webkit-scrollbar { display: none; }

.product-gallery__slide {
  scroll-snap-align: start;
  flex: 0 0 100%;
  margin: 0;
}

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

.product-gallery__placeholder {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: var(--size-lg);
  font-weight: var(--weight-bold);
  text-align: center;
  padding: var(--space-xl);
}

/* ── Product info ────────────────────────────────────────────────────────── */
.product-detail__header { margin-bottom: var(--space-lg); }

.product-detail__header shop-badge { margin-bottom: var(--space-sm); }

.product-detail__name {
  font-size: var(--size-3xl);
  letter-spacing: -0.02em;
}

.product-detail__sku {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  font-family: var(--font-mono);
}

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.product-detail__pricing {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.product-detail__price {
  display: block;
  font-size: var(--size-3xl);
}

.product-detail__vat-info {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ── Variants ────────────────────────────────────────────────────────────── */
.product-variants {
  border: none;
  margin-bottom: var(--space-lg);
}

.product-variants__legend {
  font-size: var(--size-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.product-variants__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Variant radio inputs — completely hidden, label is the visible element */
.variant-option__input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.variant-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-block-size: 2.75rem;
  padding: var(--space-xs) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  user-select: none;
  position: relative;
}

/* Selected state — :has() targets the label containing a checked input */
.variant-option:has(.variant-option__input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-surface);
}

/* Focus state */
.variant-option:has(.variant-option__input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Hover */
.variant-option:not(.variant-option--unavailable):hover {
  border-color: var(--color-primary);
}

/* Unavailable (disabled) */
.variant-option--unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Low stock indicator */
.variant-option--low::after {
  content: '';
  position: absolute;
  bottom: 2px;
  inset-inline-end: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f59e0b;
}

/* ── Quantity ────────────────────────────────────────────────────────────── */
.product-detail__quantity {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.product-detail__qty-label {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  flex-shrink: 0;
}

.product-detail__qty-input {
  width: 5rem;
  text-align: center;
}

/* ── Add to cart button ──────────────────────────────────────────────────── */
.product-detail__add-btn {
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--size-lg);
  margin-bottom: var(--space-xl);
}

/* ── Description ─────────────────────────────────────────────────────────── */
.product-detail__description {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  line-height: 1.8;
}

.product-detail__description h1,
.product-detail__description h2,
.product-detail__description h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.product-detail__description h1:first-child { display: none; } /* title is already shown above */

.product-detail__description p,
.product-detail__description ul,
.product-detail__description ol {
  margin-bottom: var(--space-md);
}

.product-detail__description ul,
.product-detail__description ol {
  padding-inline-start: var(--space-lg);
}
.product-detail__description ul { list-style: disc; }
.product-detail__description ol { list-style: decimal; }

.product-detail__description li { margin-bottom: var(--space-xs); }

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .product-detail__name { font-size: var(--size-2xl); }
}
