/* ===========================
   Under Bro – pdp.css (trang sản phẩm tĩnh, mobile-first)
   =========================== */
.ub-main { padding-bottom: 24px; }

.ub-crumbs ol { list-style: none; display: block; margin: 0; padding: 4px 0; font-size: 0.875rem; color: var(--ub-muted); line-height: 1.4; }
.ub-crumbs li { display: inline; }
.ub-crumbs li + li::before { content: '›'; margin: 0 8px; color: rgba(255, 255, 255, 0.4); }
.ub-crumbs a { text-decoration: none; display: inline-block; padding: 12px 0; }
.ub-crumbs a:hover { color: var(--gold); }
.ub-crumbs li[aria-current] { color: #fff; }

.pdp { display: grid; gap: 20px; padding-bottom: 28px; }

/* ----- Gallery ----- */
.pdp-gallery { display: grid; gap: 10px; min-width: 0; }
.pdp-thumbs { display: none; }
.pdp-stage { position: relative; border-radius: 16px; overflow: hidden; background: var(--ub-card); }
.pdp-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; aspect-ratio: 1 / 1;
}
.pdp-track::-webkit-scrollbar { display: none; }
.pdp-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.pdp-slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; cursor: zoom-in; }
.pdp-badge { z-index: 3; }
.pdp-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 20px; }
.pdp-pager .pdp-dots { grid-column: 2; }
.pdp-counter { grid-column: 3; justify-self: end; color: var(--ub-muted); font: 600 0.875rem/1 var(--ub-font); }
.pdp-zoom-hint {
  position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center;
  background: rgba(10, 10, 10, 0.6); color: #fff; border: 0; border-radius: 50%; cursor: pointer;
}
.pdp-dots { display: flex; justify-content: center; gap: 6px; min-height: 14px; }
.pdp-dots .ub-dot { width: 14px; height: 14px; }
.pdp-dots .ub-dot::before { width: 8px; height: 8px; }
.pdp-dots .ub-dot.is-active::before { width: 20px; }

/* ----- Buy column ----- */
.pdp-buy { min-width: 0; }
.pdp-cat { margin: 0 0 6px; color: var(--gold); font: 600 0.8125rem/1 var(--ub-font); letter-spacing: 0.16em; text-transform: uppercase; }
.pdp-title { margin: 0 0 8px; font: 700 clamp(1.75rem, 7vw, 2.5rem)/1.08 var(--ub-display); letter-spacing: 0.01em; text-transform: uppercase; text-wrap: balance; }
.pdp-sold { margin: 0 0 10px; color: #fff; font-size: 0.9375rem; font-weight: 600; }
.pdp-sold span { color: var(--ub-muted); font-weight: 400; }
.pdp-price-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 6px 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--ub-card); border: 1px solid var(--ub-line); }
.pdp-price { font: 700 2.25rem/1 var(--ub-display); letter-spacing: 0.01em; }
.pdp-old { color: var(--ub-muted); font-size: 1.125rem; }
.pdp-save { flex-basis: 100%; width: fit-content; padding: 5px 12px; border-radius: 999px; background: rgba(201, 168, 76, 0.16); color: var(--gold); font-weight: 700; font-size: 0.9375rem; }
.pdp-summary { margin: 0 0 12px; color: var(--ub-muted); font-size: 1.0625rem; line-height: 1.6; }
.pdp-points { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.pdp-points li { position: relative; padding-left: 26px; line-height: 1.45; }
.pdp-points li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; }

.pdp-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-weight: 600; }
.pdp-qty { display: inline-flex; align-items: center; border: 1px solid var(--ub-line); border-radius: 999px; }
.pdp-qty button { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; border-radius: 50%; touch-action: manipulation; }
.pdp-qty button:hover { color: var(--gold); }
.pdp-qty input { width: 52px; height: 48px; text-align: center; background: none; border: 0; color: #fff; font-size: 16px; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.pdp-qty input::-webkit-outer-spin-button, .pdp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp-cta { display: grid; gap: 10px; }

.pdp-assure { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--ub-line); display: grid; gap: 8px; color: var(--ub-muted); font-size: 0.9375rem; }
.pdp-assure li { position: relative; padding-left: 24px; }
.pdp-assure li::before { content: ''; position: absolute; left: 2px; top: 0.45em; width: 10px; height: 6px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
.pdp-assure a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ----- Accordion ----- */
.pdp-details { border-bottom: 1px solid var(--ub-line); margin-top: 8px; }
.pdp-acc { border-top: 1px solid var(--ub-line); }
.pdp-acc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; cursor: pointer; list-style: none; }
.pdp-acc summary::-webkit-details-marker { display: none; }
.pdp-acc summary h2 { margin: 0; font: 700 1.375rem/1.1 var(--ub-display); letter-spacing: 0.05em; text-transform: uppercase; }
.pdp-acc[open] .ub-chev { transform: rotate(180deg); }
.pdp-acc-body { padding: 0 0 20px; color: var(--ub-muted); line-height: 1.75; max-width: 780px; }
.pdp-acc-body p { margin: 0 0 12px; }
.pdp-specs { width: 100%; border-collapse: collapse; }
.pdp-specs th, .pdp-specs td { padding: 11px 0; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.pdp-specs th { width: 42%; color: #fff; font-weight: 600; padding-right: 12px; }
.pdp-list, .pdp-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pdp-qa { margin-bottom: 16px; }
.pdp-qa h3 { margin: 0 0 4px; color: #fff; font-size: 1.0625rem; font-weight: 600; }
.pdp-qa p { margin: 0; }

.pdp-rec { margin-top: 36px; }
.pdp-rec .ub-h2 { margin-bottom: 14px; }

/* ----- Sticky buy bar (mobile) ----- */
.pdp-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + var(--ub-safe-b));
  background: rgba(14, 14, 16, 0.97); border-top: 1px solid var(--ub-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translateY(110%); transition: transform 0.28s var(--ub-ease);
}
.pdp-sticky.is-visible { transform: none; }
.pdp-sticky-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdp-sticky-name { font-size: 0.8125rem; color: var(--ub-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdp-sticky-price { font: 700 1.25rem/1.2 var(--ub-display); }
.pdp-sticky .ub-btn { min-height: 48px; padding: 0 16px; white-space: nowrap; }

/* ----- Lightbox ----- */
.pdp-lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, 0.96); display: flex; flex-direction: column; visibility: hidden; opacity: 0; transition: opacity 0.2s, visibility 0s 0.2s; }
.pdp-lightbox.is-open { visibility: visible; opacity: 1; transition: opacity 0.2s, visibility 0s; }
.pdp-lb-close { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; z-index: 2; background: rgba(255, 255, 255, 0.12); border-radius: 50%; }
.pdp-lb-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; -webkit-overflow-scrolling: touch; }
.pdp-lb-scroll img { width: 100%; max-width: 100vw; max-height: 100%; height: auto; object-fit: contain; cursor: zoom-in; }
.pdp-lb-scroll img.is-zoomed { width: 220%; max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.pdp-lb-hint { margin: 0; padding: 10px 16px calc(12px + var(--ub-safe-b)); text-align: center; color: var(--ub-muted); font-size: 0.8125rem; }

/* ----- Tablet / desktop ----- */
@media (min-width: 768px) {
  .pdp-sticky { display: none; }
  body.ub-page.has-sticky { padding-bottom: 0; }
  .pdp-cta { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 48px; }
  .pdp-gallery { grid-template-columns: 76px minmax(0, 1fr); align-items: start; position: sticky; top: 92px; }
  .pdp-thumbs { display: flex; flex-direction: column; gap: 8px; max-height: min(78vh, 640px); overflow-y: auto; scrollbar-width: none; }
  .pdp-thumbs::-webkit-scrollbar { display: none; }
  .pdp-thumb { width: 76px; height: 76px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--ub-card); cursor: pointer; flex-shrink: 0; }
  .pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .pdp-thumb.is-active { border-color: var(--gold); }
  .pdp-pager { display: none; }
  .pdp-title { font-size: 2.75rem; }
  .pdp-price { font-size: 2.75rem; }
}

/* ----- Đánh giá từ Shopee ----- */
.pdp-reviews { margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--ub-line); }
.pdp-reviews .ub-h2 { margin: 20px 0 14px; }
.rv-summary { display: grid; gap: 18px; padding: 18px; border-radius: 16px; background: var(--ub-card); border: 1px solid var(--ub-line); }
.rv-score { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.rv-avg { font: 700 3.25rem/1 var(--ub-display); }
.rv-count { color: var(--ub-muted); font-size: 0.9375rem; }
.rv-stars { --pct: 100%; position: relative; display: inline-block; font-size: 1.25rem; line-height: 1; letter-spacing: 2px; color: rgba(255, 255, 255, 0.22); }
.rv-stars > span { background: linear-gradient(90deg, var(--gold) var(--pct), rgba(255, 255, 255, 0.22) var(--pct)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.rv-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: center; }
.rv-bars li { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; font-size: 0.875rem; color: var(--ub-muted); }
.rv-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.rv-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.rv-bar-n { text-align: right; }
.rv-source { margin: 12px 0 4px; color: var(--ub-muted); font-size: 0.875rem; }
.rv-note { margin: 4px 0 14px; color: var(--ub-muted); font-size: 0.875rem; }
.rv-list { margin-top: 12px; }
.rv-list > * { flex: 0 0 82vw; max-width: 380px; }
.rv-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--ub-card); border: 1px solid var(--ub-line); }
.rv-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-card-top time { color: var(--ub-muted); font-size: 0.8125rem; }
.rv-text { margin: 0; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.rv-name { margin: auto 0 0; font-size: 0.875rem; font-weight: 600; }
.rv-name span { color: var(--ub-muted); font-weight: 400; }
.rv-more { margin-top: 4px; width: 100%; }
@media (min-width: 768px) {
  .rv-summary { grid-template-columns: 220px 1fr; align-items: center; gap: 32px; padding: 24px; }
  .rv-list { grid-template-columns: repeat(3, 1fr); }
  .rv-list > * { max-width: none; }
  .rv-more { width: auto; }
}

/* ----- Đánh giá: danh sách dọc, lọc theo sao, "Xem thêm" ----- */
.rv-list { display: grid; gap: 12px; margin-top: 14px; }
.rv-list > * { flex: none; max-width: none; }
.rv-card[hidden] { display: none; }
.rv-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rv-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: #fff; font: 600 0.9375rem/1 var(--ub-font); cursor: pointer; touch-action: manipulation; }
.rv-chip span { color: var(--ub-muted); font-weight: 400; }
.rv-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #0a0a0a; }
.rv-chip[aria-pressed="true"] span { color: #0a0a0a; }
.rv-chip:disabled { opacity: 0.4; cursor: default; }
.rv-empty { margin: 14px 0 0; color: var(--ub-muted); }
.rv-more { margin-top: 14px; width: 100%; }
@media (min-width: 768px) {
  .rv-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .rv-more { width: auto; }
}
