/* Storefront-specific styles. Inherits all design tokens from /styles.css. */

/* /store/ layout: category sidebar on the left, product grid on the right. */
.store-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.cat-sidebar {
  position: sticky;
  top: 88px;
}
.cat-sidebar-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cat-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.cat-btn {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
}
.cat-btn:hover { color: var(--text); background: var(--surface2); }
.cat-btn.active {
  background: rgba(224,120,0,.08);
  border-color: var(--accent);
  color: var(--accent);
}
.cat-count {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
}
.cat-btn.active .cat-count { color: var(--accent); }

@media (max-width: 800px) {
  .store-layout { grid-template-columns: 1fr; gap: 16px; }
  .cat-sidebar { position: static; }
  .cat-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .cat-list li { flex-shrink: 0; }
  .cat-btn { white-space: nowrap; }
  .cat-sidebar-title { display: none; }
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s ease;
}
.product-card:hover { border-color: var(--accent); }

.product-card-img {
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-card-img.placeholder {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 13px;
}

.product-card-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.product-card-cat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.product-card-name {
  font-family: var(--mono);
  font-size: 17px;
  margin: 0;
}
.product-card-name span { color: var(--accent); }
.product-card-tag {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}
.product-card-price {
  font-family: var(--mono);
  font-size: 15px;
  margin-top: 6px;
}
.product-card-price .from { color: var(--text-dim); font-size: 12px; margin-right: 4px; }
.product-card-stock {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ok);
}
.product-card-stock.made_to_order { color: var(--accent2); }
.product-card-stock.preorder      { color: var(--accent); }
.product-card-stock.sold_out      { color: var(--err); }
.product-card-stock.low_stock     { color: var(--warn); }

/* Product detail */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 800px) {
  .product-layout { grid-template-columns: 1fr; gap: 20px; }
}
.product-image { display: flex; flex-direction: column; gap: 8px; }
.product-image .media-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
  aspect-ratio: 1 / 1;
  position: relative;
}
.product-image .media-stage > img,
.product-image .media-stage > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-image .media-thumbs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.product-image .media-thumb {
  position: relative;
  width: 60px; height: 60px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s;
}
.product-image .media-thumb:hover { border-color: var(--border2); }
.product-image .media-thumb.selected { border-color: var(--accent); }
.product-image .media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-image .media-thumb-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; text-shadow: 0 0 4px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.25);
}

.product-info h1 {
  font-family: var(--mono);
  margin: 0 0 8px;
}
.product-info h1 span { color: var(--accent); }
.product-info .tagline {
  color: var(--text-dim);
  margin: 0 0 16px;
}
.product-info .price-line {
  font-family: var(--mono);
  font-size: 22px;
  margin: 12px 0;
}
.product-info .price-line .lead-time {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.option-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 16px 0;
}
.option-group legend {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 6px;
}
.option-choices {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.option-choice {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface2);
  user-select: none;
}
.option-choice input { accent-color: var(--accent); }
.option-choice:hover { border-color: var(--accent); }
.option-choice.selected {
  border-color: var(--accent);
  background: rgba(224,120,0,.08);
}
.option-choice.out-of-stock {
  opacity: .55;
  cursor: not-allowed;
}
.option-choice.out-of-stock:hover { border-color: var(--border2); }
.option-choice:has(.stock-tag) {
  padding-bottom: 28px;
}
.stock-tag {
  position: absolute;
  bottom: 8px;
  left: 32px;
  font-size: 11px;
  color: var(--text-dim);
}
.stock-tag.low { color: var(--warn); }

.stock-status-line {
  font-family: var(--mono);
  font-size: 12px;
  min-height: 20px;
}
.stock-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
}
.stock-badge.in-stock {
  background: rgba(34,204,119,.12);
  color: var(--ok);
}
.stock-badge.low-stock {
  background: rgba(224,120,0,.12);
  color: var(--warn);
}
.stock-badge.out-of-stock {
  background: rgba(224,51,51,.12);
  color: var(--err);
}

.add-to-cart-row {
  display: flex; gap: 10px; align-items: stretch;
  margin-top: 18px;
  margin-bottom: 28px;
}
.add-error {
  display: none;
  margin: -16px 0 20px;
  padding: 8px 12px;
  border: 1px solid var(--err);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: rgba(224,51,51,.08);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.product-detail {
  margin-top: 32px;
}
.product-detail .summary {
  font-size: 15px;
  line-height: 1.6;
}
.product-detail .summary p { margin: 0 0 12px; }
.product-resources {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.product-dimensions {
  margin: 18px 0 0;
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 13px;
}
.product-dimensions .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.product-dimensions .v { color: var(--text); }
.product-dimensions .muted { font-size: 11px; color: var(--text-dim); }
.add-to-cart-row .btn {
  flex: 1;
  white-space: nowrap;
}
.qty-input {
  width: 72px;
  flex: 0 0 72px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  padding: 8px 10px;
  text-align: center;
}

.spec-list {
  list-style: none; padding: 0; margin: 16px 0;
  font-family: var(--mono); font-size: 13px;
  display: grid; gap: 6px;
}
.spec-list li::before {
  content: '· ';
  color: var(--accent);
}

/* Cart page — card-based layout. Same shape on desktop and mobile,
   just relayed via CSS grid at the breakpoint. */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr 110px 110px;
  align-items: center;
  gap: 16px;
  padding: 12px 36px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-item-img {
  width: 64px; height: 64px; object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
}
.cart-item-img.placeholder {
  background: var(--surface2);
  border: 1px dashed var(--border2);
}
.cart-item-info { min-width: 0; }
.cart-item-name {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.cart-item-name:hover { color: var(--accent); }
.cart-item-variant {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cart-item-max {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--warn);
}
.cart-item-qty {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  justify-self: start;
}
.cart-item-qty .qty-input {
  width: 56px; padding: 6px 8px;
}
.cart-item-price {
  font-family: var(--mono);
  text-align: right;
}
.cart-item-price .line-total {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}
.cart-item-price .unit-price {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
/* Small red × button anchored to the top-right of every cart card. */
.cart-item-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px; height: 24px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--err);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cart-item-remove:hover {
  border-color: var(--err);
  background: rgba(224,51,51,.08);
}

/* Mobile: stack into two columns — image + content. The × stays pinned. */
@media (max-width: 800px) {
  .cart-item {
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "img info"
      "img qty"
      "price price";
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
    padding: 10px 32px 10px 10px;
  }
  .cart-item-img    { grid-area: img; width: 56px; height: 56px; align-self: start; }
  .cart-item-info   { grid-area: info; }
  .cart-item-qty    { grid-area: qty; justify-self: start; }
  .cart-item-price  { grid-area: price; text-align: right; display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; padding-top: 4px; }
  .cart-item-price .unit-price { margin-top: 0; }
}

.cart-summary {
  margin-top: 24px;
  display: flex; justify-content: flex-end; align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cart-summary .total {
  font-family: var(--mono);
  font-size: 18px;
}
@media (max-width: 800px) {
  .cart-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cart-summary .muted {
    font-size: 12px;
    text-align: right;
  }
  .cart-summary .total {
    text-align: right;
  }
  .cart-summary #checkout-btn { width: 100%; }
}

@media (min-width: 720px) {
  /* Make the cart's section fill remaining viewport height so the summary
     can sit at the visible bottom even with a short cart. */
  body.cart-page > section.section { flex: 1; display: flex; flex-direction: column; }
  body.cart-page > section.section > .container { flex: 1; display: flex; flex-direction: column; }
  body.cart-page #cart-root { flex: 1; display: flex; flex-direction: column; }

  .cart-summary {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 16px 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    z-index: 5;
  }
}
.cart-empty {
  text-align: center;
  padding: 48px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Preorder banner on product pages */
.preorder-banner {
  display: block;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(224,120,0,.08);
  border: 1px solid var(--accent);
  border-left-width: 3px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.preorder-banner .label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.preorder-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--sans);
  color: var(--text);
}

/* Out-of-stock banner — same shape as preorder, red accent */
.oos-banner {
  display: block;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(224,51,51,.08);
  border: 1px solid var(--err);
  border-left-width: 3px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.oos-banner .label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--err);
}
.oos-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--sans);
  color: var(--text);
}
.oos-banner a { color: var(--accent); }

/* Bundle-and-save cross-sell box. Sits in the product-info column under the
   buy form on products that are part of a bundle (see `bundle_with` in
   products.json). Tone: complementary nudge, not a competing CTA. */
.bundle-promo {
  display: block;
  margin: 18px 0 0;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.bundle-promo .label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.bundle-promo h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.bundle-promo p {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.bundle-promo p strong { color: var(--accent); }
.bundle-promo .btn { font-size: 12px; padding: 6px 12px; }

/* Saved-address picker on /checkout/ — chips above the Stripe Address Element. */
.saved-addresses { margin-bottom: 14px; }
.saved-addr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-addr-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--mono);
  text-align: left;
  min-width: 180px;
  transition: border-color 0.15s, background 0.15s;
}
.saved-addr-chip:hover { border-color: var(--accent); }
.saved-addr-chip.selected,
.saved-addr-chip.is-default { border-color: var(--accent); background: rgba(224,120,0,0.06); }
.saved-addr-chip strong { font-size: 13px; font-weight: 600; }
.saved-addr-chip span { font-size: 11px; color: var(--text-dim); letter-spacing: 0.02em; }

/* "Signed in as foo@bar.com" pill on /checkout/ — replaces the Stripe
   LinkAuthentication element when the customer is logged in. Email is pinned
   to the PaymentIntent's receipt_email server-side, so editing it here would
   only be cosmetic. */
.signed-in-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.signed-in-pill .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.signed-in-pill .who {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
.signed-in-pill .switch {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-decoration: none;
}
.signed-in-pill .switch:hover { color: var(--accent); }

/* Saved-cards picker on /checkout/. Mirrors the saved-address chip pattern. */
.saved-cards { margin-bottom: 14px; }
.saved-card-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-card-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--mono);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.saved-card-chip:hover { border-color: var(--accent); }
.saved-card-chip.selected { border-color: var(--accent); background: rgba(224,120,0,0.06); }
.saved-card-chip .brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 2px;
  padding: 2px 6px;
  color: var(--accent);
}
.saved-card-chip .number { font-size: 13px; font-weight: 600; }
.saved-card-chip .exp    { font-size: 11px; color: var(--text-dim); }
.saved-card-chip.new .brand { color: var(--accent2); }

/* "Save this card / address to my account" toggle. Sits below the Stripe
   Element it relates to; only shown for logged-in customers entering a fresh
   card / address. */
.save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
/* The .save-toggle display rule above beats the browser default for the
   [hidden] attribute. Restore it explicitly so `row.hidden = true` works. */
.save-toggle[hidden] { display: none; }
.save-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--border2);
  border-radius: 2px;
  background: var(--surface2);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.save-toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.save-toggle input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 12px;
  font-weight: 700;
}
.save-toggle:hover { color: var(--text); }

/* Order-detail items table on /orders/. Screen-only — the @media print
   block further down has the receipt-print version. */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
}
.cart-table th, .cart-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  vertical-align: top;
}
.cart-table thead th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface2);
  font-weight: 500;
}
.cart-table td.right, .cart-table th.right { text-align: right; }
.cart-table tbody tr:last-child td { border-bottom: 0; }
.cart-table tfoot td {
  background: var(--surface2);
  font-size: 13px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
.cart-table tfoot td strong { color: var(--accent); font-weight: 600; }
.oos-notify {
  display: flex; gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.oos-notify input {
  flex: 1; min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 10px;
}
.oos-notify input:focus { outline: none; border-color: var(--accent); }
.oos-notify .btn { flex-shrink: 0; }
.oos-notify-msg {
  margin-top: 8px;
  font-family: var(--mono); font-size: 12px;
  min-height: 16px;
}
.oos-notify-msg.ok  { color: var(--ok); }
.oos-notify-msg.err { color: var(--err); }

/* Custom checkout page */
/* Wider container — the default 880px squashes the form once the summary
   takes its 360px slice. */
body.checkout-page .container { max-width: 1100px; width: min(100% - 2rem, 1100px); }

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  body.checkout-page .summary-card { position: static; }
  /* Show the order summary above the form on mobile so customers see what
     they're paying for before scrolling through Stripe Elements. */
  .checkout-grid > aside        { order: 1; }
  .checkout-grid > .checkout-form { order: 2; }
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.checkout-section + .checkout-section {
  padding-top: 4px;
}
.checkout-section h3 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.checkout-section > div + div { margin-top: 14px; }

.shipping-options {
  display: flex; flex-direction: column; gap: 8px;
}
.shipping-option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
}
.shipping-option:hover { border-color: var(--accent); }
.shipping-option input { accent-color: var(--accent); }
.shipping-option.selected {
  border-color: var(--accent);
  background: rgba(224,120,0,.08);
}
.shipping-option .label   { flex: 1; }
.shipping-option .amount  { font-weight: 600; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: sticky;
  top: 20px;
}
.summary-line {
  display: flex; justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono); font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.summary-line > span:last-child { white-space: nowrap; }
.summary-line .summary-sub {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.02em;
  font-weight: 400;
}
.summary-line.total {
  font-size: 16px;
  border-bottom: none;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border2);
}
/* Avoid the doubled hairline between the row above the Total (which has its
   own border-bottom) and the Total (which adds its own border-top). */
.summary-line:has(+ .summary-line.total) { border-bottom: none; }
.summary-line .name { color: var(--text); }
.summary-line .qty  { color: var(--text-dim); margin-left: 8px; }
.summary-line .amt  { color: var(--text); }
.summary-line.subtle { color: var(--text-dim); }

/* Richer order summary item — used on /checkout/ */
.summary-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.summary-item:first-child { padding-top: 0; }
.summary-item-img {
  width: 56px; height: 56px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
}
.summary-item-img.placeholder {
  background: var(--surface2);
  border: 1px dashed var(--border2);
}
.summary-item-body { min-width: 0; }
.summary-item-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.summary-item-variant {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.summary-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.summary-item-amt {
  color: var(--text);
  font-weight: 600;
}

/* Compact summary cards on phones — smaller image, tighter padding,
   variant + meta on one row to keep each card around 48px tall. */
@media (max-width: 800px) {
  .summary-item {
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 8px 0;
  }
  .summary-item-img { width: 40px; height: 40px; }
  .summary-item-name { font-size: 12px; }
  .summary-item-variant {
    font-size: 10px;
    margin-top: 1px;
    margin-right: 8px;
  }
  .summary-item-meta {
    margin-top: 2px;
    font-size: 11px;
  }
}

.discount-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.discount-box label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.discount-row {
  display: flex; gap: 6px;
}
.discount-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.discount-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.discount-row input:disabled {
  opacity: .7;
}
.discount-row .btn {
  padding: 7px 14px;
  font-size: 12px;
}
.discount-msg {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  min-height: 16px;
}
.discount-msg.ok  { color: var(--ok); }
.discount-msg.err { color: var(--err); }

.divider-or {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 12px 0;
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.pay-row {
  display: flex; gap: 12px; align-items: center;
  margin-top: 8px;
}
.pay-row .btn { flex: 1; }
.pay-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--err);
}

/* Banner — feedback on /account/ and /orders/ pages */
.banner {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 13px;
  border-left-width: 3px;
}
.banner-ok    { border-left-color: var(--ok); }
.banner-warn  { border-left-color: var(--warn); }
.banner-error { border-left-color: var(--err); color: var(--text); }
.banner strong { display: block; margin-bottom: 4px; color: var(--text);
                 font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }

/* Order status pill */
.status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  color: var(--text-dim);
}
.status-pill.paid      { color: var(--accent); border-color: var(--accent); }
.status-pill.shipped   { color: var(--ok);     border-color: var(--ok); }
.status-pill.delivered { color: var(--ok);     border-color: var(--ok); }
.status-pill.refunded,
.status-pill.cancelled { color: var(--err);    border-color: var(--err); }
.status-pill.returned  { color: var(--warn);   border-color: var(--warn); }

/* Order timeline */
.order-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 24px 0 32px;
  position: relative;
}
.order-timeline.refunded { grid-template-columns: 1fr 1fr; }
.order-step {
  position: relative;
  text-align: center;
  padding: 0 8px;
}
.order-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.order-step:first-child::before { display: none; }
.order-step.done::before,
.order-step.current::before {
  /* The connector line lives on the step itself and points *backwards* to the
     previous step (left: -50%; right: 50%). So a step that's reached — whether
     done or current — paints the segment leading up to it green. Without
     `.current::before`, the line into the final reached step (e.g. Delivered
     when an order is fully delivered) stayed grey. */
  background: var(--ok);
}
.order-step.refunded-step::before {
  background: var(--err);
}
.order-step .dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}
.order-step.done .dot,
.order-step.current .dot {
  border-color: var(--ok);
  color: var(--ok);
}
.order-step.refunded-step .dot {
  border-color: var(--err);
  color: var(--err);
}
.order-step.current .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.order-step .label {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
}
.order-step.done .label,
.order-step.current .label { color: var(--text); }
.order-step.refunded-step .label { color: var(--err); }
.order-step .stamp {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Tracking link as a button */
.tracking-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px;
  text-decoration: none;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
}
.tracking-btn:hover { border-color: var(--accent); }
.tracking-btn .arrow { color: var(--accent); }

/* Header cart link + badge */
.header-cart {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.header-cart:hover { border-color: var(--accent); }
.cart-badge {
  display: inline-block;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-size: 11px; line-height: 18px;
  text-align: center;
  background: var(--accent);
  color: #090909;
  border-radius: 9px;
}
.cart-badge:empty { display: none; }

/* Receipt actions row on /orders/ */
.receipt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

/* Print: render the order page as a clean receipt. */
@media print {
  @page { margin: 18mm 16mm; }
  html, body {
    background: #fff !important;
    color: #000 !important;
  }
  .header, .footer, .skip-link, .nav-toggle,
  .receipt-actions, .order-timeline, .tracking-btn,
  .banner {
    display: none !important;
  }
  .section { padding: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .section-title {
    font-size: 18pt;
    margin: 0 0 12pt;
    border-bottom: 1px solid #000;
    padding-bottom: 6pt;
  }
  .status-grid {
    font-size: 10pt;
  }
  .status-grid .sk { color: #555 !important; }
  .status-pill {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: #fff !important;
  }
  .cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }
  .cart-table th, .cart-table td {
    border-bottom: 1px solid #ccc !important;
    padding: 6pt 4pt !important;
  }
  .cart-table tfoot td {
    border-top: 2px solid #000 !important;
    border-bottom: none !important;
    padding-top: 8pt !important;
  }
  h3 { font-size: 12pt; margin: 14pt 0 6pt; }
  .muted { color: #555 !important; }
  /* Receipt header block (only visible in print) */
  .receipt-header { display: block !important; }
}
.receipt-header { display: none; }
@media print {
  .receipt-header {
    margin-bottom: 18pt;
    padding-bottom: 10pt;
    border-bottom: 2px solid #000;
  }
  .receipt-header .brand {
    font-family: var(--mono);
    font-size: 14pt;
    font-weight: 700;
    letter-spacing: .03em;
  }
  .receipt-header .meta {
    font-size: 9pt;
    color: #555;
    margin-top: 2pt;
  }
}
