/* ============================================================
   Noma Earplugs - product / order page
   Reuses tokens, nav, buttons, swatches, footer from style.css
   ============================================================ */

.product { max-width: var(--maxw); margin: 0 auto; padding: 48px 22px 80px; }

.product__grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start;
}

/* ---------- Gallery ---------- */
.product__gallery { position: sticky; top: 76px; }
.product__stage {
  background: var(--bg-alt); border-radius: 28px; overflow: hidden;
  aspect-ratio: 1 / 1;
}
.product__img {
  width: 100%; height: 100%; object-fit: cover; display: block;  /* fill the rounded square */
  transition: opacity .28s ease;            /* colour cross-fade */
}

/* Thumbnail strip */
.product__thumbs { display: flex; gap: 12px; margin-top: 14px; }
.product__thumb {
  width: 78px; height: 78px; border-radius: 14px; overflow: hidden; padding: 0;
  background: var(--bg-alt); border: 2px solid transparent; cursor: pointer;
  transition: border-color .15s;
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__thumb:hover { border-color: var(--hairline); }
.product__thumb.is-active { border-color: var(--text); }

/* ---------- Info ---------- */
.product__title { font-size: clamp(34px, 5vw, 56px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.product__tagline { font-size: 18px; color: var(--text-soft); margin-bottom: 16px; }
.product__price { font-size: 30px; font-weight: 600; margin-bottom: 16px; }
.product__price-unit { font-size: 15px; font-weight: 500; color: var(--text-soft); }

/* Buy 3, get 1 free offer line */
.product__promo {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--bg-alt); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 10px 14px; margin-bottom: 22px;
}
.product__promo-badge {
  flex: none; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; background: var(--accent);
  border-radius: 980px; padding: 4px 10px;
}

.product__desc { font-size: 16px; color: var(--text-soft); margin-bottom: 30px; max-width: 460px; }

.product__row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--hairline);
}
.product__label { font-size: 15px; color: var(--text-soft); }
.product__label strong { color: var(--text); font-weight: 600; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--hairline); border-radius: 980px; overflow: hidden; }
.qty__btn {
  width: 40px; height: 40px; border: none; background: #fff; color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s;
}
.qty__btn:hover { background: var(--bg-alt); }
.qty__btn:disabled { opacity: .35; cursor: default; }
.qty__input {
  width: 44px; text-align: center; border: none; font: inherit; font-weight: 600;
  color: var(--text); background: transparent; pointer-events: none;
}

/* ---------- Basket (multi-colour) ---------- */
.basket { margin-bottom: 26px; }
.basket__title { font-size: 15px; font-weight: 600; color: var(--text-soft); margin-bottom: 12px; }
.basket__row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 16px;
  margin-bottom: 10px; transition: border-color .15s, box-shadow .15s;
}
.basket__row.is-selected { border-color: var(--text); }
.basket__row.is-previewing { box-shadow: 0 0 0 3px rgba(43, 68, 209, .12); }
.basket__swatch {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sw, #ccc); border: 1px solid rgba(0, 0, 0, .15);
  padding: 0; cursor: pointer;
}
.basket__name {
  flex: 1 1 auto; text-align: left; font: inherit; font-size: 16px; font-weight: 500;
  color: var(--text); background: none; border: none; padding: 0; cursor: pointer;
}
.basket__row .qty { flex: none; }

/* Summary lines */
.basket__summary { margin-top: 22px; }
.basket__line {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 15px; color: var(--text-soft); margin: 6px 0;
}
.basket__line--free { color: var(--accent); font-weight: 600; }

/* Total + checkout */
.product__total {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 16px; color: var(--text-soft); margin: 24px 0 16px;
  padding-top: 18px; border-top: 1px solid var(--hairline);
}
.product__total strong { font-size: 24px; font-weight: 700; color: var(--text); }
.product__total-right { display: inline-flex; align-items: baseline; gap: 10px; }
.product__was { color: var(--text-soft); font-size: 16px; text-decoration: line-through; }
.product__save {
  margin: -6px 0 18px; text-align: right;
  font-size: 14px; font-weight: 600; color: var(--accent);
}
.product__save[hidden] { display: none; }
.product__was[hidden] { display: none; }

/* Add to basket */
#addToCart { margin-top: 4px; }
#addToCart.is-added { background: #1c8a4a; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .product__grid { grid-template-columns: 1fr; gap: 32px; }
  .product__gallery { position: static; }
  .product__stage { max-width: 440px; margin: 0 auto; }

  /* Controls (colour, quantity, checkout) first; descriptive text at the bottom */
  .product__info { display: flex; flex-direction: column; }
  .product__tagline { order: 5; margin: 30px 0 10px; padding-top: 28px; border-top: 1px solid var(--hairline); }
  .product__price   { order: 6; margin-bottom: 14px; }
  .product__desc    { order: 7; margin-bottom: 0; }
}
/* Phones: checkout button spans the full width */
@media (max-width: 600px) {
  #checkout { display: block; width: 100%; text-align: center; }
}
