/* =====================================================================
   ZibCore — Cart drawer, nav cart button, checkout page
   Reuses tokens from styles.css (--accent, --ink, etc.)
   ===================================================================== */

/* ---- Nav cart button ------------------------------------------------ */
.zc-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.zc-cart-btn:hover {
  border-color: rgba(47, 78, 214, 0.4);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.zc-cart-btn svg { width: 18px; height: 18px; }
.zc-cart-btn__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-family: var(--font-sans);
  animation: zcCartBadge .4s cubic-bezier(.16,1,.3,1);
}
@keyframes zcCartBadge {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ---- Drawer --------------------------------------------------------- */
.zc-cart {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}
.zc-cart.is-open { visibility: visible; pointer-events: auto; }

.zc-cart__scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 48, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.zc-cart.is-open .zc-cart__scrim { opacity: 1; }

.zc-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: calc(100vw - 40px);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 80px -30px rgba(20, 40, 110, 0.4);
  transform: translateX(100%);
  transition: transform .4s var(--ease-out);
  font-family: var(--font-sans);
}
.zc-cart.is-open .zc-cart__panel { transform: translateX(0); }

.zc-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.zc-cart__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.zc-cart__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.zc-cart__close:hover { background: var(--bg-soft); color: var(--ink); }
.zc-cart__close svg { width: 16px; height: 16px; }

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

.zc-cart__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.zc-cart__item-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.zc-cart__tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}
.zc-cart__item-main small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}
.zc-cart__item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.zc-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.zc-cart__qty button {
  width: 28px;
  height: 28px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.zc-cart__qty button:hover { background: var(--bg-soft); }
.zc-cart__qty span {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.zc-cart__remove {
  border: 0;
  background: none;
  color: var(--ink-mute);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color .15s var(--ease);
}
.zc-cart__remove:hover { color: #d33; text-decoration: underline; }

.zc-cart__empty {
  text-align: center;
  padding: 60px 20px;
}
.zc-cart__empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--ink-mute);
}
.zc-cart__empty-icon svg { width: 26px; height: 26px; }
.zc-cart__empty p { color: var(--ink-soft); margin: 0 0 18px; }

.zc-cart__foot {
  border-top: 1px solid var(--line);
  padding: 20px 24px 24px;
  background: var(--bg-soft);
}
.zc-cart__totals { margin-bottom: 16px; }
.zc-cart__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.zc-cart__total-row span { color: var(--ink-soft); font-size: 14px; }
.zc-cart__total-row strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.zc-cart__total-row--sub strong { font-size: 15px; color: var(--ink-soft); }
.zc-cart__checkout { margin-bottom: 10px; }
.zc-cart__note { margin: 0; font-size: 11.5px; color: var(--ink-mute); text-align: center; line-height: 1.4; }

@media (max-width: 480px) {
  .zc-cart__panel { width: 100%; max-width: 100%; }
}

/* "Added ✓" button flash */
.btn.is-added {
  background: #10b981 !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* =====================================================================
   Checkout page
   ===================================================================== */
.checkout {
  padding: 140px 0 100px;
  min-height: 100vh;
}
.checkout__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .checkout__grid { grid-template-columns: 1fr; gap: 36px; }
}

.checkout__head { margin-bottom: 36px; }
.checkout__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 20px;
}
.checkout__back:hover { color: var(--ink); }

/* Order summary card */
.summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  position: sticky;
  top: 100px;
}
.summary h3 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.summary__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.summary__item:first-of-type { border-top: 1px solid var(--line); }
.summary__item-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.summary__item-sub { display: block; font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; font-weight: 500; }
.summary__item-price { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary__qty { color: var(--ink-mute); font-weight: 500; }

.summary__totals { margin-top: 18px; padding-top: 18px; }
.summary__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.summary__total-row span { color: var(--ink-soft); font-size: 14px; }
.summary__total-row strong { font-size: 15px; color: var(--ink); font-weight: 600; }
.summary__total-row--due {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}
.summary__total-row--due span { color: var(--ink); font-weight: 600; font-size: 15px; }
.summary__total-row--due strong {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.summary__monthly-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.summary__monthly-note strong { color: var(--ink); font-weight: 600; }

.summary__empty { text-align: center; padding: 30px 0; color: var(--ink-soft); }
.summary__trust {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-mute);
}
.summary__trust svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Checkout form reuses .contact-field etc. from styles.css */
.checkout__form { display: grid; gap: 20px; }
.checkout__section-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  margin: 0 0 -4px;
}
.checkout__pay {
  margin-top: 4px;
  width: 100%;
  position: relative;
}
.checkout__pay .checkout__pay-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: zcPaySpin .8s linear infinite;
}
.checkout__pay.is-loading .checkout__pay-label { display: none; }
.checkout__pay.is-loading .checkout__pay-spinner { display: inline-block; }
@keyframes zcPaySpin { to { transform: rotate(360deg); } }

.checkout__stripe-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  font-size: 12.5px;
  color: #92670a;
  line-height: 1.45;
}
.checkout__stripe-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

.checkout__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-mute);
}
.checkout__secure svg { width: 13px; height: 13px; }

/* Success state after (stub) payment */
.checkout__done {
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 0;
}
.checkout__done-icon {
  width: 72px; height: 72px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 18px 40px -12px rgba(16,185,129,0.5);
}
.checkout__done-icon svg { width: 34px; height: 34px; }
.checkout__done h2 { margin: 0 0 10px; }
.checkout__done p { color: var(--ink-soft); margin: 0 auto 24px; max-width: 38ch; }
