/* =====================================================================
   SEMA BAY — product viewer (with viewer.js)   V21: the owner's product preview design
   Phone (most buyers): a rounded card over the page —
     photo with ✕ (left), ♡ and share (right), a navy › / ‹, "1 / 3" counter · thumbnails ·
     Low Stock badge · name · "Only N left" · price, old price, −% · quantity − 1 + · Add to Cart ·
     "Sold by" card (shop, city, phone, ›) with Chat on WhatsApp · About this product (folded).
   Laptop: photo and thumbnails on the left, the same details on the right.
   Zoom: tap/click the photo, pinch or scroll; swipe for the next photo; ← → keys; Esc closes.
   ===================================================================== */
html.pv-locked{overflow:hidden}
.pv{--pv-navy:#0b2a6b;--pv-green:#03892e;--pv-orange:#f26b0f;--pv-blue:#1f6fff;
  position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;padding:24px;background:rgba(10,22,60,0);transition:background .18s ease;
  font-family:"Inter","Segoe UI",system-ui,-apple-system,sans-serif;color:#0b1033}
.pv.is-open{background:rgba(10,22,60,.55)}
.pv[hidden]{display:none}
.pv-box{position:relative;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);width:min(1080px,100%);height:min(720px,100%);
  border-radius:26px;overflow:hidden;background:#fff;box-shadow:0 24px 70px rgba(0,0,0,.35);opacity:0;transform:translateY(14px) scale(.985);transition:opacity .18s ease,transform .18s ease}
.pv.is-open .pv-box{opacity:1;transform:none}
.pv-box:focus{outline:none}
@media (prefers-reduced-motion:reduce){.pv,.pv-box{transition:none}}
.pv button:focus-visible,.pv a:focus-visible,.pv summary:focus-visible{outline:3px solid #ff8a00;outline-offset:2px}

/* ---- photo ---- */
.pv-media{display:flex;flex-direction:column;min-height:0;min-width:0;padding-bottom:12px;background:#fff}
.pv-stage{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:#fff;cursor:zoom-in;touch-action:none;user-select:none;outline:0}
.pv-stage.zoomed{cursor:grab}.pv-stage.zoomed:active{cursor:grabbing}
.pv-stage:focus-visible{box-shadow:inset 0 0 0 3px #ff8a00}
.pv-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transform-origin:0 0;transition:transform .12s ease-out;will-change:transform;pointer-events:none}
.pv-stage.empty{cursor:default}
.pv-stage.empty::after{content:attr(data-empty);position:absolute;inset:0;display:grid;place-items:center;color:#8a93a8;font-size:15px;font-weight:700}
/* the round white buttons: ✕ top-left, ♡ and share top-right */
.pv-round{display:grid;place-items:center;width:52px;height:52px;padding:0;border:0;border-radius:50%;background:#fff;color:#0b1647;cursor:pointer;box-shadow:0 4px 16px rgba(10,20,60,.16)}
.pv-round svg{width:24px;height:24px}
.pv-x{position:absolute;left:14px;top:14px;z-index:3}
.pv-acts{position:absolute;right:14px;top:14px;z-index:3;display:flex;gap:12px}
.pv-fav.on{--pv-heart:#e8202d;color:#e8202d}
.pv-fav.on svg{animation:pvPop .25s ease}
@keyframes pvPop{50%{transform:scale(1.25)}}
/* navy arrows (only the ones that lead somewhere) */
.pv-nav{position:absolute;top:50%;z-index:2;display:grid;place-items:center;width:54px;height:54px;margin-top:-27px;border:0;border-radius:50%;background:var(--pv-navy);color:#fff;cursor:pointer;box-shadow:0 6px 18px rgba(11,42,107,.35)}
.pv-nav.prev{left:14px}.pv-nav.next{right:14px}
.pv-nav svg{width:26px;height:26px}
.pv-nav[hidden],.pv-count[hidden]{display:none}
.pv-count{position:absolute;right:14px;bottom:12px;z-index:2;padding:6px 14px;border-radius:999px;background:rgba(80,92,112,.8);color:#fff;font-size:15px;font-weight:700;letter-spacing:.04em}
.pv-zoom{position:absolute;left:14px;bottom:12px;z-index:2;display:flex;gap:6px}
.pv-zoom button{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:12px;background:rgba(255,255,255,.95);color:#0b1f5c;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.pv-zoom svg{width:18px;height:18px}
.pv-stage.empty .pv-zoom{display:none}
/* thumbnails: centred, the shown photo has a blue frame */
.pv-thumbwrap{position:relative;flex:none;padding:10px 14px 0}
.pv-thumbwrap[hidden]{display:none}
.pv-thumbs{display:flex;justify-content:safe center;gap:12px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;padding:2px}
.pv-thumbs::-webkit-scrollbar{display:none}
.pv-thumbs button{flex:none;width:96px;aspect-ratio:1.25/1;padding:4px;border:1.5px solid #e1e6ef;border-radius:12px;overflow:hidden;background:#fff;cursor:pointer}
.pv-thumbs button[aria-selected="true"]{border:2.5px solid var(--pv-blue);padding:3px}
.pv-thumbs img{width:100%;height:100%;object-fit:contain;display:block}
.pv-tnav{position:absolute;top:calc(50% + 5px);z-index:2;display:grid;place-items:center;width:26px;height:46px;margin-top:-23px;border:1px solid #d5dbe8;border-radius:10px;background:rgba(255,255,255,.97);color:#1b2440;cursor:pointer}
.pv-tnav.prev{left:4px}.pv-tnav.next{right:4px}
.pv-tnav svg{width:16px;height:16px}
.pv-tnav[hidden]{display:none}

/* ---- details ---- */
.pv-info{min-height:0;min-width:0;overflow:auto;padding:22px 22px 18px;display:flex;flex-direction:column;gap:10px}
.pv-badges{display:flex;flex-wrap:wrap;gap:8px}
.pv-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;background:#eef2ff;color:#2a3b8f;font-size:15px;font-weight:700}
.pv-badge svg{width:20px;height:20px}
.pv-badge.low{background:#ffe8dc;color:var(--pv-orange)}
.pv-badge.out{background:#fdecec;color:#b91c1c}
.pv-info h2{margin:0;font-size:32px;font-weight:800;line-height:1.1;color:#0b1647;letter-spacing:-.015em}
.pv-left{margin:-4px 0 0;font-size:20px;font-weight:700;color:var(--pv-green)}
.pv-left.low{color:var(--pv-orange)}
/* price · quantity · Add to Cart on one line (wraps on narrow screens) */
.pv-buyrow{display:flex;flex-wrap:wrap;align-items:center;gap:12px 14px;margin-top:4px;padding-top:14px;border-top:1px solid #eef0f5}
.pv-price{margin:0;display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;flex:1 1 auto}
.pv-price b{font-size:40px;font-weight:800;color:var(--pv-green);letter-spacing:-.02em;line-height:1}
.pv-price s{font-size:19px;font-weight:600;color:#7c8098}
.pv-off{padding:4px 10px;border-radius:999px;background:#e8202d;color:#fff;font-size:17px;font-weight:800}
.pv-tax{margin:-4px 0 0;font-size:13px;color:#6b7389;font-weight:600}
.pv-buy{display:flex;align-items:center;gap:12px;flex:1 1 300px}
.pv-qty{flex:none;display:flex;align-items:center;gap:6px;height:58px;padding:0 6px;border:1.5px solid #e1e6ef;border-radius:16px;background:#fff}
.pv-qty button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:#fff;color:#0b1647;cursor:pointer;box-shadow:0 2px 8px rgba(10,20,60,.12)}
.pv-qty button svg{width:20px;height:20px}
.pv-qty button:disabled{opacity:.35;cursor:not-allowed;box-shadow:none}
.pv-qty output{min-width:30px;text-align:center;font-size:20px;font-weight:700;color:#0b1647}
.pv-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:58px;padding:0 18px;border:0;border-radius:14px;font:inherit;font-size:20px;font-weight:800;text-decoration:none;cursor:pointer;white-space:nowrap;min-width:0}
.pv-btn svg{width:30px;height:30px;flex:none}
.pv-btn.yellow{flex:1 1 auto;background:#ffe600;color:#0b1647}.pv-btn.yellow:hover{background:#ffd800}
.pv-btn.ghost{flex:1 1 auto;background:#fff;color:#0b1f5c;border:1.5px solid #cfd5e2;font-size:17px}
.pv-btn.ghost svg{width:22px;height:22px}
.pv-soldmsg{flex:1;margin:0;padding:14px;border-radius:12px;background:#fdecec;color:#9b1c1c;font-size:15px;font-weight:600;text-align:center}
/* colour chips (when the seller gave colours) */
.pv-colours{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pv-colours>span{font-size:16px;font-weight:700;color:#0b1647;margin-right:2px}
.pv-colours button,.pv-colours i{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 14px 0 9px;border:1.5px solid #e1e6ef;border-radius:999px;background:#fff;color:#1b2440;font:inherit;font-size:15px;font-weight:500;font-style:normal;cursor:pointer}
.pv-colours i{cursor:default}
.pv-colours b{width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.18)}
.pv-colours button[aria-pressed="true"]{border-color:var(--pv-navy);background:var(--pv-navy);color:#fff}
.pv-colours small{font-weight:600;opacity:.75}
/* "Sold by" card: shop (opens its products), city, phone, Chat on WhatsApp */
.pv-seller{display:grid;gap:10px;padding:14px 16px;border-radius:18px;background:#eef3fc}
.pv-shop{display:flex;align-items:center;gap:16px;color:#0b1647;text-decoration:none}
.pv-shop-ic{flex:none;display:grid;place-items:center;width:52px;height:52px;color:#1d4fb8}
.pv-shop-ic svg{width:44px;height:44px}
.pv-shop-t{flex:1 1 auto;min-width:0;display:grid;gap:1px;line-height:1.25}
.pv-shop-t small{font-size:15px;color:#6b7389}
.pv-shop-t b{font-size:21px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pv-shop-t i{display:flex;align-items:center;gap:6px;font-style:normal;font-size:16px;color:#6b7389}
.pv-shop-t i svg{width:18px;height:18px;color:#8a93a8;flex:none}
.pv-chev{flex:none;color:#0b1647}.pv-chev svg{width:24px;height:24px}
.pv-shop:hover .pv-shop-t b{text-decoration:underline}
.pv-seller-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.pv-tel{display:inline-flex;align-items:center;gap:12px;padding-left:8px;color:var(--pv-blue);font-size:21px;font-weight:800;text-decoration:none;white-space:nowrap}
.pv-tel svg{width:28px;height:28px;color:#1d4fb8}
.pv-tel:hover span{text-decoration:underline}
.pv-wa{display:inline-flex;align-items:center;gap:10px;min-height:52px;padding:0 16px;border:2px solid #22c55e;border-radius:14px;background:#fff;color:#16a34a;font-size:18px;font-weight:800;text-decoration:none;white-space:nowrap}
.pv-wa svg{width:30px;height:30px;color:#22c55e}
.pv-wa:hover{background:#f0fdf4}
.pv-about{border-radius:14px;background:#f6f7fa}
.pv-about summary{display:flex;align-items:center;justify-content:space-between;min-height:46px;padding:0 16px;font-size:16px;font-weight:700;color:#0b1647;cursor:pointer;list-style:none}
.pv-about summary::-webkit-details-marker{display:none}
.pv-about summary::after{content:"›";font-size:22px;transform:rotate(90deg);transition:transform .15s}
.pv-about[open] summary::after{transform:rotate(-90deg)}
.pv-desc{margin:0;padding:0 16px 14px;font-size:15px;line-height:1.55;color:#33394a;white-space:pre-line}

/* ---- phones and small tablets: one scrolling card, a little margin around it ---- */
@media (max-width:820px){
  .pv{padding:8px;place-items:stretch}
  .pv-box{display:flex;flex-direction:column;width:100%;height:100%;border-radius:24px;overflow-y:auto;overscroll-behavior:contain}
  .pv-media{flex:none;padding-bottom:4px}
  .pv-stage{flex:none;height:min(52vh,560px)}   /* JS sets the photo's own height */
  .pv-zoom{display:none}           /* pinch or tap to zoom on phones */
  .pv-info{flex:none;overflow:visible;padding:12px 16px calc(16px + env(safe-area-inset-bottom));gap:8px}
  .pv-info h2{font-size:28px}
  .pv-left{font-size:18px}
  .pv-price b{font-size:34px}
}
@media (max-width:480px){
  .pv-round{width:44px;height:44px}.pv-round svg{width:21px;height:21px}
  .pv-x{left:10px;top:10px}.pv-acts{right:10px;top:10px;gap:10px}
  .pv-nav{width:46px;height:46px;margin-top:-23px}.pv-nav.prev{left:10px}.pv-nav.next{right:10px}
  .pv-count{right:10px;bottom:8px;font-size:13px;padding:5px 11px}
  .pv-thumbs{gap:8px}.pv-thumbs button{width:76px}
  .pv-badge{font-size:14px;padding:5px 12px}
  .pv-price b{font-size:30px}.pv-price s{font-size:16px}.pv-off{font-size:15px}
  .pv-buy{flex-basis:100%;gap:10px}
  .pv-qty{height:52px}.pv-qty button{width:38px;height:38px}
  .pv-btn{min-height:52px;font-size:18px;padding:0 12px}.pv-btn svg{width:26px;height:26px}
  .pv-seller{padding:12px}
  .pv-shop{gap:12px}.pv-shop-ic{width:44px;height:44px}.pv-shop-ic svg{width:38px;height:38px}
  .pv-shop-t b{font-size:19px}.pv-shop-t small,.pv-shop-t i{font-size:14px}
  .pv-tel{font-size:18px;padding-left:4px;gap:8px}.pv-tel svg{width:24px;height:24px}
  .pv-wa{flex:1 1 auto;justify-content:center;min-height:48px;font-size:16px;padding:0 12px}.pv-wa svg{width:26px;height:26px}
  .pv-colours{gap:6px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px}
  .pv-colours::-webkit-scrollbar{display:none}
  .pv-colours button,.pv-colours i{flex:none;min-height:36px;font-size:14px}
}
@media (max-width:370px){.pv-seller-row{flex-direction:column;align-items:stretch}.pv-wa{justify-content:center}.pv-btn{font-size:16px}}
/* the shop's own product: switch between "Your view" and "Buyer view" (V24) */
.pv-viewas{display:inline-flex;align-self:flex-start;padding:4px;border-radius:999px;background:#eef1f7}
.pv-viewas button{min-height:36px;padding:0 16px;border:0;border-radius:999px;background:none;color:#4a5571;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.pv-viewas button[aria-pressed="true"]{background:#0b2a6b;color:#fff;box-shadow:0 2px 6px rgba(11,42,107,.3)}
.pv-asnote{margin:-2px 0 0;font-size:13px;font-weight:600;color:#6b7389}
