/* ==============================================
   PRODUCT DETAIL — Product detail layout
   Verified against pdp.css + global.css source
   ============================================== */

.pdp-page { background: #f5f5f3; }
.pdp-main { padding-top: 0; }

/* ── Breadcrumb ── */
.pdp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.875rem 1.5rem;
  font-family: var(--font-secondary);
  font-size: 0.8125rem;
  color: rgba(26,26,26,0.45);
}
.pdp-breadcrumb a { color: inherit; text-decoration: none; transition: color 0.2s; }
.pdp-breadcrumb a:hover { color: #1a1a1a; }
.pdp-breadcrumb__sep { opacity: 0.4; }
@media (min-width: 1024px) { .pdp-breadcrumb { padding: 0.875rem 2rem; } }

/* ══════════════════════════════════════════════
   ABOVE THE FOLD
   Spec: mobile 4-col grid | desktop 59fr/25fr
   min-height: max-content (NOT 100vh)
══════════════════════════════════════════════ */
.pdp__above-the-fold {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (min-width: 1024px) {
  .pdp__above-the-fold {
    grid-template-columns: minmax(0, 48fr) minmax(22rem, 26fr);
    min-height: max-content;
  }
}

/* ══════════════════════════════════════════════
   GALLERY — col 1 (59fr)
   display:flex mobile | display:grid desktop
   grid-template-columns: 25fr 34fr
   height: 100% (fills grid row, sticky via grid)
══════════════════════════════════════════════ */
.pdp-gallery {
  display: flex;
  grid-column: 1 / span 4;
  overflow: hidden;
  background: #f5f5f3;
}
@media (min-width: 1024px) {
  .pdp-gallery {
    display: grid;
    grid-column: 1 / 2;
    grid-template-columns: minmax(0, 22fr) minmax(0, 30fr);
    height: calc(100vh - var(--header-height, 5rem) - 4rem);
    position: sticky;
    top: var(--header-height, 5rem);
    align-self: start;
  }
}

/* ── Secondary (thumbnail) — desktop only, 1 ảnh visible ── */
.pdp-gallery__carousel--secondary {
  display: none;
}
@media (min-width: 1024px) {
  .pdp-gallery__carousel--secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
    /* padding thu hẹp để thumbnail nhỏ hơn ảnh chính */
    padding-inline: 18%;
  }
}

/* Thumb slider — cùng hiệu ứng slide như main, không click được */
.pdp-thumb-slider {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  position: relative;
  border-radius: 2px;
  background: #ece9e4;
  pointer-events: none;
}
.pdp-thumb-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}
.pdp-thumb-slider__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.pdp-thumb-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Primary carousel (main image) ── */
/* aspect-ratio:2/3 mobile, position:relative */
.pdp-gallery__carousel--primary {
  aspect-ratio: 2 / 3;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f5f5f3;
  flex: 1;
}
@media (min-width: 1024px) {
  .pdp-gallery__carousel--primary {
    aspect-ratio: unset;
    height: 100%;
    /* max-width calc based on above-the-fold-height */
    max-height: calc(100vh - var(--header-height, 3.5rem));
  }
}

/* ── Custom slider — slides absolute, chỉ slide đang kéo vào di chuyển ── */
.pdp-slider {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background: #f5f5f3;
  -webkit-user-select: none;
  user-select: none;
}
.pdp-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}
.pdp-slider__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f5f3;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(100%); /* mặc định ẩn bên phải */
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
/* slide active: đứng yên tại chỗ */
.pdp-slider__slide.is-active {
  transform: translateX(0);
  z-index: 2;
}
/* slide đang kéo vào (incoming): bắt đầu từ phải, z cao nhất */
.pdp-slider__slide.is-incoming {
  transform: translateX(100%);
  z-index: 3;
}
/* slide prev (bên trái): ẩn bên trái */
.pdp-slider__slide.is-prev {
  transform: translateX(-100%);
  z-index: 1;
}
.pdp-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Dots — stepper dots style ──
   position:absolute bottom center of primary carousel
   step = 3px circle, active = 5px
   inset: auto auto var(--medium-xs) 50%
   var(--medium-xs) ≈ 0.75rem
*/
.pdp-pagination {
  position: absolute !important;
  bottom: 0.75rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center;
  gap: 0.375rem !important;
  z-index: 5;
  width: auto !important;
  padding: 0.375rem !important;
}

/* stepper step after — pseudo circle */
.pdp-dot {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(26,26,26,0.2);
  box-shadow: 0 0 0 1px rgba(26,26,26,0.12);
  transition: background 0.3s, width 0.3s, height 0.3s;
  cursor: pointer;
  padding: 0;
}
.pdp-dot--active {
  background: #1a1a1a;
  width: 5px;
  height: 5px;
  box-shadow: none;
}

/* ── Zoom btn — gallery zoom
   inset-block: auto var(--small-xxl)   ≈ bottom 1.25rem
   inset-inline: var(--small-xxl) auto  ≈ left 1.25rem
   width: 2rem, aspect-ratio:1
   background: color-container-secondary (white)
   border: border-size-m + border-outline-button-filled-secondary
*/
.pdp-zoom-btn {
  display: none;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  width: 2rem;
  background-color: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  padding: 0;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  color: #1a1a1a;
  transition: background 0.2s;
}
.pdp-zoom-btn svg { display: block; }
.pdp-zoom-btn:hover { background-color: #fff; }
@media (min-width: 1024px) { .pdp-zoom-btn { display: flex; } }

/* ══════════════════════════════════════════════
   PRODUCT DETAILS — col 2 (25fr)
   Spec:
   mobile: grid-column span 4, padding var(--medium-l) var(--medium-s)
   desktop: grid-column-start:2, padding-block:var(--large-s)
   --pdp-details-content-max-width: min(100%, 21.5625rem)
══════════════════════════════════════════════ */
.pdp-details {
  --pdp-details-content-max-width: 100%;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  grid-column: 1 / span 4;
  justify-content: flex-start;
  padding: 1.5rem 1rem 3rem;
  position: relative;
  background: #f5f5f3;
}
@media (min-width: 1024px) {
  .pdp-details {
    --pdp-details-content-max-width: min(100%, 21.5625rem);
    grid-column: 2 / 3;
    padding-block: 2.5rem;
    padding-inline: 2rem;
    align-self: start;
  }
}

/* Header block — centered,  text-align:center */
.pdp-details__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem; /* var(--medium-xs) */
  text-align: center;
  max-width: var(--pdp-details-content-max-width);
  width: 100%;
}

.pdp-details__category {
  font-family: var(--font-secondary);
  font-size: 0.75rem;
  color: rgba(26,26,26,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

/* font-primary, font-weight:352 (variable font) */
.pdp-details__title {
  font-family: var(--font-primary);
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* font-size:0.875rem, line-height:1.0625rem */
.pdp-details__subtitle {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  line-height: 1.0625rem;
  color: rgba(26,26,26,0.55);
  font-style: italic;
  margin: 0;
}

/* Intensity — level indicator, justify-content:center */
.pdp-details__intensity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-secondary);
  font-size: 0.8125rem;
  color: rgba(26,26,26,0.45);
  margin-top: 0.25rem;
}
.pdp-details__dots { display: flex; gap: 0.3rem; align-items: center; }
.pdp-details__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(26,26,26,0.15);
}
.pdp-details__dot.filled { background: #1a1a1a; }

/* Main block */
.pdp-details__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* var(--medium-s) */
  width: var(--pdp-details-content-max-width);
  max-width: var(--pdp-details-content-max-width);
}

/* Divider */
.pdp-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  width: 100%;
  margin: 0;
}

/* Benefits */
.pdp-benefits {
  list-style: none;
  padding: 0; margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pdp-benefits li {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: rgba(26,26,26,0.6);
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  line-height: 1.55;
}
.pdp-benefits li::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #b8a06a;
  margin-top: 0.55em;
  flex-shrink: 0;
}

/* Details: short-description, color: component-secondary-text-color */
.pdp-details__desc {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  line-height: 1.375rem;
  color: rgba(26,26,26,0.6);
  text-align: center;
  width: 100%;
  margin: 0;
}

/* Summary block — gap var(--small-l) */
.pdp-details__summary {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.pdp-details__size-label {
  font-family: var(--font-secondary);
  font-size: 0.8125rem;
  color: rgba(26,26,26,0.45);
  margin: 0;
}
.pdp-details__sizes { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Size button chips style */
.pdp-size-btn {
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 3px;
  padding: 0.5rem 1.375rem;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: #1a1a1a;
  background: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  line-height: 1;
}
.pdp-size-btn:hover { border-color: #1a1a1a; }
.pdp-size-btn.is-active { border-color: #1a1a1a; background: #1a1a1a; color: #fff; }

.pdp-details__price {
  font-family: var(--font-secondary);
  font-size: 1.0625rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
}

/* Actions — Details: actions-wrapper > pdp-details__actions
   align-self:center, max-width:25rem, gap:var(--medium-s) */
.pdp-details__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* var(--medium-s) */
  max-width: 25rem;
  width: 100%;
}

/* add-to-cart — Exact class + style */
.pdp-btn-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3rem; /* var(--medium-xl) */
  padding: 0 1.5rem;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.pdp-btn-cart:hover { opacity: 0.82; }

/* store-availability-button — Exact secondary button */
.pdp-btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3rem;
  padding: 0 1.5rem;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 4px;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.pdp-btn-store:hover { border-color: #1a1a1a; }

/* ── Accordion section — full-width, căn giữa, design riêng ── */
.pdp-accordion-section {
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 3rem 1.5rem 4rem;
}
@media (min-width: 1024px) {
  .pdp-accordion-section {
    padding: 4rem 0 5rem;
  }
}
.pdp-accordion-section__label {
  font-family: var(--font-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(26,26,26,0.65);
  text-align: center;
  margin: 0 0 2rem;
  font-weight: 500;
}
.pdp-accordion-section .pdp-accordion {
  max-width: 44rem;
  margin: 0 auto;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* ── Accordion (description tabs) ── */
.pdp-accordion {
  width: 100%;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.pdp-accordion__item { border-bottom: 1px solid rgba(0,0,0,0.08); }
.pdp-accordion__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  background: none;
  border: none;
  font-family: var(--font-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
}
.pdp-accordion__chevron {
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.3s ease, opacity 0.3s;
}
.pdp-accordion__item.is-open .pdp-accordion__chevron {
  transform: rotate(180deg);
  opacity: 1;
}
.pdp-accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  line-height: 1.75;
  color: rgba(26,26,26,0.6);
}
.pdp-accordion__item.is-open .pdp-accordion__body {
  max-height: 600px;
  padding-bottom: 1.125rem;
}

/* ══════════════════════════════════════════════
   ZOOM OVERLAY
══════════════════════════════════════════════ */
.pdp-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(245,245,243,0.97);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.pdp-zoom-overlay.is-open { display: flex; }
.pdp-zoom-overlay__close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none; border: none;
  cursor: pointer;
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
}
.pdp-zoom-overlay__img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: zoom-out;
}

/* ══════════════════════════════════════════════
   CROSS-SELL
══════════════════════════════════════════════ */
.pdp-crosssell { padding: 4rem 1.5rem 5rem; background: #fff; }
@media (min-width: 1024px) { .pdp-crosssell { padding: 5rem 4rem 6rem; } }
.pdp-crosssell__title {
  font-family: var(--font-primary);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: #1a1a1a;
  margin: 0 0 2.5rem;
  text-align: center;
}
.pdp-crosssell__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1rem;
}
@media (min-width: 768px) {
  .pdp-crosssell__grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}
.pdp-crosssell__card { text-decoration: none; display: block; }
.pdp-crosssell__img-wrap {
  aspect-ratio: 3/4;
  background: #f5f5f3;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}
.pdp-crosssell__img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 14px;
  transition: transform 0.55s ease;
}
.pdp-crosssell__card:hover .pdp-crosssell__img-wrap img { transform: scale(1.04); }
.pdp-crosssell__name {
  font-family: var(--font-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 0.2rem;
}
.pdp-crosssell__sub {
  font-family: var(--font-secondary);
  font-size: 0.8125rem;
  color: rgba(26,26,26,0.5);
  font-style: italic;
  margin: 0;
}

/* ──────────────────────────────────────────────
   RESPONSIVE — MOBILE
   ────────────────────────────────────────────── */
@media screen and (max-width: 767px) {

  /* Above the fold: stack vertically, single col */
  .pdp__above-the-fold {
    grid-template-columns: 1fr;
  }

  /* Gallery: full width single col */
  .pdp-gallery {
    grid-column: 1 / -1;
  }

  /* Primary carousel full width */
  .pdp-gallery__carousel--primary {
    width: 100%;
  }

  /* Info panel: full width, comfortable padding */
  .pdp-info {
    padding: 1.5rem 1rem 2rem;
  }
  .pdp-info__inner {
    padding-inline: 0;
    max-width: 100%;
  }

  /* Title */
  .pdp-info__title {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
  }

  /* Accordion: ensure content not clipped on small phones */
  .pdp-accordion__item.is-open .pdp-accordion__body {
    max-height: 1200px;
  }

  /* Breadcrumb */
  .pdp-breadcrumb { padding: 0.75rem 1rem; font-size: 0.75rem; }

  /* Cross-sell */
  .pdp-crosssell {
    padding: 2.5rem 1rem 3rem;
  }
  .pdp-crosssell__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
  }

  /* Zoom overlay — full screen on mobile */
  .pdp-zoom-overlay__img {
    max-width: 96vw;
    max-height: 80vh;
  }
}

@media screen and (max-width: 480px) {

  .pdp-info { padding: 1rem 0.75rem 2rem; }

  .pdp-info__title {
    font-size: 1.25rem;
  }

  .pdp-btn-cart, .pdp-btn-store {
    height: 2.75rem;
    font-size: 0.8125rem;
  }

  .pdp-crosssell { padding: 2rem 0.75rem 2.5rem; }
  .pdp-crosssell__name { font-size: 0.875rem; }
  .pdp-crosssell__grid { gap: 0.75rem 0.5rem; }
}

/* ──────────────────────────────────────────────
   TOUCH — disable zoom cursor on touch devices
   ────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .pdp-zoom-overlay__img { cursor: default; }
  .pdp-crosssell__card:hover .pdp-crosssell__img-wrap img { transform: none; }
}
