/* ==========================================================================
   FLOATING LUXURY SOHRAAZ BAG + FLYING GARMENT ANIMATION
   Theme-token driven. No hardcoded brand colours, no framework, no build step.

   z-index map (see existing app):
     float dock 900 · theme 890 · drawer overlay 930 · drawer 940
     flying clone 960 · chat dock 980 · reel stage 1050
   ========================================================================== */

.sz-fbag {
  position: fixed;
  /* Default dock: left-bottom, fully inside the viewport. The user may drag
     it anywhere (even partly off-screen to hide it); nothing snaps. */
  left: 14px;
  bottom: calc(14px + var(--mbar-h, 0px) + env(safe-area-inset-bottom, 0px));
  top: auto;
  right: auto;
  z-index: 920;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: none;
}
.sz-fbag:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: var(--radius-7xl);
}
.sz-fbag.is-dragging { cursor: grabbing; z-index: 921; will-change: transform; }

.sz-fbag-inner {
  position: relative;
  width: 96px;
  height: 96px;
  transform-origin: center center;
  will-change: transform;
}
.sz-fbag-art {
  overflow: visible !important;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  /* The house tilt — negative turns the handle to the left (admin editable). */
  transform: rotate(var(--sz-bag-tilt, -15deg));
  /* Soft, faded contact shadow — follows the bag artwork, never a circle. */
  filter: drop-shadow(0 12px 20px color-mix(in srgb, var(--theme-scrim) 18%, transparent));
}
.sz-fbag-count {
  z-index: 9;
  position: absolute;
  /* Keep the badge INSIDE the bag box. At -8px it sat under the hero
     headline's stacking context and looked cropped / missing. */
  top: 6px;
  right: 6px;
  min-width: 27px;
  height: 27px;
  padding: 0 var(--gap-md);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--ink);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--caps, inherit);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-scrim) 18%, transparent);
  transition: transform 0.2s ease;
}
.sz-fbag-count.pop { transform: scale(1.3); }
.sz-fbag-glow {
  display: none; /* the round halo read as a hard circle — removed */
  position: absolute;
  inset: -10px;
  border-radius: var(--radius-round);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  filter: blur(10px);
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: -1;
}
.sz-fbag:hover .sz-fbag-glow,
.sz-fbag:focus-visible .sz-fbag-glow { transform: scale(1.2); }

/* ---------- Live peek card on hover / focus ---------- */
.sz-fbag-peek {
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  width: 228px;
  padding: var(--gap-5xl) var(--gap-6xl);
  border: 1px solid var(--gold);
  border-radius: var(--radius-5xl);
  background: var(--bg2);
  color: var(--ink);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--theme-scrim) 42%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-10px) scale(0.96);
  transform-origin: left center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--caps, inherit);
  z-index: 2;
}
.sz-fbag:hover .sz-fbag-peek,
.sz-fbag:focus-visible .sz-fbag-peek {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
.sz-fbag-peek-head,
.sz-fbag-peek-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-xl);
}
.sz-fbag-peek-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-e0_12);
  text-transform: uppercase;
}
.sz-fbag-peek-count {
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-e0_08);
  color: var(--gold);
  white-space: nowrap;
}
.sz-fbag-peek-body {
  display: flex;
  align-items: center;
  gap: var(--gap-2xl);
  padding: var(--gap-3xl) 0;
  margin: var(--gap-2xl) 0;
  border-top: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  min-height: 46px;
}
.sz-fbag-peek-body img {
  width: 36px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  flex: 0 0 auto;
}
.sz-fbag-peek-name {
  font-size: var(--fs-xs);
  line-height: var(--lh-steady);
  font-weight: var(--fw-semibold);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sz-fbag-peek-meta { font-size: var(--fs-2xs); color: var(--mute); margin-top: var(--gap-3xs); }
.sz-fbag-peek-empty { font-size: var(--fs-xs); color: var(--mute); line-height: var(--lh-read); }
.sz-fbag-peek-foot { font-size: var(--fs-2xs); color: var(--mute); letter-spacing: var(--ls-e0_06); }
.sz-fbag-peek-foot strong { font-size: var(--fs-md); color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) { .sz-fbag-peek { display: none; } }

/* ---------- Flying garment clone ---------- */
.sz-flying-clone {
  position: fixed;
  z-index: 960;
  pointer-events: none;
  transform-origin: 50% 12%;
  will-change: transform, opacity;
  filter: drop-shadow(0 18px 24px color-mix(in srgb, var(--theme-scrim) 28%, transparent));
}
/* Keep the source proportions — the garment is never stretched or squashed. */
.sz-flying-clone img,
.sz-flying-clone svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}
.sz-flight-ring {
  position: fixed;
  z-index: 959;
  pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--gold) 90%, transparent);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 26px color-mix(in srgb, var(--gold) 55%, transparent),
              inset 0 0 20px color-mix(in srgb, var(--gold) 35%, transparent);
  will-change: transform, opacity;
}

/* ---------- Quick Add on every product card ---------- */
.sz-card-add {
  margin-top: var(--gap-3xl);
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg2) 92%, var(--gold) 8%);
  color: var(--ink);
  font-family: var(--caps, inherit);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-e0_12);
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.sz-card-add svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sz-card-add:hover { background: var(--bg2); color: var(--gold); transform: translateY(-1px); }
.sz-card-add:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Inline size picker for quick add ---------- */
.sz-size-pop {
  position: fixed;
  z-index: 965;
  display: flex;
  gap: var(--gap-xs);
  flex-wrap: wrap;
  padding: var(--gap-xl);
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius-4xl);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--theme-scrim) 35%, transparent);
}
.sz-size-pop-label {
  width: 100%;
  text-align: center;
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-e0_14);
  text-transform: uppercase;
  color: var(--mute);
}
.sz-size-pop button {
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
}
.sz-size-pop button:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 760px) {
  /* Keep the bag clear of the hanger rail and the first product row. */
  .sz-fbag { left: 12px; right: auto; top: auto; bottom: calc(12px + var(--mbar-h, 64px) + env(safe-area-inset-bottom, 0px)); transform: none; }
  .sz-fbag-inner { width: 72px; height: 72px; }
  .sz-fbag-count { min-width: 27px; height: 27px; font-size: var(--fs-xs); top: 6px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .sz-fbag-inner, .sz-fbag-count, .sz-fbag-glow { transition: none !important; }
}

/* ---------- Precise hit area + smooth touch drag ----------
   The tilted PNG has transparent corners; a full 96px square made taps
   outside the artwork open the bag. Only the inner (bag body) and its count
   badge are hit targets now. The circular clip cuts the empty corners.
   Position updates during drag use translate3d (see flying_bag.js). */
.sz-fbag { cursor: default; pointer-events: none; }
.sz-fbag-inner {
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  /* No circular clip: it cut the artwork's soft drop-shadow into a visible
     disc. The count badge now sits inside the box, so the clip is unnecessary. */
}
.sz-fbag.is-dragging .sz-fbag-inner { cursor: grabbing; }
.sz-fbag-count { pointer-events: auto; }
.sz-fbag-peek, .sz-fbag-glow { pointer-events: none; }
@media (max-width: 760px) {
  .sz-fbag-inner { clip-path: none; }
}
