/* =========================================================
   AfterLife Ink — demo store: header cart, drawer, shop options, checkout
   ========================================================= */

/* header: cart + book + burger grouped on the right */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cart {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.nav-cart svg { width: 26px; height: 26px; transition: color .2s, filter .2s; }
.nav-cart:hover svg { color: var(--mag); filter: drop-shadow(0 0 6px var(--mag)); }
.cart-badge {
  position: absolute; top: -1px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font: 700 11px/1 var(--f-body);
  background: var(--mag); color: #16000f; box-shadow: 0 0 10px var(--mag);
}
.cart-badge[hidden] { display: none; }

/* drawer */
.cart-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
.cart-scrim[hidden] { display: none; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(400px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(#141117, #09080b), var(--noise); background-blend-mode: overlay;
  border-left: 1px solid #2c2832; box-shadow: -20px 0 60px rgba(0,0,0,.7), -1px 0 0 rgba(255,43,214,.3);
  transform: translateX(105%); transition: transform .45s cubic-bezier(.2,.7,.2,1);
  visibility: hidden;
}
.cart-drawer.open { transform: none; visibility: visible; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #2c2832; }
.cart-head h2 { font: 400 34px/1 var(--f-brush); }
.cart-close { width: 44px; height: 44px; font-size: 32px; line-height: 1; background: none; border: 0; color: var(--text); cursor: pointer; }
.cart-lines { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #221f27; }
.cart-line img { width: 64px; height: 64px; object-fit: contain; background: radial-gradient(circle, #241a24, #0d0b0f 70%); border-radius: 4px; }
.cl-info { display: grid; gap: 3px; min-width: 0; }
.cl-info b { font: 700 13px/1.25 var(--f-head); letter-spacing: .06em; text-transform: uppercase; }
.cl-info span { font-size: 13px; color: var(--muted); }
.cl-end { display: grid; justify-items: end; gap: 6px; }
.cl-end b { font: 700 15px/1 var(--f-body); }
.cl-remove { background: none; border: 0; padding: 0; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.cl-remove:hover { color: var(--mag); }
.qty { display: inline-flex; align-items: center; margin-top: 4px; border: 1px solid #3a3540; border-radius: 3px; width: max-content; }
.qty button { width: 30px; height: 28px; background: none; border: 0; color: var(--text); font-size: 16px; cursor: pointer; }
.qty button:hover { color: var(--mag); }
.qty span { min-width: 22px; text-align: center; font-size: 14px; color: var(--text); }
.cart-empty { display: grid; justify-items: center; gap: 16px; padding: 60px 0; text-align: center; color: var(--muted); }
.cart-foot { display: grid; gap: 10px; padding: 18px 20px 22px; border-top: 1px solid #2c2832; }
.cart-foot[hidden] { display: none; }
.cart-sub { display: flex; justify-content: space-between; font: 700 15px/1 var(--f-head); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.cart-sub b { font-family: var(--f-body); color: var(--mag); font-size: 18px; letter-spacing: 0; }
.cart-demo { text-align: center; font-size: 12px; color: var(--muted); }

/* shop: options + add to cart */
.buy { display: grid; gap: 10px; margin-top: auto; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opt span { font: 700 11px/1 var(--f-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.opt select {
  flex: 1; max-width: 160px; min-height: 40px; padding: 0 10px;
  background: #050406; color: var(--text); border: 1px solid #3a3540; border-radius: 3px; cursor: pointer;
}
.opt select:focus { outline: none; border-color: var(--mag); }
.add-cart.added { background: var(--grn); box-shadow: 0 0 18px rgba(57,255,136,.6); color: #021a0b; }

/* checkout */
.page-hero-sm { padding: 46px 0 30px; }
.demo-banner {
  margin-bottom: 26px; padding: 12px 16px; border-radius: 4px; text-align: center; font-size: 14px;
  border: 1px dashed rgba(57,255,136,.6); background: rgba(57,255,136,.06); color: #d9ffe9;
}
.co-empty { display: grid; justify-items: center; gap: 14px; padding: 40px 0; text-align: center; }
.co-empty h2 { font: 400 40px/1 var(--f-brush); }
.co-empty[hidden], .co-grid[hidden], .co-done[hidden] { display: none; }
.co-grid { display: grid; gap: 26px; align-items: start; }
.co-form fieldset { margin: 0 0 22px; padding: 0; border: 0; }
.co-form legend { margin-bottom: 12px; font: 700 15px/1 var(--f-head); letter-spacing: .16em; text-transform: uppercase; color: var(--mag); }
.co-row { display: grid; gap: 12px; }
.co-field { display: grid; gap: 6px; margin-bottom: 12px; }
.co-row .co-field { margin-bottom: 0; }
.co-row + .co-field, .co-field + .co-row { margin-top: 12px; }
.co-field span { font: 600 11px/1 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: #cfc7d6; }
.co-field input, .co-promo input {
  width: 100%; min-height: 46px; padding: 0 14px; font-size: 15px;
  background: rgba(5,4,6,.85); color: var(--text); border: 1px solid #3a3540; border-radius: 3px;
}
.co-field input:focus, .co-promo input:focus { outline: none; border-color: var(--mag); box-shadow: 0 0 0 1px var(--mag), 0 0 14px rgba(255,43,214,.35); }
.co-field input.err { border-color: #ff4d6a; }
.co-choices { display: grid; gap: 10px; }
.co-choice { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid #3a3540; border-radius: 4px; background: #0d0c10; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.co-choice[hidden] { display: none; }
.co-choice input { accent-color: var(--mag); width: 18px; height: 18px; }
.co-choice span { display: grid; gap: 2px; }
.co-choice b { font: 700 14px/1.2 var(--f-head); letter-spacing: .06em; }
.co-choice small { color: var(--muted); font-size: 13px; }
.co-choice:has(input:checked) { border-color: var(--mag); box-shadow: 0 0 14px rgba(255,43,214,.3); }
.co-gift-note { margin-top: 10px; font-size: 14px; color: #d9ffe9; }
.co-address { margin-top: 14px; }
.co-address[hidden], .co-gift-note[hidden] { display: none; }
.co-card { padding: 16px; border-radius: 6px; border: 1px solid #3a3540; background: linear-gradient(135deg, #1a1220, #0b090d); }
.co-card input { color: var(--muted); cursor: not-allowed; }
.co-card-demo { margin-bottom: 12px; font-size: 13px; color: #ffd0f6; }
.co-error { min-height: 1em; margin-bottom: 10px; color: #ff8fa3; font-size: 14px; }
.co-place { width: 100%; min-height: 54px; font-size: 14px; }

.co-summary {
  padding: 22px; border: 1px solid #2c2832; border-radius: 6px;
  background: linear-gradient(#141117, #0b0a0d), var(--noise); background-blend-mode: overlay;
}
.co-summary h2 { margin-bottom: 6px; font: 400 32px/1 var(--f-brush); }
.co-lines .cart-line { grid-template-columns: 56px 1fr auto; }
.co-lines .cart-line img { width: 56px; height: 56px; }
.co-promo { display: flex; gap: 8px; margin-top: 16px; }
.co-promo input { min-height: 42px; text-transform: uppercase; }
.co-promo .btn { min-height: 42px; padding: 0 14px; }
.co-promo-msg { min-height: 1em; margin-top: 6px; font-size: 13px; }
.co-promo-msg.ok { color: var(--grn); }
.co-promo-msg.bad { color: #ff8fa3; }
.co-totals { display: grid; gap: 8px; margin: 14px 0 0; }
.co-totals div { display: flex; justify-content: space-between; font-size: 15px; color: #d6cfdc; }
.co-totals div[hidden] { display: none; }
.co-totals dd { color: var(--text); }
.co-disc dd { color: var(--grn) !important; }
.co-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid #2c2832; }
.co-total dt { font: 700 16px/1 var(--f-head); letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.co-total dd { font: 700 24px/1 var(--f-body); color: var(--mag) !important; text-shadow: 0 0 12px rgba(255,43,214,.5); }
.co-hint { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

.co-done { max-width: 620px; margin: 0 auto; text-align: center; display: grid; justify-items: center; gap: 10px; }
.co-done h2 { font: 400 clamp(38px, 8vw, 60px)/1 var(--f-brush); }
.co-done p { color: #d6cfdc; }
.co-done .co-order { color: var(--mag); letter-spacing: .08em; }
.co-done-lines { width: 100%; margin: 6px 0; text-align: left; }
.co-demo-note { font-size: 13px; color: var(--muted) !important; }
.co-done .cta-row { justify-content: center; margin-top: 8px; }
.seal {
  width: 110px; height: 110px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6fe4, #b8139a 55%, #5a0b4f);
  box-shadow: 0 0 0 6px rgba(184,19,154,.35), 0 0 40px rgba(255,43,214,.6), inset 0 -8px 16px rgba(0,0,0,.4);
  color: #2a0425; animation: sealStamp .7s cubic-bezier(.3,1.6,.5,1) both;
}
.seal svg { width: 54px; height: 54px; filter: drop-shadow(0 1px 0 rgba(255,255,255,.35)); }
@keyframes sealStamp { from { transform: scale(2.4) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 700px) {
  .co-row { grid-template-columns: 1fr 1fr; }
  .co-row-3 { grid-template-columns: 2fr 1fr 1fr; }
  .co-choices { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .co-grid { grid-template-columns: 1.35fr 1fr; gap: 40px; }
  .co-summary { position: sticky; top: 90px; }
}
@media (prefers-reduced-motion: reduce) { .cart-drawer { transition: none; } .seal { animation: none; } }

/* order seal: painted skull medallion */
.seal { width: 124px; height: 124px; overflow: hidden; background: #0b090c; border: 3px solid var(--mag); }
.seal img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; filter: contrast(1.1); }
