/* ============================================================ THE CART
   The nav's cart button and the panel that slides in from the right.
   Built by cart.js on every page. Daylight surfaces in ink, the same plate
   and hairline language as the pack cards on the product pages. */

/* ---- the nav button ---- */
.td-cart-btn {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--td-line-light);
  border-radius: 999px;
  background: transparent;
  color: var(--st-on-light);
  cursor: pointer;
  transition: border-color var(--st-dur-base) var(--st-ease),
              background-color var(--st-dur-base) var(--st-ease);
}
.td-cart-btn:hover { border-color: var(--st-navy); background: rgba(255, 255, 255, .5); }
.td-cart-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.td-cart-btn__n {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding-inline: 5px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--st-deep-cyan); color: #FFFFFF;
  font-family: var(--st-font-data); font-size: .68rem; line-height: 1;
}
.td-cart-btn__n[hidden] { display: none; }
.td-nav.is-deep .td-cart-btn { color: var(--st-on-dark); border-color: var(--td-line-dark); }
.td-nav.is-deep .td-cart-btn:hover { border-color: var(--st-glow); background: rgba(255, 255, 255, .06); }
.td-nav.is-deep .td-cart-btn__n { background: var(--st-glow); color: var(--st-navy); }

/* ---- the panel ---- */
html.td-cart-open { overflow: hidden; }

.td-cart { position: fixed; inset: 0; z-index: 200; }
.td-cart[hidden] { display: none; }
.td-cart__scrim {
  position: absolute; inset: 0;
  background: rgba(var(--td-dark), .48);
  opacity: 0;
  transition: opacity 240ms var(--st-ease);
}
.td-cart__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--st-glass-2);
  color: var(--st-on-light);
  box-shadow: -20px 0 48px rgba(var(--td-dark), .22);
  transform: translateX(100%);
  transition: transform 260ms var(--st-ease);
  outline: none;
}
.td-cart.is-open .td-cart__scrim { opacity: 1; }
.td-cart.is-open .td-cart__panel { transform: none; }
.td-cart.is-busy .td-cart__body { opacity: .55; pointer-events: none; }

.td-cart__head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--td-nav-h);
  padding-inline: 24px;
  border-bottom: 1px solid var(--td-line-light);
}
.td-cart__h {
  margin: 0;
  font-family: var(--st-font-ui);
  font-size: var(--st-size-eyebrow); font-weight: var(--st-fw-med);
  letter-spacing: var(--st-track-eyebrow); text-transform: uppercase;
}
.td-cart__close {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; color: inherit; cursor: pointer;
}
.td-cart__close svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}

.td-cart__body {
  flex: 1; overflow-y: auto;
  padding: 8px 24px;
  transition: opacity var(--st-dur-base) var(--st-ease);
}
.td-cart__lines { list-style: none; margin: 0; padding: 0; }
.td-cart__line {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 20px;
  border-bottom: 1px solid var(--td-line-soft);
}
.td-cart__name {
  margin: 0;
  font-family: var(--st-font-ui); font-size: 1rem; font-weight: var(--st-fw-med);
}
.td-cart__detail {
  margin: 4px 0 0;
  font-family: var(--st-font-data); font-size: .78rem; letter-spacing: .02em;
  color: var(--st-on-light-mute);
}
.td-cart__remove {
  margin-top: 10px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font-family: var(--st-font-data); font-size: .72rem; letter-spacing: .04em;
  color: var(--st-on-light-mute);
  text-decoration: underline; text-underline-offset: 3px;
}
.td-cart__remove:hover { color: var(--st-on-light); }
.td-cart__side { display: grid; justify-items: end; align-content: start; gap: 10px; }
.td-cart__price { margin: 0; font-family: var(--st-font-data); font-size: .95rem; }
.td-cart__qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--td-line-light); border-radius: 999px;
}
.td-cart__qty button {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--st-on-light);
}
.td-cart__qty button:hover { background: rgba(12, 31, 48, .06); }
.td-cart__qty svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}
.td-cart__qty span {
  min-width: 22px; text-align: center;
  font-family: var(--st-font-data); font-size: .85rem;
}

.td-cart__empty {
  display: grid; justify-items: start; gap: 18px;
  padding-block: 32px;
}
.td-cart__empty p { margin: 0; font-size: 1rem; }

.td-cart__foot {
  display: grid; gap: 12px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--td-line-light);
}
.td-cart__foot[hidden] { display: none; }
.td-cart__sub {
  display: flex; justify-content: space-between; margin: 0;
  font-family: var(--st-font-ui); font-size: 1rem; font-weight: var(--st-fw-med);
}
.td-cart__total { font-family: var(--st-font-data); }
.td-cart__note {
  margin: 0;
  font-family: var(--st-font-data); font-size: .74rem; letter-spacing: .02em;
  color: var(--st-on-light-mute);
}
.td-cart__checkout { width: 100%; justify-content: center; }
.td-cart__status { margin: 0; font-size: .85rem; color: #9A3B2A; }
.td-cart__status:empty { display: none; }


@media (prefers-reduced-motion: reduce) {
  .td-cart__scrim, .td-cart__panel { transition: none; }
}
@media (max-width: 520px) {
  .td-cart-btn { width: 42px; height: 42px; }
  /* the depth readout is decoration (aria-hidden); with the cart button
     in the bar there is no room left for it on a phone */
  .td-nav__depth { display: none !important; }
  .td-cart__head, .td-cart__body, .td-cart__foot { padding-inline: 16px; }
}
