/* ==========================================================================
   Product detail
   ========================================================================== */

.pdp {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 72px;
  align-items: start;
  padding-top: 36px;
  padding-bottom: var(--section-y-sm);
}

/* ---------- Media ---------- */
.pdp__stage { position: relative; }
.pdp__stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__stage img[hidden] { display: none; }

.pdp__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.pdp__thumb {
  background: #fff;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(29, 28, 25, .12);
  transition: border-color .2s ease;
}
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__thumb:hover { border-color: var(--rule-strong); }
.pdp__thumb[aria-pressed="true"] { border-color: var(--brown); }

/* ---------- Info column ---------- */
.pdp__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
}
.pdp__code { font-size: 13px; letter-spacing: .16em; color: var(--muted); margin-top: 10px; }
.pdp__lede { margin-top: 22px; line-height: 1.8; }
.pdp__chips { margin-top: 24px; }
.pdp__chips .chip { padding: 7px 13px; font-size: 10.5px; color: var(--brown); border-color: var(--rule-strong); }

.pdp__fabrics { margin-top: 32px; }
.pdp__fabric-key {
  font-size: 10.5px;
  letter-spacing: .24em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.pdp__swatches { display: flex; gap: 10px; }
.pdp__swatch {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid rgba(29, 28, 25, .15);
  outline-offset: 2px;
  transition: border-color .2s ease;
}
.pdp__swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__swatch[aria-pressed="true"] { border-color: var(--brown); outline: 1.5px solid var(--brown); }

.pdp__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; }
.pdp__actions .btn { width: 100%; padding: 17px 10px; font-size: 12.5px; }
.pdp__add[disabled] { opacity: 1; cursor: default; background: var(--brown); }
.pdp__note { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.7; }

.pdp__specs { margin-top: 36px; border-top: 1px solid var(--rule); }
.pdp__spec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
}
.pdp__spec .spec__val { font-weight: 600; text-align: right; }
.pdp__spec--wrap { align-items: center; }
.pdp__delivery { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1279px) {
  .pdp { gap: 44px; }
}

@media (max-width: 1023px) {
  .pdp { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 767px) {
  .pdp { padding-top: 24px; }
  .pdp__thumbs { gap: 8px; }
  .pdp__lede { font-size: 14.5px; margin-top: 18px; }
  .pdp__swatch { width: 46px; height: 46px; }
  .pdp__spec { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pdp__spec .spec__val { text-align: left; }
  .pdp__delivery { justify-content: flex-start; }
}

/* ---------- Imported-product additions ---------- */
.pdp__sku-label {
  font-family: var(--mono, inherit);
  font-size: 9.5px;
  letter-spacing: .22em;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 3px 6px;
  margin-right: 9px;
  vertical-align: 1px;
}
.pdp__sku { letter-spacing: .16em; }

/* A product can carry up to 26 gallery images — wrap instead of a fixed 4-up */
.pdp__thumbs--flow {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  max-height: 232px;
  overflow-y: auto;
  padding-right: 4px;
}

.pdp__body { margin-top: 26px; font-size: 15px; line-height: 1.85; color: var(--muted-dark); }
.pdp__body p { margin: 0 0 14px; }
.pdp__body p:last-child { margin-bottom: 0; }

.pdp__specs .spec__val a { border-bottom: 1px solid var(--rule-strong); }

@media (max-width: 767px) {
  .pdp__thumbs--flow { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); max-height: 180px; }
}

/* ---------- Related rails ---------- */
.rail { padding-top: 72px; padding-bottom: 72px; }
.rail--alt {
  background: var(--cream-alt);
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.rail--alt > * {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.rail__head { margin-bottom: 36px; align-items: flex-end; }
.rail__title { font-size: clamp(22px, 2.6vw, 30px); }
.rail__sub { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.rail__grid { gap: 28px; }
.rail--links { padding-top: 0; padding-bottom: var(--section-y-sm); }

@media (max-width: 767px) {
  .rail { padding-top: 44px; padding-bottom: 44px; }
  .rail__head { margin-bottom: 24px; }
  /* Rails become a swipe strip on a phone rather than a very long stack */
  .rail__grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 10px;
  }
  .rail__grid > * { flex: 0 0 62%; scroll-snap-align: start; }
}
