/* ==========================================================================
   product.css — Adorable product detail page (PDP).
   Requires common.css. Related-product cards reuse featured-products.css.

   Layout: a two-column grid — a sticky gallery on the left, the buy box on the
   right — collapsing to a single column on mobile. Rem-based to match the
   theme's 62.5% root (1rem = 10px). Accent red mirrors the product cards.
   ========================================================================== */

.pdp {
  --pdp-accent: #b91c1c;
  --pdp-ink: rgb(var(--text-color));
  --pdp-muted: rgba(var(--text-color), 0.6);
  --pdp-line: #ececec;
  --pdp-radius: 12px;
  padding: 2rem 0 4rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────── */
.pdp__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2.4rem;
  font-size: 1.3rem;
  color: var(--pdp-muted);
}

.pdp__breadcrumb a {
  color: var(--pdp-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pdp__breadcrumb a:hover { color: var(--pdp-accent); }
.pdp__breadcrumb-sep { color: rgba(var(--text-color), 0.3); }
.pdp__breadcrumb-current { color: var(--pdp-ink); }

/* ── Grid ─────────────────────────────────────────────────────────────── */
.pdp__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 750px) {
  .pdp__grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

@media (min-width: 990px) {
  .pdp__grid { grid-template-columns: 1.1fr 0.9fr; gap: 6rem; }
}

/* ── Gallery ──────────────────────────────────────────────────────────── */
.pdp__gallery { display: flex; flex-direction: column; gap: 1.4rem; }

@media (min-width: 990px) {
  .pdp__gallery {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

.pdp__gallery-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f6f6f6;
  border: 1px solid var(--pdp-line);
  border-radius: var(--pdp-radius);
  overflow: hidden;
}

.pdp__main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(var(--text-color), 0.25);
}
.pdp__image-placeholder svg { width: 8rem; height: 8rem; }

.pdp__badge {
  position: absolute;
  top: 1.4rem;
  left: 1.4rem;
  z-index: 1;
  padding: 0.4rem 1rem;
  background: var(--pdp-accent);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  border-radius: 6px;
}

.pdp__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 1rem;
}

.pdp__thumb {
  padding: 0;
  aspect-ratio: 1 / 1;
  background: #f6f6f6;
  border: 1px solid var(--pdp-line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__thumb:hover { border-color: rgba(var(--text-color), 0.4); }
.pdp__thumb.is-active { border-color: var(--pdp-ink); border-width: 2px; }

/* ── Info / buy box ───────────────────────────────────────────────────── */
.pdp__info { display: flex; flex-direction: column; }

.pdp__sku {
  font-size: 1.2rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--pdp-muted);
}

.pdp__title {
  margin: 0.6rem 0 0;
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1.25;
}

@media (min-width: 990px) {
  .pdp__title { font-size: 3.4rem; }
}

/* Price */
.pdp__price { margin: 1.6rem 0; }

.pdp__price-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.pdp__price-now {
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--pdp-accent);
}

.pdp__price-was {
  font-size: 1.8rem;
  color: rgba(var(--text-color), 0.45);
}

.pdp__price-from {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--pdp-muted);
}

.pdp__price-unit { font-size: 1.5rem; color: var(--pdp-muted); }

/* "(inc VAT)" / "(exc VAT)" tag beside the headline price */
.pdp__price-vat-tag { font-size: 1.4rem; color: var(--pdp-muted); }

.pdp__price-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 0.6rem;
  font-size: 1.3rem;
  color: var(--pdp-muted);
}

.pdp__price-pack { font-weight: 500; }

/* Short description */
.pdp__short-desc {
  margin: 0.4rem 0 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--pdp-line);
  font-size: 1.5rem;
  line-height: 1.7;
  color: rgba(var(--text-color), 0.8);
}

/* Variants */
.pdp__variant { margin-bottom: 1.8rem; }

.pdp__variant-label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--pdp-muted);
}

.pdp__variant-options { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.pdp__variant-btn {
  min-height: 4rem;
  padding: 0 1.6rem;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 1.4rem;
  color: var(--pdp-ink);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.pdp__variant-btn:hover { border-color: var(--pdp-ink); }

.pdp__variant-btn.is-active {
  background: var(--pdp-ink);
  border-color: var(--pdp-ink);
  color: #fff;
}

/* ── Buy section ──────────────────────────────────────────────────────── */
.pdp__buy { margin-top: 0.6rem; }

/* Area calculator */
.pdp__calc {
  margin-bottom: 1.8rem;
  padding: 1.8rem;
  background: #faf7f5;
  border: 1px solid #f0e6e2;
  border-radius: var(--pdp-radius);
}

.pdp__calc-label {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
}

.pdp__calc-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--pdp-muted);
}

.pdp__calc-input {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 1.2rem;
  max-width: 26rem;
}

.pdp__calc-input input {
  width: 100%;
  height: 4.8rem;
  padding: 0 5rem 0 1.4rem;
  font-size: 1.6rem;
  font-family: inherit;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
}

.pdp__calc-input input:focus {
  outline: none;
  border-color: var(--pdp-accent);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.pdp__calc-suffix {
  position: absolute;
  right: 1.4rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--pdp-muted);
  pointer-events: none;
}

.pdp__calc-result {
  margin: 1.2rem 0 0;
  min-height: 2rem;
  font-size: 1.5rem;
  color: var(--pdp-ink);
}

.pdp__calc-result strong { font-weight: 600; }

.pdp__calc-ok {
  display: inline-block;
  margin-left: 0.4rem;
  color: #15803d;
  font-size: 1.3rem;
  font-weight: 500;
}

/* Quantity + total */
.pdp__qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 1.4rem;
}

.pdp__qty-caption {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--pdp-muted);
}

.pdp__qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  overflow: hidden;
}

.pdp__qty-btn {
  width: 4.4rem;
  height: 4.8rem;
  background: #fff;
  border: 0;
  font-size: 2rem;
  color: var(--pdp-ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.pdp__qty-btn:hover { background: rgba(var(--text-color), 0.05); }

.pdp__qty-input {
  width: 5.4rem;
  height: 4.8rem;
  border: 0;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  text-align: center;
  font-size: 1.6rem;
  font-family: inherit;
  -moz-appearance: textfield;
}

.pdp__qty-input::-webkit-outer-spin-button,
.pdp__qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp__qty-input:focus { outline: none; }

.pdp__total { text-align: right; }
.pdp__total-label {
  display: block;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--pdp-muted);
}
.pdp__total-value { font-size: 2.2rem; font-weight: 600; }
.pdp__total-vat { font-size: 1.3rem; color: var(--pdp-muted); margin-left: 0.5rem; }

/* Stock + error */
.pdp__stock { margin: 0 0 1rem; font-size: 1.4rem; }
.pdp__stock.is-in { color: #15803d; }
.pdp__stock.is-low { color: #b45309; }
.pdp__error { margin: 0 0 1rem; font-size: 1.4rem; color: var(--pdp-accent); }

/* Actions */
.pdp__actions { display: flex; gap: 1rem; }

.pdp__atc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex: 1 1 auto;
  min-height: 5.4rem;
  padding: 0 2.4rem;
  background: var(--pdp-ink);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.04rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.pdp__atc svg { width: 2rem; height: 2rem; }
.pdp__atc:hover { background: #000; }
.pdp__atc:disabled { opacity: 0.5; cursor: not-allowed; }
.pdp__atc.is-loading { opacity: 0.7; cursor: progress; }

.pdp__wishlist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.4rem;
  height: 5.4rem;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  color: var(--pdp-accent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pdp__wishlist svg { width: 2.4rem; height: 2.4rem; fill: #fff; stroke: currentColor; }
.pdp__wishlist:hover { border-color: var(--pdp-accent); background: #fff5f5; }
.pdp__wishlist.is-active svg { fill: currentColor; }

/* ── Description ──────────────────────────────────────────────────────── */
.pdp__section-title {
  margin: 0 0 1.8rem;
  font-size: 2.2rem;
  font-weight: 500;
}

.pdp__description {
  margin-top: 5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--pdp-line);
}

.pdp__prose {
  max-width: 90rem;
  font-size: 1.55rem;
  line-height: 1.8;
  color: rgba(var(--text-color), 0.85);
}

.pdp__prose img { max-width: 100%; height: auto; }
.pdp__prose h2, .pdp__prose h3 { font-weight: 500; }

/* ── Related ──────────────────────────────────────────────────────────── */
.pdp__related { margin-top: 5rem; }

.pdp__related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 750px) {
  .pdp__related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 990px) {
  .pdp__related-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.pdp-toast {
  position: fixed;
  bottom: 2.4rem;
  left: 50%;
  z-index: 1000;
  transform: translate(-50%, 1.5rem);
  max-width: calc(100vw - 4rem);
  padding: 1.4rem 2.2rem;
  background: var(--pdp-ink);
  color: #fff;
  font-size: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0.8rem 2.4rem rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pdp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.pdp-toast.is-ok { background: #15803d; }
.pdp-toast.is-error { background: var(--pdp-accent); }
