/* Stack Room — independent cart visual system */

:root {
  --st-ink: #0F172A;
  --st-mute: #64748B;
  --st-fog: #F1F5F9;
  --st-panel: #FFFFFF;
  --st-line: rgba(15, 23, 42, 0.1);
  --st-rose: #E11D48;
  --st-sky: #0284C7;
  --st-mint: #14B8A6;
  --st-void: #020617;
  --font-display: 'League Spartan', 'Segoe UI', sans-serif;
  --font-body: 'Karla', 'Segoe UI', sans-serif;
  --st-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body.st-body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--st-ink);
  background:
    radial-gradient(900px 480px at 100% 0%, rgba(2, 132, 199, 0.1), transparent 55%),
    radial-gradient(700px 400px at 0% 20%, rgba(225, 29, 72, 0.08), transparent 50%),
    linear-gradient(180deg, #E2E8F0 0%, var(--st-fog) 48%, #DEE7F0 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.st-root { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1; }

.st-room {
  position: relative;
  width: min(100% - 1.35rem, 1120px);
  margin: 0 auto;
  padding: 1.15rem 0 3rem;
  isolation: isolate;
}

.st-wash {
  position: absolute;
  inset: 0 -6% auto;
  height: 20rem;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      rgba(15, 23, 42, 0.035) 31px 32px
    );
  mask-image: linear-gradient(180deg, #000 25%, transparent);
}

/* Chrome */
.st-chrome {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.st-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.st-mark em {
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--st-rose);
  border-radius: 0.2rem 0.85rem 0.2rem 0.85rem;
  transition: border-radius 0.35s var(--st-ease), transform 0.35s var(--st-ease);
}

.st-mark:hover em {
  border-radius: 0.85rem 0.2rem 0.85rem 0.2rem;
  transform: rotate(-6deg);
}

.st-mark span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.st-chrome-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.st-chrome-links a {
  text-decoration: none;
  color: var(--st-ink);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.35rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.st-chrome-links a:hover {
  background: rgba(2, 132, 199, 0.12);
  color: var(--st-sky);
}

.st-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.st-cart-link em[data-cart-badge] {
  font-style: normal;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 0.2rem;
  background: var(--st-rose);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1rem;
  text-align: center;
}

.st-kicker {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--st-rose);
}

/* Empty */
.st-empty {
  position: relative;
  z-index: 2;
  padding: 3.5rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px dashed var(--st-line);
  border-radius: 1.25rem;
}

.st-empty h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  letter-spacing: -0.04em;
}

.st-empty p {
  margin: 0 auto 1.25rem;
  color: var(--st-mute);
  max-width: 36ch;
}

/* Hero */
.st-hero {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 800px) {
  .st-hero {
    grid-template-columns: 1.4fr 1fr;
    align-items: end;
  }
}

.st-hero h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.st-lede {
  margin: 0;
  color: var(--st-mute);
  max-width: 36ch;
  line-height: 1.5;
}

.st-meters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.st-meters li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--st-line);
  border-radius: 0.85rem 0.25rem;
}

.st-meters em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--st-mute);
}

.st-meters strong {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* Steps ribbon */
.st-steps {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.st-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--st-mute);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--st-line);
  border-radius: 999px;
  transform: skewX(-8deg);
}

.st-step > * { transform: skewX(8deg); }

.st-step i {
  font-style: normal;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.75rem;
}

.st-step.is-now {
  color: #fff;
  background: var(--st-void);
  border-color: var(--st-void);
}

.st-step.is-now i {
  background: var(--st-rose);
  color: #fff;
}

/* Layout: lines + settle */
.st-layout {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.35rem;
}

@media (min-width: 920px) {
  .st-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.85fr);
    align-items: start;
    gap: 1.75rem;
  }
}

.st-stack-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  container-type: inline-size;
  container-name: stack;
}

/* Responsive planks via parent container query */
.st-plank {
  display: grid;
  grid-template-columns: auto 4.5rem 1fr;
  grid-template-areas:
    "idx media body"
    "idx media qty"
    "idx media line";
  gap: 0.65rem 0.85rem;
  padding: 0.85rem;
  background: var(--st-panel);
  border: 1px solid var(--st-line);
  border-radius: 1rem 0.3rem 1rem 0.3rem;
  opacity: 0;
  transform: translateX(-12px);
  animation: st-slide 0.5s var(--st-ease) forwards;
  animation-delay: calc(var(--st-i, 0) * 0.06s);
  transition: border-color 0.25s ease, box-shadow 0.35s var(--st-ease), transform 0.35s var(--st-ease);
}

.st-plank:hover {
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

@keyframes st-slide {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .st-plank { opacity: 1; transform: none; animation: none; }
}

@container stack (min-width: 520px) {
  .st-plank {
    grid-template-columns: auto 5.5rem minmax(0, 1fr) auto auto;
    grid-template-areas: "idx media body qty line";
    align-items: center;
  }
}

.st-plank-idx {
  grid-area: idx;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--st-mute);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
}

.st-plank-media {
  grid-area: media;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.65rem 0.2rem;
  background: #e2e8f0;
}

.st-plank-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--st-ease);
}

.st-plank:hover .st-plank-media img {
  transform: scale(1.07);
}

.st-plank-body {
  grid-area: body;
  min-width: 0;
}

.st-sku {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--st-mute);
}

.st-plank-body h2 {
  margin: 0.15rem 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.st-plank-body h2 a {
  color: inherit;
  text-decoration: none;
}

.st-plank-body h2 a:hover { color: var(--st-sky); }

.st-unit {
  margin: 0;
  font-size: 0.88rem;
  color: var(--st-mute);
}

.st-qty {
  grid-area: qty;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 999px;
  width: fit-content;
}

.st-qty button {
  appearance: none;
  border: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  color: var(--st-ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s var(--st-ease);
}

.st-qty button:hover {
  background: var(--st-sky);
  color: #fff;
  transform: scale(1.06);
}

.st-qty input {
  width: 2.4rem;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.st-line {
  grid-area: line;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--st-mint);
  font-variant-numeric: tabular-nums;
  justify-self: end;
}

/* Settlement panel */
.st-settle {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--st-void);
  color: #F8FAFC;
  border-radius: 1.35rem 0.4rem 1.35rem 0.4rem;
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.28);
}

.st-promo-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  appearance: none;
  border: 1.5px solid rgba(248, 250, 252, 0.16);
  background: rgba(248, 250, 252, 0.06);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 0.95rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.st-promo-toggle:hover,
.st-promo-toggle[aria-expanded="true"] {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.45);
}

.st-promo-toggle em {
  font-style: normal;
  font-size: 1.2rem;
  transition: transform 0.35s var(--st-ease);
}

.st-promo-toggle[aria-expanded="true"] em {
  transform: rotate(45deg);
}

.st-promo-drawer {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding-top: 0.15rem;
  animation: st-drawer 0.35s var(--st-ease);
}

.st-promo-drawer[hidden] { display: none !important; }

@keyframes st-drawer {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.st-promo-drawer input {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid rgba(248, 250, 252, 0.18);
  border-radius: 0.55rem;
  background: rgba(248, 250, 252, 0.08);
  color: #fff;
  font: inherit;
  outline: none;
}

.st-promo-drawer input:focus {
  border-color: var(--st-sky);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.st-promo-drawer button[data-cr-promo] {
  appearance: none;
  border: 0;
  min-height: 2.45rem;
  border-radius: 0.55rem;
  background: var(--st-sky);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.3s var(--st-ease);
}

.st-promo-drawer button[data-cr-promo]:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.st-promo-drawer p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(248, 250, 252, 0.55);
}

.st-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--st-rose);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--st-ease), background 0.25s ease, box-shadow 0.35s var(--st-ease);
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.28);
}

.st-btn:hover {
  transform: translateY(-2px);
  background: #be123c;
}

.st-btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(248, 250, 252, 0.22);
  box-shadow: none;
  font-size: 0.85rem;
}

.st-btn-ghost:hover {
  background: rgba(248, 250, 252, 0.1);
  border-color: rgba(248, 250, 252, 0.4);
  box-shadow: none;
}

.st-tally {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
}

.st-tally-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.95rem;
}

.st-tally-row span { color: rgba(248, 250, 252, 0.6); }

.st-tally-row strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.st-tally-grand {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(248, 250, 252, 0.16);
  font-size: 1.05rem;
}

.st-tally-grand strong {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  color: var(--st-mint);
  letter-spacing: -0.03em;
}

.st-ship-note {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.5);
}

.st-tally .st-btn {
  width: 100%;
  margin-top: 0.35rem;
}

.st-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  font-size: 0.82rem;
  color: var(--st-mute);
  border-top: 1px solid var(--st-line);
}

.st-foot a {
  color: var(--st-ink);
  font-weight: 700;
  text-decoration: none;
  margin-left: 0.75rem;
}

.st-foot a:hover { color: var(--st-rose); }
