/* ==========================================================================
   Cart drawer — slides in from the right, shared by every page.
   Markup is injected by cart.js, so no page has to carry it.
   ========================================================================== */

.cart-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(11, 27, 63, 0.32);
  opacity: 0; pointer-events: none;
  transition: opacity 0.24s ease;
  backdrop-filter: blur(2px);
}
.cart-scrim.is-open { opacity: 1; pointer-events: auto; }

.cart {
  position: fixed; top: 0; right: 0; z-index: 91;
  width: min(420px, 100vw);
  height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(11, 27, 63, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  font-family: var(--ui);
}
.cart.is-open { transform: none; }

.cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.cart__title {
  font-family: var(--display);
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
  color: var(--ink); margin: 0;
}
.cart__count { color: var(--ink-3); font-weight: 500; }

.cart__close {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.cart__close:hover { background: var(--line-3); color: var(--ink); }

.cart__body { flex: 1 1 auto; overflow-y: auto; padding: 6px 24px; }

.cart__empty {
  padding: 56px 8px; text-align: center; color: var(--ink-3);
  font-size: 14.5px; line-height: 1.6;
}
.cart__empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* --------------------------------------------------------------- line --- */

.cline {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 14px; align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-3);
}
.cline:last-child { border-bottom: 0; }

.cline__shot {
  width: 68px; height: 68px; border-radius: var(--r-sm, 12px);
  overflow: hidden; background: var(--plate);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.cline__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cline__name {
  font-weight: 600; font-size: 14.5px; color: var(--ink);
  line-height: 1.35; margin: 0 0 3px;
}
.cline__variant { font-size: 12.5px; color: var(--ink-3); margin-bottom: 9px; }

.cline__price { font-weight: 700; font-size: 14.5px; color: var(--ink); white-space: nowrap; }

.cline__remove {
  display: block; margin-top: 8px; margin-left: auto;
  background: none; border: 0; padding: 0;
  font-family: var(--ui); font-size: 12.5px; color: var(--ink-3);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.cline__remove:hover { color: var(--danger); }

/* quantity stepper */
.cqty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: 999px;
  overflow: hidden; height: 30px;
}
.cqty button {
  width: 30px; height: 28px; border: 0; background: none;
  font-size: 16px; line-height: 1; color: var(--ink-2);
  cursor: pointer; transition: background 0.15s ease;
}
.cqty button:hover:not(:disabled) { background: var(--line-3); color: var(--ink); }
.cqty button:disabled { opacity: 0.35; cursor: default; }
.cqty span {
  min-width: 26px; text-align: center;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

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

.cart__foot {
  flex: 0 0 auto;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.cart__row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.cart__row-label { font-size: 14px; color: var(--ink-2); }
.cart__row-value {
  font-family: var(--display); font-weight: 700;
  font-size: 21px; color: var(--ink); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.cart__note {
  font-size: 12.5px; color: var(--ink-3);
  margin: 2px 0 14px; line-height: 1.5;
}

/* ------------------------------------------------------------- badge ---- */

.nav__cart { position: relative; }
.nav__cart-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--blue); color: #fff;
  font-family: var(--ui); font-size: 11px; font-weight: 700; line-height: 18px;
  text-align: center;
  border: 2px solid var(--surface);
  transform: scale(0); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.nav__cart-badge.is-on { transform: scale(1); }

/* --------------------------------------------------- unconfigured note -- */

.cart__setup {
  margin: 18px 0; padding: 14px 16px;
  border: 1px dashed var(--blue-border); border-radius: var(--r-sm, 12px);
  background: var(--blue-tint);
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
}
.cart__setup b { color: var(--ink); }
.cart__setup code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; background: rgba(255, 255, 255, 0.7);
  padding: 1px 5px; border-radius: 4px;
}

@media (max-width: 520px) {
  .cart { width: 100vw; }
  .cart__head, .cart__body, .cart__foot { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart, .cart-scrim, .nav__cart-badge { transition: none; }
}


/* ------------------------------------------------ protection plan ------- */

/* Offered once on the way to checkout, over the drawer. */
.plan {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 27, 63, 0.45);
  backdrop-filter: blur(3px);
}
.plan__card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 30px 30px 24px;
  box-shadow: 0 30px 70px rgba(11, 27, 63, 0.28);
  text-align: center;
}
.plan__title { font: 700 26px var(--display); letter-spacing: -0.025em; margin: 0; }
.plan__name { margin: 14px 0 0; font: 600 15px var(--ui); color: var(--ink); }
.plan__copy {
  margin: 10px 0 0;
  font: 400 14.5px/1.6 var(--ui);
  color: var(--ink-2);
  text-wrap: pretty;
}
.plan__card .btn { margin-top: 22px; }

/* Step two holds two tiers side by side, so it needs more room than the
   question did. */
.plan__card--wide { max-width: 640px; }
.plan__tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
  text-align: left;
}
.plan__tier {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 18px 18px;
  background: var(--plate);
}
.plan__tier-name { margin: 0; font: 700 17px/1.25 var(--display); letter-spacing: -0.02em; }
.plan__tier-price { margin: 8px 0 18px; font: 700 22px var(--display); letter-spacing: -0.025em; }
.plan__tier-copy {
  margin: 10px 0 18px;
  font: 400 13.5px/1.55 var(--ui);
  color: var(--ink-2);
  text-wrap: pretty;
}
/* auto, not a fixed gap: the two buttons then line up with each other however
   long the descriptions above them run. */
.plan__tier .btn { margin-top: auto; }
.plan__terms { margin: 18px 0 0; font: 500 13px var(--ui); }
.plan__terms a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.plan__skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: none;
  background: none;
  font: 500 13.5px var(--ui);
  color: var(--ink-3);
  cursor: pointer;
}
.plan__skip:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .plan { backdrop-filter: none; } }
