/* ============================================================
   PDP 闂?media carousel, quantity stepper, details-below-buy
   2026-12-04 閻?template level (applies to every product)
   ============================================================ */
:root {
  --fp-pdp-stage: min(78vh, 720px);
}

/* ---------- media / carousel ---------- */
.fp-media { min-width: 0; }
.fp-media__stagewrap { position: relative; }

.fp-media__stage {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--fp-cream);
}
.fp-media__stage::-webkit-scrollbar { display: none; }
.fp-media__stage:focus-visible { outline: 1px solid var(--fp-ink); outline-offset: 3px; }

.fp-media__slide {
  flex: 0 0 100%;
  width: 100%;
  height: var(--fp-pdp-stage);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: var(--fp-cream);
  cursor: zoom-in;
}
.fp-media__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.fp-media__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--fp-line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--fp-ink);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fp-media__nav:hover { background: #fff; }
.fp-media__nav[disabled] { opacity: .28; cursor: default; }
.fp-media__nav--prev { left: 14px; }
.fp-media__nav--next { right: 14px; }

.fp-media__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
}
.fp-media__dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.fp-media__dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(37, 36, 35, .32);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
  transition: background .2s ease, transform .2s ease;
}
.fp-media__dot.is-active::before { background: var(--fp-ink); transform: scale(1.3); }

/* ---------- thumbnails (single row, horizontal scroll) ---------- */
.fp-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fp-thumbs::-webkit-scrollbar { display: none; }
.fp-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 86px;
  padding: 0;
  border: 1px solid transparent;
  background: var(--fp-cream);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
}
.fp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-thumb.is-active { border-color: var(--fp-ink); }
.fp-thumb:focus-visible { outline: 1px solid var(--fp-ink); outline-offset: 2px; }

/* ---------- quantity stepper (44x44 touch targets) ---------- */
.fp-qty-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.fp-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--fp-line-strong);
  background: #fff;
}
.fp-qty-btn {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 42px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fp-ink);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.fp-qty-btn:hover:not([disabled]) { background: var(--fp-cream); }
.fp-qty-btn[disabled] { opacity: .32; cursor: default; }
.fp-qty-input {
  width: 56px;
  height: 42px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--fp-line);
  border-right: 1px solid var(--fp-line);
  background: #fff;
  text-align: center;
  font-size: 14px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.fp-qty-input::-webkit-outer-spin-button,
.fp-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- details section (below the buy panel on every breakpoint) ---------- */
.fp-pdp-details {
  border-top: 1px solid var(--fp-line);
  margin: 30px 0 8px;
  padding: 28px 0 8px;
}
.fp-pdp-details__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 56px;
  align-items: start;
}
.fp-pdp-details__title {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.fp-pdp-details__body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--fp-stone-dark);
  max-width: 70ch;
}
.fp-pdp-details__body p { margin: 0 0 12px; }
.fp-pdp-details__body ul,
.fp-pdp-details__body ol { margin: 0 0 12px; padding-left: 18px; }
.fp-pdp-details__body li { margin: 0 0 6px; }
.fp-pdp-details__body h2,
.fp-pdp-details__body h3,
.fp-pdp-details__body h4 { font-size: 13px; letter-spacing: .04em; color: var(--fp-ink); margin: 16px 0 8px; }
.fp-pdp-details__text .fp-acc { margin-top: 20px; }

/* ---------- responsive ---------- */
@media (min-width: 1025px) {
  .fp-media__nav { display: flex; }
}

@media (max-width: 1280px) {
  .fp-pdp-details__inner { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
}

@media (max-width: 1024px) {
  :root { --fp-pdp-stage: min(86vw, 52vh); }
  .fp-pdp-details__inner { grid-template-columns: 1fr; gap: 22px; }
  .fp-pdp-details__body { max-width: none; }
  .fp-pdp-details__text .fp-acc { margin-top: 0; }
}

@media (max-width: 640px) {
  :root { --fp-pdp-stage: 66vw; }
  .fp-thumb { width: 50px; height: 50px; }
  .fp-pdp { padding-top: 14px; }
  .fp-pdp__stock { margin: -6px 0 12px !important; }
  .fp-qty-btn { width: 48px; min-width: 48px; height: 46px; }
  .fp-qty-stepper { height: 48px; }
  .fp-qty-input { height: 46px; width: 52px; }
  body.single-product .fp-crumb { padding-top: 10px; }
  .fp-pdp { gap: 10px; }
  .fp-size { height: 38px; }
  .fp-pdp__reviews { margin-bottom: 6px; }
  .fp-pdp__info { padding-top: 0; }
  .fp-opt { margin-bottom: 11px; }
  .fp-opt__head { margin-bottom: 6px; }
  .fp-qty-row { margin: 2px 0 10px; }
  .fp-pdp__reviews { margin-bottom: 10px; }
  .fp-pdp__save { margin-bottom: 10px; }
  .fp-pdp__title { margin-bottom: 8px; }
  .fp-pdp__notes { margin-top: 14px; padding-top: 12px; gap: 10px; }
  .fp-pdp-details { margin-top: 22px; padding-top: 20px; }
}
