/* css/product.css — Product detail view */

/* ── 2-column layout ─────────────────────────────────────────────────────── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - var(--header-h) - 52px);
}

/* Mobile header: shown only on mobile */
.product-detail__mobile-header {
  padding: var(--s-2) var(--gutter) 0;
}

/* Desktop header: shown only on desktop */
.product-detail__desktop-header {
  display: none;
}

@media (min-width: 768px) {
  .product-detail {
    grid-template-columns: 55% 45%;
    min-height: calc(100vh - var(--header-h) - 52px);
  }

  .product-detail__mobile-header {
    display: none;
  }

  .product-detail__desktop-header {
    display: block;
  }
}

/* ── Image panel ─────────────────────────────────────────────────────────── */
.product-detail__images {
  background: var(--c-off-white);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (min-width: 768px) {
  .product-detail__images {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
}

/* ── Carousel (mobile swipeable, desktop stacked) ────────────────────────── */
.product-carousel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-carousel__slide {
  flex: none;
  width: 100%;
}

/* Each image */
.product-detail__img {
  width: 100%;
  flex: 1 1 50%;
  object-fit: contain;
  padding: var(--s-6);
  background: var(--c-off-white);
  display: block;
  transition: opacity var(--ease-base);
}

/* Carousel dots: hidden on desktop */
.product-carousel__dots {
  display: none;
}

@media (max-width: 767px) {
  .product-carousel {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    scrollbar-width: none;
  }

  .product-carousel::-webkit-scrollbar {
    display: none;
  }

  .product-carousel__slide {
    scroll-snap-align: start;
    min-width: 100%;
  }

  .product-detail__img {
    flex: none;
    width: 100%;
    aspect-ratio: 5 / 4;
    padding: 0;
  }

  .product-carousel__dots {
    display: flex;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-1) 0;
    background: var(--c-off-white);
  }

  .product-carousel__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-border-lt);
    cursor: pointer;
    transition: background var(--ease-fast);
  }

  .product-carousel__dot.active {
    background: var(--c-black);
  }
}

/* Editorial wrap — on desktop it sits inside the left column flow */
.product-detail__editorial-wrap {
  background: var(--c-off-white);
}

@media (min-width: 768px) {
  .product-detail__editorial-wrap {
    grid-column: 1;
  }
}

/* Editorial (on-face) hero image */
.product-detail__img--editorial {
  width: 100%;
  object-fit: cover;
  object-position: center top;
  aspect-ratio: 4 / 5;
  padding: 0;
  display: block;
}

/* On mobile: reorder so editorial comes after info */
@media (max-width: 767px) {
  .product-detail {
    display: flex;
    flex-direction: column;
  }

  .product-detail__mobile-header   { order: 1; }
  .product-detail__images          { order: 2; }
  .product-detail__info            { order: 3; padding-top: var(--s-6); }
  .product-detail__editorial-wrap  { order: 4; }
}

/* ── Info panel ──────────────────────────────────────────────────────────── */
.product-detail__info {
  padding: var(--s-10) var(--gutter) var(--s-16);
  overflow-y: auto;
}

.product-detail__series-label {
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-light);
  margin-bottom: var(--s-3);
}

.product-detail__model-name {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(var(--t-xl), 5vw, var(--t-2xl));
  line-height: 1;
  color: var(--c-black);
  margin-bottom: var(--s-2);
}

.product-detail__collection {
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--c-light);
  margin-bottom: var(--s-2);
  text-transform: uppercase;
}

.product-detail__capsule {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  border: 1px solid var(--c-accent);
  margin-bottom: var(--s-6);
}

/* ── Product specs ──────────────────────────────────────────────────────── */
.product-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--c-border-lt);
  border-bottom: 1px solid var(--c-border-lt);
}

.product-specs__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-specs__label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-light);
}

.product-specs__value {
  font-size: var(--t-sm);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--c-dark);
}

.product-specs__guide-link {
  margin-left: auto;
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity var(--ease-fast);
}

.product-specs__guide-link:hover {
  opacity: 0.7;
}

/* ── Size Guide Modal ──────────────────────────────────────────────────── */
.size-guide {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.size-guide--open {
  opacity: 1;
}

.size-guide__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
}

.size-guide__panel {
  position: relative;
  z-index: 1;
  background: var(--c-warm-white);
  max-width: 460px;
  width: calc(100% - var(--s-8));
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--s-8) var(--s-6) var(--s-6);
}

.size-guide__close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 36px;
  height: 36px;
  font-size: var(--t-lg);
  color: var(--c-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease-fast);
}

.size-guide__close:hover {
  color: var(--c-black);
}

.size-guide__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--t-lg);
  letter-spacing: 0.03em;
  margin-bottom: var(--s-6);
  text-align: center;
}

.size-guide__diagram {
  background: var(--c-off-white);
  padding: var(--s-4);
  margin-bottom: var(--s-6);
}

.size-guide__svg {
  width: 100%;
  height: auto;
}

.size-guide__info {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.size-guide__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--c-border-lt);
}

.size-guide__row .size-guide__label {
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-accent);
}

.size-guide__row .size-guide__desc {
  font-size: var(--t-xs);
  color: var(--c-light);
  letter-spacing: 0.02em;
}

.size-guide__note {
  font-size: var(--t-xs);
  color: var(--c-light);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Variant section ─────────────────────────────────────────────────────── */
.variant-section {
  margin: var(--s-8) 0 var(--s-6);
}

.variant-section__label {
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-light);
  margin-bottom: var(--s-3);
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.variant-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4);
  border: 1px solid var(--c-border-lt);
  cursor: pointer;
  transition: border-color var(--ease-fast), background var(--ease-fast), color var(--ease-fast);
  outline: none;
}

.variant-option:hover,
.variant-option:focus-visible {
  border-color: var(--c-black);
}

.variant-option.selected {
  background: var(--c-black);
  color: var(--c-warm-white);
  border-color: var(--c-black);
}

.variant-option__left { flex: 1; min-width: 0; }

.variant-color-name {
  font-size: var(--t-sm);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.variant-lens {
  font-size: var(--t-xs);
  color: var(--c-light);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.variant-option.selected .variant-lens {
  color: rgba(245, 244, 240, 0.55);
}

.variant-price {
  text-align: right;
  flex-shrink: 0;
  padding-left: var(--s-4);
}

.variant-price__ils {
  font-size: var(--t-sm);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.variant-price__eur {
  font-size: var(--t-xs);
  color: var(--c-light);
  margin-top: 2px;
}

.variant-option.selected .variant-price__eur {
  color: rgba(245, 244, 240, 0.45);
}

/* ── Add to cart section ─────────────────────────────────────────────────── */
.add-to-cart-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-top: var(--s-6);
  border-top: 1px solid var(--c-border-lt);
  margin-top: var(--s-2);
}

/* Quantity selector */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--c-border-lt);
  width: fit-content;
}

.qty-btn {
  width: 40px;
  height: 40px;
  font-size: var(--t-md);
  font-weight: 300;
  color: var(--c-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease-fast);
}

.qty-btn:hover { background: var(--c-off-white); }

.qty-input {
  width: 48px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--c-border-lt);
  border-right: 1px solid var(--c-border-lt);
  background: transparent;
  text-align: center;
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--c-dark);
  -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.preorder-note {
  font-size: var(--t-xs);
  color: var(--c-light);
  letter-spacing: 0.04em;
  text-align: center;
}

/* ── Lightbox / Image zoom ─────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox--open {
  opacity: 1;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
}

.lightbox__img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: none;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox--open .lightbox__img {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: var(--s-5);
  right: var(--s-5);
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: var(--t-xl);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease-fast);
}

.lightbox__close:hover {
  color: #fff;
}

/* Zoomable cursor hint */
.product-detail__img--zoomable {
  cursor: zoom-in;
  transition: opacity var(--ease-base), transform var(--ease-slow);
}

.product-detail__img--zoomable:hover {
  transform: scale(1.02);
}
