/* Cart — header icon, slide-in drawer, cart page, steppers. */

/* ---- header cart icon + badge ---- */
.cart-toggle {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease);
}
.cart-toggle:hover { color: var(--accent); }
.cart-toggle svg { width: 21px; height: 21px; }
.cart-badge {
  position: absolute; top: -3px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 700; line-height: 1;
  color: var(--accent-ink); background: var(--accent);
  border-radius: 10px;
}

/* ---- add-to-cart buttons ---- */
.btn-add { width: 100%; margin-top: 14px; justify-content: center; }
.btn.added { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- quantity stepper ---- */
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: 40px; overflow: hidden;
}
.qty-stepper button {
  width: 40px; height: 44px; font-size: 1.1rem; color: var(--text);
  transition: background var(--dur-fast) var(--ease);
}
.qty-stepper button:hover { background: var(--bg-3); color: var(--accent); }
.qty-stepper input, .qty-stepper span {
  width: 42px; height: 44px; text-align: center; border: 0; background: transparent;
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.qty-stepper.sm button { width: 30px; height: 32px; font-size: 0.95rem; }
.qty-stepper.sm span { width: 30px; height: 32px; font-size: 0.85rem; }

/* ---- cart line item (shared by drawer + page) ---- */
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ci--lg { grid-template-columns: 92px 1fr auto; gap: 20px; padding: 22px 0; }
.ci-media { aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.ci-media img { width: 100%; height: 100%; object-fit: cover; filter: var(--img-filter); }
.ci-brand { font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.ci-name { font-family: var(--font-display); font-size: 1.02rem; margin-top: 2px; }
.ci--lg .ci-name { font-size: 1.22rem; }
.ci-controls { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ci-remove { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--text-3); transition: color var(--dur-fast) var(--ease); }
.ci-remove:hover { color: #c46b6b; }
.ci-line { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); white-space: nowrap; }

/* ---- slide-in drawer ---- */
.cart-drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.cart-drawer.open { visibility: visible; }
.cart-scrim { position: absolute; inset: 0; background: rgba(8,7,10,0.55); opacity: 0; transition: opacity var(--dur) var(--ease); }
.cart-drawer.open .cart-scrim { opacity: 1; }
.cart-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(420px, 92vw);
  background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur) var(--ease);
}
.cart-drawer.open .cart-panel { transform: none; }
.cart-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 1.2rem; }
.cart-panel-count { color: var(--accent); font-family: var(--font-body); font-size: 0.85rem; }
.cart-close { font-size: 1.7rem; line-height: 1; color: var(--text-2); }
.cart-close:hover { color: var(--accent); }
.cart-panel-items { flex: 1; overflow-y: auto; padding: 0 26px; }
.cart-panel-items .ci:last-child { border-bottom: 0; }
.cart-panel-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-3); padding: 40px; text-align: center; }
.cart-panel-foot { padding: 22px 26px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.cart-panel-foot .btn-primary { justify-content: center; }
.cart-panel-foot .btn-text { text-align: center; }
.cart-sum-row { display: flex; justify-content: space-between; align-items: baseline; }
.cart-sum-row.total { font-family: var(--font-display); }
.cart-sum-row.total span:last-child { font-size: 1.3rem; color: var(--accent); }

/* ---- cart page ---- */
.cart-page { padding-top: 130px; }
.cart-title { font-size: clamp(2rem, 1rem + 3vw, 3.2rem); margin-bottom: clamp(24px, 3vw, 40px); }
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: clamp(28px, 4vw, 60px); align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-list .ci:first-child { border-top: 1px solid var(--line); }
.cart-empty-state { padding: 60px 0; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cart-summary { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 2.5vw, 34px); position: sticky; top: 100px; }
.cart-summary h3 { font-size: 1.3rem; margin-bottom: 18px; }
.cart-summary .cart-sum-row { padding: 8px 0; }
.cart-summary .cart-sum-row.total { padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line); }
.cart-form { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.cart-submit { justify-content: center; margin-top: 4px; }
.cart-submit:disabled { opacity: 0.45; pointer-events: none; }

/* segmented pickup/delivery control */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span { display: block; text-align: center; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 0.85rem; color: var(--text-2); transition: all var(--dur-fast) var(--ease); }
.seg-opt input:checked + span { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.addr-req { color: var(--accent); }

body.cart-open { overflow: hidden; }

/* ---- order confirmation recap ---- */
.order-ref { margin-top: 26px; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.order-ref strong { color: var(--accent); margin-left: 8px; letter-spacing: 0.08em; }
.order-recap { max-width: 460px; margin: 26px auto 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px 22px; background: var(--bg-2); }
.recap-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.recap-row:last-child { border-bottom: 0; }
.recap-row em { color: var(--text-3); font-style: normal; }
.recap-total { font-family: var(--font-display); font-size: 1.05rem; }
.recap-total span:last-child { color: var(--accent); }
