/* ==========================================================================
   Product page enhancements: swipe gallery, buy box, delivery check, read-more,
   compare cards, ask sheet, added-to-cart panel. Mobile first where it matters.
   ========================================================================== */

/* ---- swipe gallery (phones) ---- */
.sb-swipe { display: none; position: relative; }
.sb-swipe__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 22px; background: var(--sb-mist); -webkit-overflow-scrolling: touch; }
.sb-swipe__track::-webkit-scrollbar { display: none; }
.sb-swipe__slide { flex: 0 0 100%; margin: 0; aspect-ratio: 1 / 1; scroll-snap-align: center; display: grid; place-items: center; cursor: zoom-in; }
.sb-swipe__slide img { width: 88%; height: 88%; object-fit: contain; mix-blend-mode: multiply; }
.sb-swipe__badges { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.sb-swipe__dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.sb-swipe__dots i { width: 6px; height: 6px; border-radius: 3px; background: #CBD0D6; transition: width .25s var(--sb-ease), background-color .25s var(--sb-ease); }
.sb-swipe__dots i.is-on { width: 22px; background: var(--sb-graphite); }
.sb-swipe__hint { position: absolute; right: 12px; bottom: 34px; padding: 5px 10px; border-radius: var(--sb-r-pill); background: rgba(255,255,255,.92); font-size: var(--sb-t-12); color: var(--sb-slate); pointer-events: none; transition: opacity .3s var(--sb-ease); }
.sb-swipe.is-swiped .sb-swipe__hint { opacity: 0; }
@media (max-width: 960px) {
  .sb-gallery__stage, .sb-thumbs { display: none !important; }
  .sb-swipe { display: block; }
}

/* ---- lightbox: swipe between full-size images ---- */
.sb-lightbox.is-open { display: block; }
.sb-lb__track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.sb-lb__track::-webkit-scrollbar { display: none; }
.sb-lb__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; padding: 64px 16px; }
.sb-lb__slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sb-lb__count { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 6px 12px; border-radius: var(--sb-r-pill); background: var(--sb-mist); font-size: var(--sb-t-13); font-variant-numeric: tabular-nums; z-index: 2; }
.sb-lightbox__close { z-index: 3; background: var(--sb-mist); }

/* ---- title, chips, price ---- */
.sb-buy__title { margin-top: 10px; }
.sb-buy__short { display: none; }
@media (max-width: 760px) {
  .sb-buy__short { display: block; margin: 8px 0 0; font-size: 1.5rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1.15; }
  .sb-buy .sb-buy__title { margin-top: 6px; font-size: var(--sb-t-14); font-weight: 450; letter-spacing: 0; line-height: 1.45; color: var(--sb-slate); }
  .sb-tiles { display: flex !important; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--sb-gutter) * -1) !important; padding: 0 var(--sb-gutter); scroll-snap-type: x proximity; }
  .sb-tiles::-webkit-scrollbar { display: none; }
  .sb-tile { flex: none; display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; scroll-snap-align: start; }
  .sb-tile dt { font-size: 11px; margin-bottom: 2px; }
  .sb-tile dd { font-size: var(--sb-t-16) !important; }
  .sb-buy { gap: 18px; }
}
.sb-pricebox__fin { font-size: var(--sb-t-14); color: var(--sb-slate); }
.sb-stock--low::before { background: var(--sb-volt); box-shadow: 0 0 0 4px rgba(255,176,32,.2); }

/* ---- add to cart states ---- */
.sb-atc--single { grid-template-columns: 1fr; }
.sb-btn.is-busy { opacity: .7; pointer-events: none; }
.sb-btn.is-busy span::after { content: "…"; }
.sb-btn.is-added { --bg: var(--sb-ok); --bd: var(--sb-ok); --fg: var(--sb-white); }
.sb-btn.is-added span::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E"); }
.sb-paylist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--sb-t-12); color: var(--sb-slate); margin-top: -8px; }
.sb-paylist svg { width: 14px; height: 14px; color: var(--sb-ok); margin-right: 2px; }
.sb-paylist span { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--sb-line); background: var(--sb-white); font-weight: 600; color: var(--sb-ink); }

/* ---- delivery + ZIP ---- */
.sb-ship__row--eta b { font-weight: 650; }
.sb-zip { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--sb-line); }
.sb-zip input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--sb-line); font-size: var(--sb-t-16); background: var(--sb-white); }
.sb-zip input:focus { outline: none; border-color: var(--sb-ink); box-shadow: 0 0 0 3px rgba(14,16,19,.07); }
.sb-zip .sb-btn { min-height: 46px; padding: 0 18px; font-size: var(--sb-t-14); }
.sb-zip__out { grid-column: 1 / -1; margin: 0; font-size: var(--sb-t-14); }
.sb-zip__out:empty { display: none; }
.sb-zip__out.is-ok { color: var(--sb-ok); font-weight: 560; }
.sb-zip__out.is-bad { color: var(--sb-bad); font-weight: 560; }

/* ---- ask card actions ---- */
.sb-askcard { align-items: flex-start; }
.sb-askcard__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sb-askcard__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--sb-r-pill); border: 1px solid var(--sb-iron); background: var(--sb-carbon); color: var(--sb-white); font-size: var(--sb-t-13); font-weight: 600; text-decoration: none; cursor: pointer; }
.sb-askcard__btn:hover { border-color: #4A505B; }
.sb-askcard__btn svg { width: 15px; height: 15px; color: var(--sb-volt); }
.sb-askcard p a { text-decoration-color: var(--sb-volt); }

/* ---- section nav progress + shrink ---- */
.sb-secnav { position: sticky; }
.sb-secnav__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.sb-secnav__progress i { display: block; height: 100%; background: var(--sb-volt); transform-origin: left; transform: scaleX(0); }
@media (max-width: 760px) {
  body.sb-scrolled .sb-secnav .sb-container { height: 48px; }
  body.sb-scrolled .sb-secnav nav a { height: 48px; font-size: var(--sb-t-13); }
  .sb-secnav .sb-container, .sb-secnav nav a { transition: height .2s var(--sb-ease); }
}

/* ---- read more (phones) ---- */
.sb-clamp__more { display: none; }
@media (max-width: 760px) {
  .sb-clamp.is-clamped .sb-clamp__body { max-height: 560px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
  .sb-clamp--specs.is-clamped .sb-clamp__body { max-height: 480px; }
  .sb-clamp__more { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 14px; border-radius: var(--sb-r-pill); border: 1.5px solid var(--sb-line); background: var(--sb-white); font-weight: 600; cursor: pointer; }
  .sb-clamp__more[hidden] { display: none; }
}

/* ---- video + documents ---- */
.sb-video { position: relative; display: block; width: 100%; max-width: 72ch; aspect-ratio: 16 / 9; margin: 0 0 28px; padding: 0; border: 0; border-radius: 20px; overflow: hidden; cursor: pointer; background: var(--sb-graphite); }
.sb-video img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.sb-video__play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; background: var(--sb-volt); color: var(--sb-graphite); }
.sb-video__play svg { width: 28px; height: 28px; margin-left: 4px; }
.sb-video__frame { width: 100%; max-width: 72ch; aspect-ratio: 16 / 9; border: 0; border-radius: 20px; margin: 0 0 28px; }
.sb-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sb-docs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--sb-white); text-decoration: none; }
.sb-docs a:hover { box-shadow: inset 0 0 0 1.5px var(--sb-ink); }
.sb-docs svg { width: 18px; height: 18px; flex: none; order: 2; margin-left: auto; color: var(--sb-slate); }
.sb-docs b { display: block; font-size: var(--sb-t-14); font-weight: 600; }
.sb-docs small { color: var(--sb-slate); font-size: var(--sb-t-12); }

/* ---- planner extras ---- */
.sb-upsell { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--sb-carbon); border: 1px solid var(--sb-iron); }
.sb-upsell[hidden] { display: none; }
.sb-upsell__h { margin: 0 0 4px; font-size: var(--sb-t-13); font-weight: 600; color: var(--sb-volt); }
.sb-upsell__item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--sb-graphite); text-decoration: none; color: var(--sb-white); }
.sb-upsell__item:hover { box-shadow: inset 0 0 0 1.5px var(--sb-volt); }
.sb-upsell__item img { width: 56px; height: 56px; object-fit: contain; background: var(--sb-white); border-radius: 10px; padding: 4px; }
.sb-upsell__item b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--sb-t-13); font-weight: 600; line-height: 1.3; }
.sb-upsell__item small { display: block; margin-top: 3px; font-size: var(--sb-t-12); color: var(--sb-fog); font-variant-numeric: tabular-nums; }
.sb-gauge__foot { flex-wrap: wrap; }
.sb-gauge__share { background: none; border: 0; padding: 6px 0; color: var(--sb-white); font-size: var(--sb-t-14); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--sb-volt); text-underline-offset: 3px; }
@media (max-width: 560px) {
  .sb-apps { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .sb-app { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 12px; }
  .sb-app__ic { width: 38px; height: 38px; border-radius: 11px; }
  .sb-app__ic svg { width: 21px; height: 21px; }
  .sb-app__name { font-size: var(--sb-t-13); }
  .sb-app__w { font-size: 11px; }
  .sb-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--sb-gutter) * -1); padding-right: var(--sb-gutter); }
  .sb-presets::-webkit-scrollbar { display: none; }
  .sb-preset { flex: none; }
}

/* ---- compare: cards on phones ---- */
.sb-cmpcards, .sb-cmpnote { display: none; }
@media (max-width: 760px) {
  .sb-compare { display: none; }
  .sb-cmpcards { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: calc(var(--sb-gutter) * -1); padding-right: var(--sb-gutter); }
  .sb-cmpcards::-webkit-scrollbar { display: none; }
  .sb-cmpcard { scroll-snap-align: start; border: 1px solid var(--sb-line); border-radius: 20px; padding: 16px; background: var(--sb-white); }
  .sb-cmpcard.is-this { background: var(--sb-mist); border-color: var(--sb-mist); }
  .sb-cmpcard__top { display: grid; gap: 8px; text-decoration: none; margin-bottom: 8px; }
  .sb-cmpcard__top img { width: 96px; height: 96px; object-fit: contain; mix-blend-mode: multiply; }
  .sb-cmpcard__top .sb-badge { justify-self: start; }
  .sb-cmpcard__top b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--sb-t-14); font-weight: 600; line-height: 1.35; }
  .sb-cmpcard dl { margin: 0; }
  .sb-cmpcard dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sb-line); font-size: var(--sb-t-13); }
  .sb-cmpcard dt { color: var(--sb-slate); }
  .sb-cmpcard dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
  .sb-cmpcard .is-diff dd::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--sb-volt); vertical-align: 1px; }
  .sb-cmpnote { display: block; margin-top: 12px; font-size: var(--sb-t-12); color: var(--sb-slate); }
}

/* ---- breadcrumb becomes a back link on phones ---- */
@media (max-width: 760px) {
  .sb-crumbs li { display: none; }
  .sb-crumbs li:nth-child(2) { display: block; }
  .sb-crumbs li:nth-child(2)::before { content: "\2190"; margin-right: 6px; color: var(--sb-ink); }
  .sb-crumbs li:nth-child(2) a { font-weight: 600; color: var(--sb-ink); }
}

/* ---- questions: bottom sheet on phones ---- */
.sb-qa__ask, .sb-form__close { display: none; }
@media (max-width: 960px) {
  .sb-qa__ask { display: inline-flex; margin-top: 18px; }
  .sb-qa > .sb-form { display: none; }
  .sb-qa > .sb-form.is-sheet { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); background: var(--sb-white); box-shadow: 0 -24px 60px rgba(14,16,19,.3); animation: sb-sheet-up .28s var(--sb-ease) both; }
  .sb-form.is-sheet .sb-form__close { display: grid; place-items: center; position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sb-mist); cursor: pointer; }
  .sb-form.is-sheet .sb-form__close svg { width: 18px; height: 18px; }
  body.sb-sheet-open { overflow: hidden; }
  body.sb-sheet-open::after { content: ""; position: fixed; inset: 0; z-index: 94; background: rgba(14,16,19,.45); }
}
@keyframes sb-sheet-up { from { transform: translateY(100%); } }

/* ---- added-to-cart panel ---- */
.sb-added { position: fixed; inset: 0; z-index: 96; pointer-events: none; }
.sb-added__scrim { position: absolute; inset: 0; background: rgba(14,16,19,.45); opacity: 0; transition: opacity .25s var(--sb-ease); }
.sb-added__panel { position: absolute; right: 24px; top: 24px; width: min(420px, calc(100vw - 48px)); padding: 22px; border-radius: 24px; background: var(--sb-white); box-shadow: 0 30px 80px rgba(14,16,19,.3); display: grid; gap: 16px; transform: translateY(-12px); opacity: 0; transition: transform .3s var(--sb-ease), opacity .3s var(--sb-ease); outline: none; }
.sb-added.is-open { pointer-events: auto; }
.sb-added.is-open .sb-added__scrim { opacity: 1; }
.sb-added.is-open .sb-added__panel { transform: none; opacity: 1; }
.sb-added__head { display: flex; align-items: center; gap: 10px; }
.sb-added__head b { font-size: var(--sb-t-18); font-weight: 650; }
.sb-added__ok { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sb-ok); color: var(--sb-white); }
.sb-added__ok svg { width: 15px; height: 15px; }
.sb-added__x { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sb-mist); display: grid; place-items: center; cursor: pointer; }
.sb-added__x svg { width: 18px; height: 18px; }
.sb-added__item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.sb-added__item img { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; background: var(--sb-mist); padding: 6px; mix-blend-mode: multiply; }
.sb-added__item b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--sb-t-14); font-weight: 600; line-height: 1.35; }
.sb-added__item small { display: block; margin-top: 4px; color: var(--sb-slate); font-size: var(--sb-t-13); }
.sb-added__ship { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--sb-mist); font-size: var(--sb-t-13); }
.sb-added__acts { display: grid; gap: 8px; }
.sb-added__keep { background: none; border: 0; padding: 8px; font-weight: 600; color: var(--sb-slate); cursor: pointer; }
@media (max-width: 760px) {
  .sb-added__panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); opacity: 1; }
}
