/* ==========================================================================
   SunTeam v2 — product page extras (zoom, actions, popularity, bought together, reviews)
   ========================================================================== */

/* ---------- zoom ---------- */
.zoomable { cursor: zoom-in; position: relative; overflow: hidden; }
.zoom-lens { position: absolute; z-index: 3; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%; pointer-events: none; background-repeat: no-repeat; background-color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sun-400), 0 20px 40px -10px rgba(17,19,24,.45); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.zoomable.is-zooming .zoom-lens { opacity: 1; transform: none; }
.zoom-hint { position: absolute; z-index: 2; bottom: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(17,19,24,.72); color: #fff; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; opacity: .85; transition: opacity .2s; }
.zoomable.is-zooming .zoom-hint { opacity: 0; }

.zoom-dlg { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(250,249,245,.97); display: none; }
.zoom-dlg[open] { display: block; }
.zoom-dlg::backdrop { background: transparent; }
.zoom-pan { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.zoom-pan img { max-width: 92vw; max-height: 86vh; object-fit: contain; transition: transform .25s var(--ease); mix-blend-mode: multiply; }
.zoom-pan.can-pan { cursor: move; }
.zoom-tools { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: #111318; color: #fff; box-shadow: var(--sh-3, 0 20px 40px -20px rgba(0,0,0,.5)); }
.zoom-tools button { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.zoom-tools button:hover { background: var(--sun-400); color: #111318; }
.zoom-tools span { min-width: 54px; text-align: center; font-weight: 800; font-size: var(--fs-sm); }
.zoom-dlg .video-x { position: fixed; background: #111318; color: #fff; }

/* ---------- media actions (video / catalog / share) ---------- */
.pdp-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.pa-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-weight: 800; font-size: var(--fs-sm); color: var(--text); text-align: start; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.pa-btn small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--text-3); }
.pa-btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--sun-400), var(--sh-1); }
.pa-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--amber-soft); color: var(--accent-ink); }
.pa-video .pa-ico { background: #111318; color: var(--sun-400); }
.pa-video .pa-ico .ic { fill: currentColor; }

/* ---------- rating link in meta ---------- */
.pdp-rate { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.pdp-rate b { font-weight: 900; }
.stars { display: inline-flex; gap: 2px; direction: ltr; }
.stars i { position: relative; width: 18px; height: 18px; background: #E4E2DA; -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.stars i::after { content: ""; position: absolute; inset: 0; width: var(--f); background: #F5B400; }
.stars.sm i { width: 14px; height: 14px; }
:root { --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z'/%3E%3C/svg%3E"); }
.stars[dir], .rv .stars { direction: rtl; }
.stars i::after { right: 0; left: auto; }

/* ---------- popularity ---------- */
.pop { padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, var(--sun-50), var(--surface)); box-shadow: inset 0 0 0 1px var(--line); }
.pop-head { display: flex; align-items: center; gap: 12px; }
.pop-ico { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: #111318; color: var(--sun-400); }
.pop-head div { flex: 1; min-width: 0; }
.pop-head b { display: block; font-weight: 900; }
.pop-head small { color: var(--text-3); font-size: var(--fs-xs); }
.pop-score { font-size: 1.6rem; font-weight: 900; color: var(--accent-ink); line-height: 1; }
.pop-score small { font-size: .8rem; }
.pop-bar { position: relative; height: 10px; margin: 12px 0 8px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.pop-bar span { position: absolute; inset: 0; width: calc(var(--s) * 1%); border-radius: inherit; background: linear-gradient(90deg, #FFE45C, #F2C200 60%, #E08A00); animation: pop-fill 1.4s var(--ease) both; }
.pop-bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: pop-shine 2.4s ease-in-out infinite; }
.pop-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--text-2); }
.pop-foot span { display: inline-flex; align-items: center; gap: 4px; }
.pop-foot .up { color: var(--mint); }
.pop-foot .down { color: var(--rose, #F04438); }
.pop-foot .down .ic { transform: scaleY(-1); }
@keyframes pop-fill { from { width: 0; } }
@keyframes pop-shine { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ---------- in-page tabs ---------- */
.pdp-tabs { position: sticky; top: 86px; z-index: 10; display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 34px auto 18px; padding: 5px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--sh-2); overflow-x: auto; scrollbar-width: none; }
.pdp-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding-inline: 14px; border-radius: 999px; font-weight: 700; font-size: var(--fs-sm); color: var(--text-2); }
.pdp-tabs a:hover { background: var(--surface-sunk); color: var(--text); }
.pdp-tabs .num { padding: 0 7px; border-radius: 999px; background: var(--sun-400); color: #111318; font-size: var(--fs-xs); }
#desc, #video, #together, #reviews, #related { scroll-margin-top: 150px; }

.pdp-video { margin-top: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pdp-video video { width: 100%; max-height: 70vh; border-radius: 18px; background: #000; }

/* ---------- frequently bought together ---------- */
.fbt { margin-top: 40px; }
.fbt-row { display: flex; align-items: stretch; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.fbt-item { flex: 1 1 0; min-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center; transition: transform .3s var(--ease), box-shadow .3s; }
a.fbt-item:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1.5px var(--sun-400), var(--sh-2); }
.fbt-item.is-self { background: var(--sun-50); box-shadow: inset 0 0 0 1.5px var(--sun-400); }
.fbt-item img { width: 110px; height: 110px; object-fit: contain; mix-blend-mode: multiply; }
.fbt-item b { font-size: var(--fs-sm); line-height: 1.7; }
.fbt-share { padding: 2px 10px; border-radius: 999px; background: var(--mint-soft); color: var(--mint); font-size: var(--fs-xs); font-weight: 800; }
.fbt-price { font-weight: 900; font-size: var(--fs-sm); margin-top: auto; }
.fbt-plus { align-self: center; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #111318; color: var(--sun-400); }

/* ---------- reviews ---------- */
.rv { margin-top: 44px; }
.rv-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.rv-summary { position: sticky; top: 150px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.rv-avg { display: flex; align-items: center; gap: 14px; }
.rv-avg > b { font-size: 3rem; font-weight: 900; line-height: 1; }
.rv-avg div { display: flex; flex-direction: column; gap: 4px; }
.rv-avg .stars i { width: 20px; height: 20px; }
.rv-avg .muted { font-size: var(--fs-xs); }
.rv-dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-dist li { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.rv-dist li .ic { color: #F5B400; fill: currentColor; }
.rv-dist i { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-sunk); position: relative; overflow: hidden; }
.rv-dist i::after { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--w); border-radius: inherit; background: #F5B400; }
.rv-dist small { width: 24px; text-align: center; }
.rv-rec { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--mint-soft); color: var(--mint); font-size: var(--fs-sm); }
.rv-rec span { color: var(--text); }
.rv-gate { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.rv-gate p { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.9; margin: 0; }
.rv-gate p .ic { flex: none; margin-top: 4px; color: var(--accent-ink); }
.rv-gate .gate-lock { padding: 12px; border-radius: 14px; background: var(--amber-soft); color: var(--text); }
.btn-block { width: 100%; justify-content: center; }

.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-item { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.rv-item.is-pending { box-shadow: inset 0 0 0 1.5px dashed var(--line-strong); opacity: .85; }
.rv-item header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-item header .stars { margin-inline-start: auto; }
.rv-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--accent-ink); font-weight: 900; }
.rv-who { display: flex; flex-direction: column; }
.rv-who small { color: var(--text-3); font-size: var(--fs-xs); }
.rv-item h3 { font-size: var(--fs-md); font-weight: 800; }
.rv-item p { color: var(--text-2); line-height: 2; margin: 0; }
.rv-media { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-media img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; }
.rv-item footer { display: flex; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: var(--fs-sm); }
.rv-yes { display: inline-flex; align-items: center; gap: 4px; color: var(--mint); font-weight: 700; }
.rv-no { display: inline-flex; align-items: center; gap: 4px; color: var(--rose, #F04438); font-weight: 700; }
.rv-help { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding-inline: 12px; border: 0; border-radius: 999px; background: var(--surface-sunk); font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); cursor: pointer; }
.rv-help.is-on { background: #111318; color: var(--sun-400); }
.rv-help.is-on .ic { fill: currentColor; }
.rv-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px; text-align: center; color: var(--text-2); }
.rv-empty > .ic { width: 40px; height: 40px; color: var(--text-3); }
.rv-empty span { font-size: var(--fs-sm); color: var(--text-3); }

.rv-form { padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset 0 0 0 1.5px var(--sun-400), var(--sh-2); }
.rv-form[hidden] { display: none; }
.rv-form h3 { font-weight: 900; }
.rv-form .field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 700; }
.rv-pick { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 4px; }
.rv-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rv-pick label { cursor: pointer; color: #E4E2DA; transition: transform .15s; }
.rv-pick label .ic { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.rv-pick label:hover, .rv-pick label:hover ~ label, .rv-pick input:checked ~ label { color: #F5B400; }
.rv-pick label:hover { transform: scale(1.15); }
.rv-pick-label { order: -1; margin-inline-end: auto; font-weight: 800; color: var(--accent-ink); }
.rv-form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rv-form .seg label { display: inline-flex; }
.rv-form .seg input { position: absolute; opacity: 0; }
.rv-form .seg span { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding-inline: 12px; border-radius: 999px; font-weight: 700; font-size: var(--fs-sm); color: var(--text-3); cursor: pointer; }
.rv-form .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.rv-file { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding-inline: 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.rv-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rv-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rv-form-foot small { display: inline-flex; align-items: center; gap: 4px; }

@media (prefers-reduced-motion: reduce) { .pop-bar span, .pop-bar span::after { animation: none; } }
@media (max-width: 960px) {
  .rv-grid { grid-template-columns: 1fr; }
  .rv-summary { position: static; }
  .pdp-tabs { top: 76px; }
}
@media (max-width: 560px) {
  .zoom-hint { display: none; }
  .fbt-item { min-width: 140px; }
  .fbt-item img { width: 84px; height: 84px; }
  .rv-item header .stars { margin-inline-start: 0; width: 100%; }
}
