/* =========================================================================
   SD FRAMEWORKS — SHOP (cart, checkout, orders, buy box)
   Uses the storefront tokens from base.css.
   ========================================================================= */

/* ---- Navbar cart ---- */
.nav-cart {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-0);
  transition: border-color .25s ease, color .25s ease;
}
.nav-cart:hover { border-color: var(--blue-300); color: var(--blue-500); }
.nav-cart svg { width: 18px; height: 18px; }
.nav-cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--blue-500); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ---- Layout ---- */
.shop-hero { padding-bottom: 40px; }
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 36px; align-items: start; }
.shop-layout-even { grid-template-columns: 1fr 1fr; margin-top: 24px; }
.shop-narrow { max-width: 860px; }
.form-row-3 { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 20px; }

.shop-banner {
  padding: 14px 20px; border-radius: var(--radius-md); background: var(--blue-glow-soft);
  border: 1px solid rgba(47, 107, 255, .18); color: var(--text-1); font-size: 14px; margin-bottom: 24px;
}
.shop-banner strong { color: var(--blue-700); }

/* ---- Cart ---- */
.shop-cart-list { display: flex; flex-direction: column; gap: 14px; }
.shop-cart-line {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto auto; gap: 18px; align-items: center;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.shop-cart-thumb { width: 96px; height: 96px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-2); display: block; }
.shop-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-cart-name { font-family: var(--font-display); font-weight: 600; color: var(--text-0); font-size: 16px; }
.shop-cart-name:hover { color: var(--blue-500); }
.shop-cart-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.shop-cart-meta span { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-1); }
.shop-cart-unit { font-size: 12px; color: var(--text-3); }
.shop-cart-total { font-family: var(--font-display); font-weight: 700; color: var(--text-0); min-width: 84px; text-align: right; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-bright); border-radius: 999px; overflow: hidden; }
.shop-qty button { width: 34px; height: 34px; font-size: 16px; color: var(--text-0); background: transparent; border: 0; cursor: pointer; }
.shop-qty button:hover { background: var(--bg-2); }
.shop-qty span { min-width: 28px; text-align: center; font-weight: 600; font-size: 14px; }
.shop-remove { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--text-3); font-size: 22px; cursor: pointer; line-height: 1; }
.shop-remove:hover { background: #fdedee; color: #c0272f; }
.shop-empty { text-align: center; padding: 20px 0 40px; }

/* ---- Summary ---- */
.shop-summary { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.shop-summary h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 16px; }
.shop-summary-lines { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 12px; }
.shop-summary-lines li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.shop-summary-thumb { position: relative; width: 52px; height: 52px; border-radius: 10px; background: var(--bg-2); flex-shrink: 0; }
.shop-summary-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.shop-summary-thumb em { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--text-0); color: #fff; font-size: 11px; font-style: normal; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.shop-summary-name { flex: 1; min-width: 0; color: var(--text-0); font-weight: 500; }
.shop-summary-name small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.shop-summary-lines strong { color: var(--text-0); white-space: nowrap; }
.shop-totals { margin: 0; border-top: 1px solid var(--border); padding-top: 14px; }
.shop-totals > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.shop-totals dt { color: var(--text-2); font-weight: 400; }
.shop-totals dd { margin: 0; color: var(--text-0); font-weight: 600; }
.shop-totals .grand { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }
.shop-totals .grand dt, .shop-totals .grand dd { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-0); }
.shop-free { color: #0f7a44; }
.shop-assurance { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-2); }
.shop-assurance li::before { content: "✓"; color: var(--blue-500); margin-right: 8px; font-weight: 700; }
.shop-fineprint { font-size: 12px; color: var(--text-3); margin-top: 14px; }
.shop-fineprint a { color: var(--blue-500); }

/* ---- Checkout ---- */
.shop-fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 26px; margin: 0 0 20px; }
.shop-fieldset legend { float: left; width: 100%; font-family: var(--font-display); font-weight: 600; color: var(--text-0); font-size: 17px; margin-bottom: 18px; }
.shop-fieldset legend + * { clear: both; }
.shop-login-hint { font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
.shop-login-hint a { color: var(--blue-500); font-weight: 600; }
.shop-pay-options { display: flex; flex-direction: column; gap: 10px; }
.shop-pay-option { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--border-bright); border-radius: var(--radius-md); cursor: pointer; transition: border-color .2s, background .2s; }
.shop-pay-option:hover { border-color: var(--blue-300); }
.shop-pay-option:has(input:checked) { border-color: var(--blue-500); background: var(--blue-glow-soft); }
.shop-pay-option input { margin-top: 4px; accent-color: var(--blue-500); }
.shop-pay-option strong { display: block; color: var(--text-0); font-size: 15px; }
.shop-pay-option small { color: var(--text-2); font-size: 13px; }
.shop-pay-box { padding: 20px 22px; border-radius: var(--radius-lg); border: 1px dashed var(--blue-300); background: var(--blue-glow-soft); margin: 24px 0; }
.shop-pay-box h4 { margin: 0 0 6px; color: var(--text-0); font-size: 16px; }
.shop-pay-box p { margin: 0; font-size: 14px; color: var(--text-1); }
.shop-pay-details { margin-top: 10px !important; font-family: ui-monospace, Menlo, monospace; font-size: 13px !important; color: var(--text-0) !important; }

/* ---- Order pages ---- */
.shop-success-head { text-align: center; margin-bottom: 26px; }
.shop-success-head .label { justify-content: center; }
.shop-success-head .label::before { display: none; }
.shop-success-head h1 { margin: 16px 0 12px; }
.shop-success-icon { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; align-items: center; justify-content: center; font-size: 28px; color: #fff; background: linear-gradient(135deg, var(--blue-400), var(--blue-700)); box-shadow: 0 16px 40px rgba(47,107,255,.3); margin-bottom: 18px; }
.shop-order-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.shop-address { font-size: 14px; color: var(--text-1); line-height: 1.7; margin: 0; }
.shop-status-delivered { background: #eafbf1; color: #0f7a44; }
.shop-status-cancelled { background: #fdedee; color: #c0272f; }
.shop-progress { list-style: none; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: step; }
.shop-progress li { position: relative; text-align: center; font-size: 12px; color: var(--text-3); padding-top: 34px; }
.shop-progress li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; z-index: 1; }
.shop-progress li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--bg-3); }
.shop-progress li:first-child::after { display: none; }
.shop-progress li.done { color: var(--text-0); font-weight: 600; }
.shop-progress li.done::before { content: "✓"; background: var(--blue-500); color: #fff; }
.shop-progress li.done::after { background: var(--blue-500); }

/* ---- Product page buy box ---- */
.pd-buy-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.pd-buy-actions .btn { flex: 1 1 180px; }
.pd-stock-note { font-size: 13px; color: var(--text-2); margin-bottom: 22px; }
.pd-stock-note.low { color: #b45309; font-weight: 600; }
.pd-enquiry { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); margin-bottom: 36px; }
.pd-enquiry summary { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-0); font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.pd-enquiry summary::-webkit-details-marker { display: none; }
.pd-enquiry summary::after { content: "+"; color: var(--blue-300); font-size: 18px; }
.pd-enquiry[open] summary::after { content: "−"; }
.pd-enquiry summary small { display: block; font-weight: 400; color: var(--text-2); font-size: 12px; }
.pd-enquiry-body { padding: 0 20px 20px; }

/* ---- Account orders ---- */
.account-orders-link { color: var(--blue-500); font-weight: 600; }

@media (max-width: 980px) {
  .shop-layout, .shop-layout-even { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shop-cart-line { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "thumb info remove" "thumb qty total"; gap: 10px 14px; }
  .shop-cart-thumb { width: 72px; height: 72px; grid-area: thumb; }
  .shop-cart-info { grid-area: info; }
  .shop-qty { grid-area: qty; justify-self: start; }
  .shop-cart-total { grid-area: total; }
  .shop-cart-line > form:last-child { grid-area: remove; justify-self: end; }
  .form-row-3 { grid-template-columns: 1fr; }
  .shop-fieldset, .shop-summary { padding: 20px; }
  .shop-progress li { font-size: 10px; }
}
.shop-hero .container { text-align: center; }
.shop-hero .label { display: inline-flex; }
.shop-cart-photo { font-size: 12px; color: #0f7a44; font-weight: 600; margin-bottom: 4px; }
.pd-color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(16,24,40,.2); }
