/*
================================================================
Space Vanta Theme 2.0
Module: Cart preview (styles)
Path: public/sv-cart/preview.css
Version: SVCART-PREVIEW-003

Rules this file keeps:
- Everything is under .svcp / .svcp__*. Nothing here selects
  .sv-header*, so the header cannot be restyled by accident.
- The only line that touches a header element is the cart trigger's
  "open" state, at the bottom, scoped by [aria-expanded].
- Layers: header 900 (fixed) / 100 (in flow), find-vision-drawer
  10000. The preview sits at 950: above the header's bottom edge so
  its notch can point at the icon, below every full-screen layer.
- Colour: warm paper is the ground, metal and blue are the parts.
  Blue is the single accent.
- Motion: one focus at a time. Off under prefers-reduced-motion and
  when <html data-sv-motion="calm">.
================================================================
*/

.svcp {
  --svcp-paper: #fbf7f0;
  --svcp-paper-2: #f7f2e8;
  --svcp-ground: var(--sv-ground-2, #f4eee4);
  --svcp-ink: var(--sv-ink, #252321);
  --svcp-ink-2: #3a352f;
  --svcp-muted: #5f574d;
  --svcp-line: #ddd6c9;
  --svcp-plate: #d5cfc3;
  --svcp-blue: var(--sv-blue, #1d6bff);
  --svcp-blue-hi: var(--sv-blue-2, #4d8dff);
  --svcp-blue-lo: #1458e0;
  --svcp-metal: linear-gradient(135deg, #f7f8fa 0%, #c9cbd1 26%, #eef0f4 50%, #b9c1ce 76%, #f4f5f8 100%);
  --svcp-font: var(--sv-font, "Inter", "Manrope", -apple-system, "Segoe UI", sans-serif);
  --svcp-mono: ui-monospace, "IBM Plex Mono", SFMono-Regular, Menlo, Consolas, monospace;

  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 950;
  font-family: var(--svcp-font);
  color: var(--svcp-ink);
  -webkit-font-smoothing: antialiased;
}

.svcp[hidden] { display: none !important; }

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

.svcp :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.svcp :where(a) { color: inherit; text-decoration: none; }
.svcp .svcp__cta { color: #fff; }
.svcp :focus-visible { outline: 2px solid var(--svcp-blue); outline-offset: 3px; }

.svcp__mono {
  font-family: var(--svcp-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- scrim: only tints the page under the header ---------- */

.svcp__scrim {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--svcp-top, 0px);
  background: rgba(37, 35, 33, 0.14);
  pointer-events: none;
  animation: svcp-fade 0.2s ease both;
}

/* ---------- pop ---------- */

.svcp__pop {
  position: fixed;
  top: 0;
  left: 0;
  width: 408px;
  max-width: calc(100vw - 20px);
  outline: none;
  animation: svcp-rise 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.svcp__ghost {
  position: absolute;
  left: -12px;
  top: 14px;
  right: 12px;
  bottom: -14px;
  border: 1px solid #aab3c1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(185, 193, 206, 0.22));
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px);
  opacity: 0.8;
  pointer-events: none;
  transform: translate(calc(var(--px, 0) * -4px), calc(var(--py, 0) * -3px));
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: svcp-ghost 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}
/* the third, deeper plate */
.svcp__ghost--b {
  left: -24px;
  top: 28px;
  right: 24px;
  bottom: -28px;
  border-color: #d5cfc3;
  background: linear-gradient(135deg, rgba(251, 247, 240, 0.7), rgba(213, 207, 195, 0.18));
  opacity: 0.65;
  transform: translate(calc(var(--px, 0) * -8px), calc(var(--py, 0) * -6px));
  animation-delay: 0.16s;
}

/* floating fragments outside the shell: one blue, one metal */
.svcp__shard-a,
.svcp__shard-b {
  position: absolute;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: svcp-ghost 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.22s both;
}
.svcp__shard-a {
  left: -20px;
  top: 44px;
  width: 12px;
  height: 38px;
  background: linear-gradient(160deg, #7fb0ff, var(--svcp-blue) 55%, #0f4fd6);
  clip-path: polygon(0 16%, 100% 0, 100% 84%, 0 100%);
  transform: translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 5px));
}
.svcp__shard-b {
  right: -16px;
  bottom: 74px;
  width: 9px;
  height: 52px;
  background: var(--svcp-metal);
  clip-path: polygon(0 0, 100% 12%, 100% 100%, 0 88%);
  transform: translate(calc(var(--px, 0) * 7px), calc(var(--py, 0) * 6px));
}

.svcp__notch,
.svcp__notch-in {
  position: absolute;
  right: var(--svcp-notch, 24px);
  pointer-events: none;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.svcp__notch { top: -10px; width: 22px; height: 11px; background: var(--svcp-metal); }
.svcp__notch-in { top: -8px; width: 20px; height: 10px; margin-right: 1px; background: var(--svcp-paper); }

.svcp__lift {
  /* no blurred shadow: depth comes from hard-edged planes underneath */
  transform: translate(calc(var(--px, 0) * 2px), calc(var(--py, 0) * 1.5px));
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.svcp__shell {
  padding: 1.5px;
  background: linear-gradient(135deg, #ffffff 0%, #aeb6c2 22%, #f2f4f8 46%, #98a3b3 72%, #f7f8fb 100%);
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px);
  animation: svcp-reveal 0.46s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.svcp__inner {
  display: flex;
  flex-direction: column;
  max-height: var(--svcp-max-h, 664px);
  background: var(--svcp-paper);
  clip-path: polygon(19px 0, 100% 0, 100% 100%, 0 100%, 0 19px);
}

/* ---------- top bar ---------- */

.svcp__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 10px 12px 28px;
}
.svcp__title-row { display: flex; align-items: baseline; gap: 12px; }
.svcp__title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.svcp__count { color: var(--svcp-muted); }

.svcp__x {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.svcp__x:hover { background: rgba(37, 35, 33, 0.06); }

/* ---------- body ---------- */

.svcp__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 28px 8px;
  overscroll-behavior: contain;
}

.svcp__group {
  position: relative;
  padding: 0 0 6px 20px;
  animation: svcp-up 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 1ms);
}
.svcp__rail {
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #b9c1ce, rgba(185, 193, 206, 0));
}

.svcp__split {
  display: flex;
  align-items: stretch;
  height: 16px;
  margin: 2px 0 18px -20px;
}
.svcp__split i:nth-child(1) { flex: 1; align-self: flex-end; height: 1px; margin-bottom: 3px; background: #b9c1ce; }
.svcp__split i:nth-child(2) { width: 1px; margin: 0 1px; background: var(--svcp-blue); transform: skewX(-32deg); }
.svcp__split i:nth-child(3) { flex: 1; align-self: flex-start; height: 1px; margin-top: 3px; background: #b9c1ce; }

.svcp__ghead { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.svcp__idx { color: var(--svcp-blue); font-weight: 500; }
.svcp__label { color: var(--svcp-ink); font-weight: 500; }
.svcp__gline { flex: 1; height: 1px; background: var(--svcp-line); }

.svcp__node {
  position: absolute;
  left: -20px;
  top: 11px;
  width: 9px;
  height: 9px;
  background: var(--svcp-paper);
  border: 1.5px solid var(--svcp-blue);
  transform: rotate(45deg);
  transition: background 0.3s;
}
.svcp__node.is-on { background: var(--svcp-blue); }

/* made to order: the same rail, drawn in pieces, on a faint offset plate */
.svcp__group--onDemand { background: linear-gradient(135deg, rgba(185, 193, 206, 0.16), rgba(185, 193, 206, 0) 62%); }
.svcp__group--onDemand .svcp__rail {
  background: repeating-linear-gradient(180deg, #b9c1ce 0 5px, rgba(185, 193, 206, 0) 5px 9px);
}
.svcp__group--onDemand .svcp__node::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border: 1.5px solid var(--svcp-blue);
  transform: translate(3px, -3px);
  opacity: 0.55;
}

/* ---------- item ---------- */

.svcp__item { position: relative; display: flex; gap: 14px; padding: 10px 0; overflow: hidden; }
.svcp__item[aria-busy="true"] { opacity: 0.72; pointer-events: none; }
.svcp__item.is-splitting { overflow: visible; transition: height 0.24s cubic-bezier(0.5, 0, 0.2, 1), padding 0.24s; }
.svcp__item.is-collapsing { padding-top: 0; padding-bottom: 0; }

.svcp__thumb { position: relative; width: 62px; height: 62px; flex-shrink: 0; }
.svcp__thumb::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 62px;
  height: 62px;
  border: 1px solid var(--svcp-plate);
}
.svcp__thumb-frame {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 1px;
  background: var(--svcp-metal);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.svcp__thumb-img {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ebe3d5;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  overflow: hidden;
}
.svcp__thumb-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.svcp__thumb-img b {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 24px;
  height: 30px;
  background: linear-gradient(150deg, #7fb0ff, var(--svcp-blue) 55%, #0f4fd6);
  clip-path: polygon(0 0, 100% 20%, 80% 100%, 10% 80%);
}

.svcp__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-left: 4px; }
.svcp__row { display: flex; justify-content: space-between; gap: 10px; }
.svcp__name { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--svcp-ink); overflow-wrap: anywhere; }
.svcp__lineprice { font-family: var(--svcp-mono); font-size: 12px; white-space: nowrap; }
.svcp__variant { font-size: 12px; color: var(--svcp-muted); }

.svcp__ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.svcp__qty { display: inline-flex; align-items: center; border: 1px solid #cfc8bb; }
.svcp__qty button { width: 40px; height: 40px; font-size: 16px; transition: background 0.15s; }
.svcp__qty button:hover { background: rgba(37, 35, 33, 0.06); }
.svcp__qty output { min-width: 24px; text-align: center; font-size: 13px; font-weight: 700; }
.svcp__rm { height: 40px; padding: 0 10px; color: var(--svcp-muted); }
.svcp__rm:hover { color: var(--svcp-ink); }

/* ADD: the row lands from above; a blue ring leaves the thumbnail */
.svcp__item.is-landing { animation: svcp-land 0.6s cubic-bezier(0.2, 0.85, 0.2, 1) both; }
.svcp__item.is-landing .svcp__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--svcp-blue);
  animation: svcp-ring 0.9s ease-out 0.2s both;
  pointer-events: none;
}
.svcp__tag {
  flex: none;
  align-self: flex-start;
  padding: 2px 6px;
  margin-top: 1px;
  font-size: 9.5px;
  color: #fff;
  background: var(--svcp-blue);
  clip-path: polygon(4px 0, 100% 0, 100% 100%, 0 100%, 0 4px);
  animation: svcp-tag 3s ease both;
}

/* STEPPER: the number ticks; nothing else moves */
.svcp__item[data-tick="up"] .svcp__qty output,
.svcp__item[data-tick="up"] .svcp__lineprice { animation: svcp-tick-up 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.svcp__item[data-tick="down"] .svcp__qty output,
.svcp__item[data-tick="down"] .svcp__lineprice { animation: svcp-tick-down 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* REMOVE: the row is cut on a diagonal; the halves slide apart and fade */
.svcp__item.is-splitting > *:not(.svcp__shardrow):not(.svcp__new) { visibility: hidden; }
.svcp__shardrow {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  gap: 14px;
  padding: 10px 0;
  background: var(--svcp-paper);
  pointer-events: none;
}
.svcp__shardrow--a {
  clip-path: polygon(0 0, 64% 0, 40% 100%, 0 100%);
  animation: svcp-cut-a 0.52s cubic-bezier(0.5, 0, 0.2, 1) 0.06s both;
}
.svcp__shardrow--b {
  clip-path: polygon(64% 0, 100% 0, 100% 100%, 40% 100%);
  animation: svcp-cut-b 0.52s cubic-bezier(0.5, 0, 0.2, 1) 0.06s both;
}
.svcp__item.is-splitting::after {
  content: "";
  position: absolute;
  left: 40%;
  width: 24%;
  top: 0;
  bottom: 0;
  background: linear-gradient(to bottom right, rgba(29, 107, 255, 0) calc(50% - 1px), var(--svcp-blue) 50%, rgba(29, 107, 255, 0) calc(50% + 1px));
  animation: svcp-seam 0.5s ease-out both;
  pointer-events: none;
}

.svcp__new {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background: linear-gradient(100deg, rgba(29, 107, 255, 0), rgba(77, 141, 255, 0.28), rgba(29, 107, 255, 0));
  transform: skewX(-18deg);
  animation: svcp-scan 1.1s ease 0.15s both;
  pointer-events: none;
}

/* ---------- route: free shipping as fragments ---------- */

.svcp__route {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 6px 0 14px;
  padding: 12px 14px;
  background: var(--svcp-ground);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.svcp__route[data-state="loading"] .svcp__cells { opacity: 0.45; }
.svcp__rline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.svcp__status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.svcp__thresh { color: var(--svcp-muted); }
.svcp__cells { position: relative; display: flex; gap: 3px; overflow: hidden; transition: opacity 0.2s; }
.svcp__cell {
  flex: 1;
  height: 8px;
  background: #d9d5cb;
  transform: skewX(-18deg);
  transition: background 0.35s ease;
  transition-delay: calc(var(--i, 0) * 40ms);
}
.svcp__cell.is-on { background: linear-gradient(180deg, var(--svcp-blue-hi), var(--svcp-blue)); }
.svcp__scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 26%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
  animation: svcp-scan 1s ease 0.1s both;
  pointer-events: none;
}
.svcp__note { font-family: var(--svcp-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--svcp-muted); line-height: 1.5; }

/* ---------- empty ---------- */

.svcp__empty { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 16px 28px 32px; }
.svcp__empty h3 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.svcp__empty p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--svcp-muted); }

/* ---------- foot ---------- */

.svcp__foot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 28px 22px;
  background: var(--svcp-paper-2);
}
.svcp__foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, #b9c1ce, #f4f5f8 45%, #b9c1ce);
}
.svcp__sub { display: flex; justify-content: space-between; align-items: baseline; }
.svcp__sub span:first-child { font-size: 14px; font-weight: 600; }
.svcp__sub span:last-child { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.svcp__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.svcp__duties { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--svcp-ink-2); }
.svcp__small { font-family: var(--svcp-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--svcp-muted); }

/* primary button: blue part on a metal plate */
.svcp__ctawrap { position: relative; padding: 0 6px 6px 0; margin-top: 2px; }
.svcp__ctawrap::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  right: 0;
  bottom: 0;
  background: var(--svcp-metal);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.svcp__cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 28px;
  background: linear-gradient(180deg, #2273ff 0%, var(--svcp-blue) 55%, var(--svcp-blue-lo) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  overflow: hidden;
  transition: transform 0.18s ease;
}
.svcp__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(170px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 62%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.svcp__cta:hover::before { opacity: 1; }
.svcp__ctawrap:hover .svcp__cta { transform: translate(-2px, -2px); }
.svcp__ctawrap:active .svcp__cta { transform: translate(2px, 2px); }

.svcp__link { width: 100%; min-height: 46px; font-size: 14px; font-weight: 700; transition: background 0.15s; }
.svcp__link:hover { background: rgba(37, 35, 33, 0.06); }

.svcp__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.svcp__err { margin: 0 28px 10px; padding: 10px 12px; font-size: 13px; color: #8a1f1f; background: #fbeaea; }

/* ---------- motion ---------- */

.svcp__inner.is-settled .svcp__group { animation: none; }

@keyframes svcp-reveal {
  from { clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0, 100% 0); opacity: 0.4; }
  to { clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px); opacity: 1; }
}
@keyframes svcp-rise { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes svcp-ghost { from { opacity: 0; transform: translate(16px, -16px); } to { opacity: 0.7; transform: none; } }
@keyframes svcp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes svcp-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes svcp-land {
  0% { opacity: 0; transform: translateY(-18px) scale(1.02); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes svcp-ring { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }
@keyframes svcp-tag { 0% { opacity: 0; transform: translateY(-4px); } 8% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes svcp-tick-up { from { opacity: 0.2; transform: translateY(7px); color: var(--svcp-blue); } to { opacity: 1; transform: none; } }
@keyframes svcp-tick-down { from { opacity: 0.2; transform: translateY(-7px); color: var(--svcp-muted); } to { opacity: 1; transform: none; } }
@keyframes svcp-cut-a { to { transform: translate(-28px, 6px) rotate(-1.4deg); opacity: 0; filter: grayscale(1); } }
@keyframes svcp-cut-b { to { transform: translate(28px, -6px) rotate(1.4deg); opacity: 0; filter: grayscale(1); } }
@keyframes svcp-seam { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes svcp-scan { from { left: -30%; opacity: 1; } to { left: 120%; opacity: 0; } }

html[data-sv-motion="calm"] .svcp *,
html[data-sv-motion="calm"] .svcp *::before {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .svcp *,
  .svcp *::before { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 767px) {
  .svcp__top { padding-left: 20px; }
  .svcp__scroll { padding: 0 20px 4px; }
  .svcp__foot { padding: 14px 20px 18px; }
  .svcp__empty { padding: 12px 20px 26px; }
  .svcp__qty button { width: 44px; height: 44px; }
  .svcp__rm { height: 44px; }
  .svcp__ghost { left: -8px; top: 10px; right: 8px; bottom: -10px; }
  .svcp__ghost--b { left: -14px; top: 18px; right: 14px; bottom: -18px; }
  .svcp__shard-a { left: -8px; width: 9px; }
  .svcp__shard-b { right: -8px; width: 7px; }
}

/* ---------- the header's cart trigger, while the preview is open ----------
   The one rule that reaches into the header: colour only, nothing that
   changes size, position or stacking. */

.sv-actions__cart[aria-expanded="true"] { color: var(--sv-blue, #1d6bff); }


/* =================================================================
   v3 — floating planes instead of a shadow
   The card is a stack of thin planes at different depths. Each plane
   shifts a little with the pointer (deeper = more), so the cart reads
   as hovering over the page without any blur.
   ================================================================= */

.svcp__floor {
  position: absolute;
  left: 22px;
  right: -10px;
  top: 20px;
  bottom: -20px;
  background:
    repeating-linear-gradient(135deg, rgba(37, 35, 33, 0.16) 0 1px, rgba(37, 35, 33, 0) 1px 6px),
    linear-gradient(135deg, rgba(185, 193, 206, 0.22), rgba(185, 193, 206, 0));
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px);
  opacity: 0.85;
  pointer-events: none;
  transform: translate(calc(var(--px, 0) * -5px), calc(var(--py, 0) * -4px));
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: svcp-floor-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
}
.svcp__floor--b {
  left: 40px;
  right: -10px;
  top: 36px;
  bottom: -36px;
  background: none;
  border: 1px solid rgba(29, 107, 255, 0.45);
  opacity: 0.6;
  transform: translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -8px));
  animation-delay: 0.12s;
}
.svcp__ghost { left: -10px; top: 10px; right: 10px; bottom: -10px; }
.svcp__ghost--b { left: -20px; top: 20px; right: 20px; bottom: -20px; }

@keyframes svcp-floor-in {
  from { opacity: 0; transform: translate(-10px, -12px); }
  to { opacity: 0.85; }
}

/* the pop itself rises into place with a small overshoot */
.svcp__pop { animation: svcp-rise-3 0.46s cubic-bezier(0.18, 0.9, 0.28, 1.12) both; }
@keyframes svcp-rise-3 {
  0% { opacity: 0; transform: translateY(-14px) scale(0.985); }
  100% { opacity: 1; transform: none; }
}

/* ---------- each group is its own plate ---------- */

.svcp__group {
  margin: 0 0 14px;
  padding: 0 14px 4px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(247, 242, 232, 0.6));
  border: 1px solid #e3dccf;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}
.svcp__rail { left: 9px; top: 18px; }
.svcp__node { left: -17px; top: 12px; }
.svcp__ghead { padding-top: 10px; }
.svcp__split { display: none; }

/* Regular: a single, flat plate with a solid blue spine */
.svcp__group--regular { border-left: 3px solid var(--svcp-blue); padding-left: 19px; }
.svcp__group--regular .svcp__rail { display: none; }
.svcp__group--regular .svcp__node { left: -19px; }

/* Made to order: a stacked plate, dashed metal spine, hatched head */
.svcp__group--onDemand {
  position: relative;
  margin-left: 6px;
  border-color: #c3cad6;
  background:
    linear-gradient(135deg, rgba(185, 193, 206, 0.22), rgba(251, 247, 240, 0) 55%),
    var(--svcp-paper);
  box-shadow: -6px 6px 0 -1px #e7e3da, -6px 6px 0 0 #c3cad6;
  clip-path: none;
}
.svcp__group--onDemand .svcp__ghead {
  margin: 0 -14px 4px -22px;
  padding: 10px 14px 10px 22px;
  background: repeating-linear-gradient(135deg, rgba(185, 193, 206, 0.28) 0 1px, rgba(185, 193, 206, 0) 1px 6px);
  border-bottom: 1px solid #d3d9e2;
}
.svcp__group--onDemand .svcp__node { left: 5px; }
.svcp__chip {
  flex: none;
  padding: 2px 7px;
  font-size: 9.5px;
  color: var(--svcp-blue);
  border: 1px solid var(--svcp-blue);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.svcp__route { margin: 6px 0 12px; }

/* ---------- ADD: assemble. Fragments converge on the thumbnail, a blue
   edge draws around the row, then it settles ---------- */

.svcp__item.is-landing { animation: svcp-land-3 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.08) both; }
@keyframes svcp-land-3 {
  0% { opacity: 0; transform: translateY(-22px); background: rgba(29, 107, 255, 0.14); }
  55% { opacity: 1; background: rgba(29, 107, 255, 0.08); }
  100% { opacity: 1; transform: none; background: rgba(29, 107, 255, 0); }
}
.svcp__trace {
  position: absolute;
  inset: 3px 0 3px 0;
  border: 1.5px solid var(--svcp-blue);
  pointer-events: none;
  clip-path: inset(0 100% 100% 0);
  animation: svcp-trace 0.9s cubic-bezier(0.5, 0, 0.2, 1) 0.1s both;
}
@keyframes svcp-trace {
  0% { clip-path: inset(0 100% 100% 0); opacity: 1; }
  45% { clip-path: inset(0 0 100% 0); opacity: 1; }
  80% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
.svcp__dock { position: absolute; left: 0; top: 10px; width: 62px; height: 62px; pointer-events: none; }
.svcp__dock i {
  position: absolute;
  width: 8px;
  height: 14px;
  background: linear-gradient(160deg, #7fb0ff, var(--svcp-blue));
  clip-path: polygon(0 0, 100% 20%, 80% 100%, 10% 80%);
  left: 27px;
  top: 24px;
  opacity: 0;
}
.svcp__dock i:nth-child(1) { animation: svcp-dock-1 0.7s cubic-bezier(0.3, 0, 0.2, 1) 0.05s both; }
.svcp__dock i:nth-child(2) { animation: svcp-dock-2 0.7s cubic-bezier(0.3, 0, 0.2, 1) 0.1s both; }
.svcp__dock i:nth-child(3) { animation: svcp-dock-3 0.7s cubic-bezier(0.3, 0, 0.2, 1) 0.15s both; }
.svcp__dock i:nth-child(4) { animation: svcp-dock-4 0.7s cubic-bezier(0.3, 0, 0.2, 1) 0.2s both; }
@keyframes svcp-dock-1 { 0% { opacity: 1; transform: translate(-46px, -34px) rotate(-30deg); } 100% { opacity: 0; transform: none; } }
@keyframes svcp-dock-2 { 0% { opacity: 1; transform: translate(52px, -40px) rotate(40deg); } 100% { opacity: 0; transform: none; } }
@keyframes svcp-dock-3 { 0% { opacity: 1; transform: translate(-38px, 44px) rotate(24deg); } 100% { opacity: 0; transform: none; } }
@keyframes svcp-dock-4 { 0% { opacity: 1; transform: translate(48px, 40px) rotate(-36deg); } 100% { opacity: 0; transform: none; } }
.svcp__item.is-landing .svcp__thumb-frame { animation: svcp-frame-flash 0.9s ease 0.3s both; }
@keyframes svcp-frame-flash { 0%, 100% { filter: none; } 30% { filter: drop-shadow(0 0 0 transparent) saturate(1.4) brightness(1.08); } }

/* existing line, one more: the thumbnail plate pops forward once */
.svcp__item.is-bumped .svcp__thumb-frame { animation: svcp-bump 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.2) both; }
.svcp__item.is-bumped .svcp__thumb::before { border-color: var(--svcp-blue); transition: border-color 0.4s; }
@keyframes svcp-bump { 0% { transform: none; } 40% { transform: translate(-3px, -3px); } 100% { transform: none; } }

/* ---------- REMOVE: cut. Cold, grey, no blue except the seam ---------- */

.svcp__shardrow--a { animation: svcp-cut-a-3 0.55s cubic-bezier(0.5, 0, 0.2, 1) 0.08s both; }
.svcp__shardrow--b { animation: svcp-cut-b-3 0.55s cubic-bezier(0.5, 0, 0.2, 1) 0.08s both; }
@keyframes svcp-cut-a-3 { 0% { filter: grayscale(1); } 100% { transform: translate(-44px, 10px) rotate(-3deg); opacity: 0; filter: grayscale(1) contrast(0.9); } }
@keyframes svcp-cut-b-3 { 0% { filter: grayscale(1); } 100% { transform: translate(44px, -10px) rotate(3deg); opacity: 0; filter: grayscale(1) contrast(0.9); } }
.svcp__item.is-splitting::after { animation: svcp-seam-3 0.45s ease-out both; }
@keyframes svcp-seam-3 { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.svcp__group { transition: height 0.3s cubic-bezier(0.5, 0, 0.2, 1), margin 0.3s, opacity 0.25s; }
.svcp__group.is-folding { margin-bottom: 0; opacity: 0; border-width: 0; }

/* ---------- DECREMENT: a quiet step down, nothing leaves ---------- */

.svcp__item[data-tick="down"] .svcp__thumb-frame { animation: svcp-sink 0.4s ease both; }
@keyframes svcp-sink { 0% { transform: none; } 40% { transform: translate(2px, 2px); filter: grayscale(0.7); } 100% { transform: none; } }

@media (max-width: 767px) {
  .svcp__floor { left: 14px; right: -6px; top: 12px; bottom: -12px; }
  .svcp__floor--b { left: 24px; right: -6px; top: 22px; bottom: -22px; }
  .svcp__group { padding-right: 10px; }
}
