/* ============================================================================
   sbs-stories.css — category bubbles + full-screen reel. Requires sbs-tokens.
   ========================================================================== */

.sbs-stories { margin: 0 0 var(--sbs-md); }
.sbs-stories:empty { display: none; }
.sbs-stories__row {
  display: flex;
  gap: var(--sbs-md);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.sbs-stories__row::-webkit-scrollbar { display: none; }

.sbs-story-bubble {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sbs-xs);
  width: 76px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.sbs-story-bubble__ring {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  border-radius: 999px;
  padding: 2.5px;
  background: var(--sbs-gold-gradient);
}
.sbs-story-bubble__thumb {
  width: 100%; height: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: var(--sbs-bg-hover);
  border: 2.5px solid var(--sbs-bg-black);
}
.sbs-story-bubble__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sbs-story-bubble__label {
  display: grid;
  width: 100%;
  /* A fixed 32pt block keeps every two-line category label aligned on the
     feed's spacing rhythm, even when one label has a shorter first line. */
  min-height: 32px;
  align-content: start;
  font-size: var(--sbs-fs-micro);
  font-weight: var(--sbs-fw-semibold);
  line-height: 1.2;
  color: var(--sbs-text-secondary);
  text-align: center;
}

/* ---- REEL (full screen) -------------------------------------------------- */
.sbs-reel {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity var(--sbs-dur-base) var(--sbs-ease-out), transform var(--sbs-dur-base) var(--sbs-ease-out);
}
.sbs-reel.is-open { opacity: 1; }
/* blurred fill backdrop (iOS): the photo blurred + dimmed behind the contained
   photo, so 9:16 shots fill the frame with no black bars. */
.sbs-reel__backdrop {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(32px); transform: scale(1.1);
  opacity: 0.45;
}
.sbs-reel__backdrop::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }

.sbs-reel__bars {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 10px; right: 10px;
  display: flex;
  gap: 4px;
  z-index: 4;
}
.sbs-reel__bar {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.sbs-reel__fill { display: block; height: 100%; width: 0; background: #fff; }
.sbs-reel__bar.is-done .sbs-reel__fill { width: 100%; }

/* category dots — which of the N reels you're on */
.sbs-reel__cats {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 0; right: 0; z-index: 4;
  display: flex; justify-content: center; gap: 5px;
}
.sbs-reel__catdot { width: 5px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.4); }
.sbs-reel__catdot.is-on { background: var(--sbs-gold-bright, #FFD700); width: 14px; }

.sbs-reel__head {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 30px);
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 18px;
  z-index: 4;
}
.sbs-reel__cat {
  font: var(--sbs-fw-bold) var(--sbs-fs-caption)/1 var(--sbs-font-body);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.sbs-reel__pos {
  margin-left: auto;
  font: var(--sbs-fw-semibold) var(--sbs-fs-micro, 0.6875rem) / 1 var(--sbs-font-body);
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.sbs-reel__close {
  display: grid;
  width: 44px; height: 44px;
  margin-left: 2px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff; background: rgba(0, 0, 0, .38); cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.sbs-reel__close svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

/* photo "n / N" counter — capsule tucked under the header */
.sbs-reel__photocount {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  left: 50%; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: var(--sbs-fw-bold) var(--sbs-fs-micro, 0.6875rem) / 1 var(--sbs-font-body);
  letter-spacing: 0.3px; color: #fff;
}

.sbs-reel__img {
  position: relative; z-index: 1;
  flex: 1;
  display: block;
  min-height: 0;
}
.sbs-reel__img img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.sbs-reel__nav {
  position: absolute;
  top: 120px; bottom: 200px;
  z-index: 2;
}
.sbs-reel__nav--prev { left: 0; width: 32%; }
.sbs-reel__nav--next { right: 0; width: 68%; }

/* bottom info — a single clean column (iOS bottomInfo) */
.sbs-reel__info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 56px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
}
.sbs-reel__dots { display: flex; gap: 5px; margin-bottom: 2px; }
.sbs-reel__dot { width: 5px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.4); }
.sbs-reel__dot.is-on { background: #fff; }

.sbs-reel__brand {
  margin: 0;
  font: var(--sbs-fw-bold) var(--sbs-fs-title-lg) / 1.1 var(--sbs-font-body);
  letter-spacing: 0.2px;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.sbs-reel__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sbs-reel__chip {
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: var(--sbs-fw-semibold) var(--sbs-fs-micro, 0.6875rem) / 1.3 var(--sbs-font-body);
  letter-spacing: 0.2px; color: rgba(255, 255, 255, 0.92);
}
.sbs-reel__price {
  font: var(--sbs-fw-bold) 1.25rem/1 var(--sbs-font-body);
  color: var(--sbs-gold-bright, #FFD700);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.sbs-reel__byrequest { font: var(--sbs-fw-semibold) var(--sbs-fs-caption) / 1.3 var(--sbs-font-body); color: rgba(255, 255, 255, 0.75); }
.sbs-reel__notes {
  margin: 0;
  font: var(--sbs-fw-regular) var(--sbs-fs-caption) / 1.4 var(--sbs-font-body);
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sbs-reel__actions { display: flex; gap: 10px; margin-top: 4px; }
.sbs-reel__add, .sbs-reel__view {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: none; border-radius: var(--sbs-r-pill);
  font: var(--sbs-fw-bold) 0.9375rem/1 var(--sbs-font-body);
  letter-spacing: 0.2px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.sbs-reel__add {
  flex: 1;
  background: var(--sbs-gold-gradient, linear-gradient(135deg, #FFD700, #FFA500));
  color: #000;
}
.sbs-reel__add.is-in-cart { background: color-mix(in srgb, var(--sbs-gold) 75%, #000); color: #fff; }
.sbs-reel__view {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.22);
}

/* in-reel flash toast (add / already-in-basket feedback) */
.sbs-reel__flash {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 120px);
  left: 50%; transform: translateX(-50%) translateY(-6px);
  z-index: 5;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--sbs-hairline-gold, rgba(212, 175, 55, 0.3));
  font: var(--sbs-fw-semibold) var(--sbs-fs-caption) / 1 var(--sbs-font-body);
  color: #fff; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.sbs-reel__flash.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 700px) {
  .sbs-reel { max-width: 440px; margin: 0 auto; border-left: 1px solid #222; border-right: 1px solid #222; }
}

/* ---- inline size sheet (multi-size add over the reel) -------------------- */
/* z 2050: above the reel (2000), below the notes gate (.sbs-gate 2100) so a
   noted item's gate still appears OVER the size sheet. */
.sbs-reel__sizesheet {
  position: absolute; inset: 0; z-index: 2050;
  display: flex; align-items: flex-end;
}
.sbs-reel__sizesheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.sbs-reel__sizesheet-panel {
  position: relative; width: 100%;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: rgba(20, 20, 20, 0.78);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  animation: sbs-sizesheet-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sbs-sizesheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sbs-reel__sizesheet-panel { animation: none; } }
.sbs-reel__sizesheet-title {
  margin: 0 0 14px; color: #fff;
  font: 700 1rem/1.1 Inter, system-ui, -apple-system, sans-serif;
}
.sbs-reel__sizechips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sbs-reel__sizechips::-webkit-scrollbar { display: none; }
.sbs-reel__sizechip {
  flex: 0 0 auto; min-width: 56px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: none; cursor: pointer;
  background: var(--sbs-gold-gradient, linear-gradient(135deg, #FFD700, #FFA500));
  color: #000; font: 700 0.95rem/1 Inter, system-ui, sans-serif;
  transition: transform 0.15s ease;
}
.sbs-reel__sizechip:active { transform: scale(0.94); }
