/* ==========================================================================
   BoltX storefront
   Loaded AFTER boltx.css on every shop page, so every token defined in
   :root there (--ink, --orange, --surface, --sora, ...) is available here.
   Nothing below sets a fixed width that can exceed 320px; every grid is
   auto-fit / minmax(min(100%, Npx), 1fr) so it collapses cleanly on phones.
   ========================================================================== */

/* Offset the sticky .shop-bar parks at — the measured height of the sticky
   .site-header above it. boltx.css changes that height at 480px (smaller
   brand + tighter padding) and at 1100px (the CTA replaces the nav toggle):
   67px / 75px / 76px. Each value below is deliberately 1px short, so any
   rounding tucks the bar a hair UNDER the header instead of opening a slit
   that page content scrolls through. Override --shop-bar-top if the header
   ever gets taller. */
:root { --shop-bar-top: 74px; }
@media (min-width: 1101px) { :root { --shop-bar-top: 75px; } }
@media (max-width: 480px)  { :root { --shop-bar-top: 66px; } }

/* ==========================================================================
   1. Shop chrome — sticky sub-navigation strip
   ========================================================================== */

.shop-bar {
  position: sticky;
  top: var(--shop-bar-top);
  z-index: 40;
  max-width: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

/* If the markup skips .shop-bar-inner, the bar itself becomes the scroller. */
.shop-bar:not(:has(.shop-bar-inner)) {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  padding: 10px clamp(16px, 4vw, 32px);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.shop-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 16px;
}

.shop-bar::-webkit-scrollbar,
.shop-bar-inner::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Category links. Everything that is not the cart button reads as a pill. */
.shop-bar a:not(.shop-cart-btn),
.shop-bar-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sora);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.shop-bar a:not(.shop-cart-btn):hover,
.shop-bar-link:hover {
  color: var(--orange-dark);
  background: var(--orange-tint);
  border-color: var(--orange-soft);
}
.shop-bar a.is-active,
.shop-bar-link.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}
.shop-bar a.is-active:hover,
.shop-bar-link.is-active:hover { background: var(--orange-dark); color: var(--ink); }

/* Search: a rounded field with the submit button tucked inside. */
.shop-search {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 320px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 99px;
  padding: 3px 4px 3px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.shop-search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 12%, transparent);
}
.shop-search input,
.shop-search .input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 8px 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  box-shadow: none;
  border-radius: 0;
}
.shop-search input::placeholder { color: var(--muted-light); }
.shop-search input:focus { box-shadow: none; border: 0; }
.shop-search button {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
}
.shop-search button:hover { background: var(--orange-dark); }
.shop-search button svg { width: 16px; height: 16px; }

/* Cart button + its orange count pill. */
.shop-cart-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sora);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 9px 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.shop-cart-btn:hover {
  color: var(--ink);
  background: var(--orange-tint);
  border-color: var(--orange);
}
.shop-cart-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.cart-badge.is-empty { background: var(--line); color: var(--muted); }

/* ==========================================================================
   2. Product grid and cards
   ========================================================================== */

/* Two products per row on a phone, widening to as many as fit on a desktop.
   `auto-fit` with a 250px floor would drop to a single column below ~530px,
   so the small end is set explicitly instead. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* Hand over to auto-fit only once two 250px columns plus the 24px gap and the
   page gutters actually fit (250 + 24 + 250 + ~50 = 574). Switching earlier
   would briefly drop back to ONE column as the screen grows, which looks
   like a bug. */
@media (min-width: 620px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 24px;
  }
}
.product-grid > * { min-width: 0; }

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.product-card:hover {
  border-color: var(--orange);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.1);
  transform: translateY(-3px);
}
.product-card.is-unavailable { opacity: .85; }

/* Optional wrapper if the thumb needs its own positioning context. */
.product-media { position: relative; display: block; }

.product-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.product-thumb-ph {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 16px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-dark);
  color: var(--muted-light);
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.product-thumb-ph svg { width: 28px; height: 28px; opacity: .5; }

.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 20px;
}

.product-brand {
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.product-name {
  margin: 0;
  font-family: var(--sora);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.product-name a { color: inherit; }
.product-name a:hover { color: var(--orange); }

.product-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.product-price {
  font-family: var(--sora);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.product-was {
  font-size: 14px;
  color: var(--muted);
  text-decoration: line-through;
  white-space: nowrap;
}

.product-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.stars-inline {
  color: var(--orange);
  letter-spacing: 2px;
  white-space: nowrap;
  line-height: 1;
}

/* Badge stack, pinned to the top-left of the thumb. */
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: calc(100% - 68px);
  pointer-events: none;
}
.product-badge {
  display: inline-block;
  max-width: 100%;
  font-family: var(--sora);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.14);
  overflow-wrap: anywhere;
}
.product-badge.is-sale { background: var(--orange); color: var(--ink); }
.product-badge.is-new  { background: var(--ink); color: var(--white); }
.product-badge.is-out  { background: var(--line-dark); color: #344054; }
.product-badge.is-low  { background: #fffaeb; color: #b54708; }

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.product-actions > * {
  flex: 1 1 120px;
  min-width: 0;
}
.product-actions .btn {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
}

/* Wishlist toggle. Works whether the button sits bare in the card or inside
   a POST form — wrap the form in .wishlist-form and the button stays put. */
.wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.wishlist-btn:hover,
.wishlist-btn.is-active {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--white);
}
.wishlist-btn svg { width: 18px; height: 18px; }

.wishlist-form {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  margin: 0;
  line-height: 0;
}
.wishlist-form .wishlist-btn { position: static; top: auto; right: auto; }

/* ==========================================================================
   3. Product detail
   ========================================================================== */

.product-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}
.product-detail > * { min-width: 0; }

.gallery { display: grid; gap: 12px; min-width: 0; }

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  object-fit: cover;
}
.gallery-main > img,
.gallery-main > picture,
.gallery-main > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-main .media-placeholder,
.gallery-main .gallery-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted-light);
  font-family: var(--sora);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.gallery-slide.is-active { opacity: 1; pointer-events: auto; }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.14);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.gallery-nav:hover {
  background: var(--white);
  color: var(--orange);
  border-color: var(--orange);
}
.gallery-nav svg { width: 18px; height: 18px; }
.gallery-nav.prev, .gallery-nav.is-prev { left: 12px; }
.gallery-nav.next, .gallery-nav.is-next { right: 12px; }

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumbs::-webkit-scrollbar { height: 6px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--line-dark); border-radius: 99px; }

.gallery-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color .15s ease;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover { border-color: var(--line-dark); }
.gallery-thumb.is-active { border-color: var(--orange); }

.gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(16, 24, 40, 0.72);
  color: var(--white);
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Quantity stepper */
.qty-picker {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}
.qty-btn {
  flex: 0 1 40px;
  width: 40px;
  min-width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sora);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.qty-btn:hover { background: var(--orange-tint); color: var(--orange-dark); }
.qty-btn:disabled { background: var(--surface); color: var(--line-dark); cursor: not-allowed; }
.qty-btn svg { width: 14px; height: 14px; }

.qty-input {
  flex: 0 1 56px;
  width: 56px;
  height: 40px;
  min-width: 40px;
  padding: 0 4px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  text-align: center;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  appearance: textfield;
  -moz-appearance: textfield;
}
.qty-input:focus {
  box-shadow: inset 0 0 0 2px var(--orange-soft); /* fallback for browsers without color-mix */
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--orange) 25%, transparent);
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Specification table (always wrap it in .table-scroll as well) */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.spec-table th {
  width: 42%;
  color: var(--muted);
  font-weight: 600;
}
.spec-table td { color: var(--ink); }
.spec-table tbody tr:nth-child(odd) { background: var(--surface); }
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td { border-bottom: 0; }

/* Stock state */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-family: var(--sora);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.stock-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.stock-pill.in-stock  { background: var(--ok-bg); color: var(--ok-text); border-color: rgba(23, 178, 106, 0.35); }
.stock-pill.low-stock { background: #fffaeb; color: #b54708; border-color: rgba(253, 176, 34, 0.5); }
.stock-pill.out-stock { background: var(--danger-bg); color: #912018; border-color: rgba(217, 45, 32, 0.3); }

/* ==========================================================================
   4. Reviews
   ========================================================================== */

.review-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.review-summary > * { min-width: 0; }
@media (min-width: 620px) {
  .review-summary { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
}

.review-score-block { text-align: center; }
.review-score {
  font-family: var(--sora);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}

.review-bars { display: grid; gap: 8px; min-width: 0; }
.review-bar-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.review-bar-row .s { color: var(--ink); font-weight: 600; white-space: nowrap; }
.review-bar-row .c { text-align: right; white-space: nowrap; }
/* display:block so a <span> track/fill still takes its height. */
.review-bar-track {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.review-bar-fill {
  display: block;
  height: 8px;
  max-width: 100%;
  border-radius: 99px;
  background: var(--orange);
}

.review-list { display: grid; gap: 0; }
.review-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
}
.review-item:last-child { border-bottom: 0; }

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 8px;
}
.review-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.review-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.review-verified {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.review-title { font-family: var(--sora); font-weight: 600; color: var(--ink); margin: 6px 0; }
.review-body { font-size: 15px; line-height: 1.7; margin: 0; overflow-wrap: anywhere; }

.review-reply {
  margin: 14px 0 0 clamp(0px, 2.5vw, 20px);
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--orange);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--body);
  overflow-wrap: anywhere;
}
.review-reply .who {
  display: block;
  font-family: var(--sora);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}

/* Star rating input. Markup: radios ordered 5 -> 1, each followed by its
   <label>. direction: rtl paints 1 on the left, so `~` reaches the stars
   that sit visually before the hovered/checked one. */
.star-input {
  position: relative;
  display: inline-flex;
  direction: rtl;
  gap: 2px;
  padding: 2px 0;
}
.star-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.star-input label {
  font-size: 28px;
  line-height: 1;
  color: var(--line-dark);
  cursor: pointer;
  padding: 0 2px;
  transition: color .12s ease;
  user-select: none;
}
.star-input input:checked ~ label { color: var(--orange); }
.star-input:hover input:checked ~ label { color: var(--line-dark); }
.star-input label:hover,
.star-input label:hover ~ label { color: var(--orange); }
.star-input input:focus-visible + label {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   5. Cart and checkout
   ========================================================================== */

.cart-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}
.cart-layout > * { min-width: 0; }
/* Below 900px the summary would be too cramped beside the items, so the
   two tracks always stack; above it the summary takes its own column. */
@media (max-width: 899px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
}

.cart-row {
  display: grid;
  grid-template-columns: 88px minmax(120px, 1fr) auto auto auto;
  grid-template-areas: "thumb details qty total remove";
  gap: 12px 14px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.cart-row:last-child { border-bottom: 0; }
.cart-row > * { min-width: 0; }

/* Positional fallback, then the explicit classes (same specificity, later
   rule wins) so either markup style lands in the right cell. */
.cart-row > :nth-child(1) { grid-area: thumb; }
.cart-row > :nth-child(2) { grid-area: details; }
.cart-row > :nth-child(3) { grid-area: qty; }
.cart-row > :nth-child(4) { grid-area: total; }
.cart-row > :nth-child(5) { grid-area: remove; }
.cart-row .cart-thumb { grid-area: thumb; }
.cart-row .cart-details { grid-area: details; }
.cart-row .cart-qty { grid-area: qty; }
.cart-row .cart-line-total { grid-area: total; }
.cart-row .cart-remove { grid-area: remove; }

/* The single-line row needs roughly 550px. Once the items column drops below
   that — which happens well before the phone breakpoint, because the summary
   eats 380px — the thumb spans the rows and the rest stacks beside it. */
@media (max-width: 1079px) {
  .cart-row {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb details details"
      "thumb qty     total"
      "thumb remove  remove";
    gap: 10px 16px;
  }
  .cart-row .cart-qty,
  .cart-row > :nth-child(3) { justify-self: start; }
  .cart-row .cart-line-total,
  .cart-row > :nth-child(4) { justify-self: end; text-align: right; }
  .cart-row .cart-remove,
  .cart-row > :nth-child(5) { justify-self: start; }
}

.cart-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
  align-self: start;
  flex-shrink: 0;
}

.cart-details { min-width: 0; overflow-wrap: anywhere; }
.cart-details .n {
  display: block;
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.cart-details .m { font-size: 13px; color: var(--muted); }
.cart-qty { margin: 0; }
.cart-line-total {
  font-family: var(--sora);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}
.cart-remove { margin: 0; }
.cart-remove button,
.cart-remove .link-remove {
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s ease;
}
.cart-remove button:hover,
.cart-remove .link-remove:hover { color: var(--danger); }
.cart-remove svg { width: 16px; height: 16px; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 26px);
  min-width: 0;
}
.summary-card h2,
.summary-card h3 {
  font-family: var(--sora);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
}
@media (min-width: 900px) {
  .summary-card { position: sticky; top: 100px; }
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
}
.summary-row .k { color: var(--body); min-width: 0; overflow-wrap: anywhere; }
.summary-row .v { color: var(--ink); font-weight: 600; white-space: nowrap; }
.summary-row.is-discount .v { color: var(--ok-text); }

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--sora);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.summary-total .v { white-space: nowrap; }

.coupon-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.coupon-form .input {
  flex: 1 1 140px;
  min-width: 0;
  text-transform: uppercase;
}
.coupon-form .btn { flex: 0 0 auto; padding: 13px 20px; font-size: 14px; }

/* Numbered checkout step headings */
.checkout-steps {
  counter-reset: checkout-step;
  display: grid;
  gap: clamp(20px, 3vw, 30px);
}
.checkout-steps > * { min-width: 0; }
.checkout-steps h2,
.checkout-steps h3,
.checkout-steps .step-head {
  counter-increment: checkout-step;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--sora);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.checkout-steps h2::before,
.checkout-steps h3::before,
.checkout-steps .step-head::before {
  content: counter(checkout-step);
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.pay-methods > * { min-width: 0; }

.pay-method {
  position: relative;
  display: block;
  min-width: 0;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.pay-method:hover { border-color: var(--orange); }
.pay-method input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--orange);
  cursor: pointer;
}
.pay-method p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
.pay-method.is-selected,
.pay-method:has(input[type="radio"]:checked) {
  border-color: var(--orange);
  background: var(--orange-tint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 10%, transparent);
}
.pay-method.is-disabled {
  opacity: .55;
  background: var(--surface);
  border-color: var(--line);
  border-style: dashed;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.pay-method.is-disabled:hover { border-color: var(--line); }
/* Desaturate the gateway logo, not the card — a filter here would also drain
   the red out of .pay-unavailable. */
.pay-method.is-disabled img,
.pay-method.is-disabled svg { filter: grayscale(1); }
.pay-method.is-disabled input[type="radio"] { cursor: not-allowed; }
.pay-method.is-disabled .pay-method-head strong { color: var(--muted); }

.pay-method-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}
.pay-method-head .who,
.pay-method-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pay-method-head strong {
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pay-fee {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pay-unavailable {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   6. Order confirmation and account
   ========================================================================== */

.order-hero {
  background: var(--ink);
  background-image: radial-gradient(500px 250px at 90% 0%, color-mix(in srgb, var(--orange) 20%, transparent), transparent 70%);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 40px);
  color: var(--muted-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px 32px;
  min-width: 0;
}
.order-hero > * { min-width: 0; }
.order-hero h1,
.order-hero h2 {
  margin: 0 0 8px;
  color: var(--white);
  font-family: var(--sora);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.order-hero p { margin: 0; color: var(--muted-light); font-size: 15px; overflow-wrap: anywhere; }
.order-hero .k {
  color: var(--muted-light);
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.order-hero .v {
  color: var(--white);
  font-family: var(--sora);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.order-hero .num { color: var(--orange); font-family: var(--sora); font-weight: 700; overflow-wrap: anywhere; }

.order-lines {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
}
.order-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.order-line:last-child { border-bottom: 0; }
.order-line img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}
.order-line .n {
  flex: 1 1 150px;
  min-width: 0;
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.order-line .n small { display: block; font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 13px; }
.order-line .q { color: var(--muted); font-size: 14px; white-space: nowrap; }
.order-line .t {
  margin-left: auto;
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}
.order-meta-grid > * { min-width: 0; overflow-wrap: anywhere; }
.order-meta-grid .k {
  font-family: var(--sora);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.order-meta-grid .v { color: var(--ink); font-size: 15px; line-height: 1.7; }

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 3.5vw, 40px);
  align-items: start;
}
.account-layout > * { min-width: 0; }
@media (min-width: 900px) {
  .account-layout { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
  .account-nav { position: sticky; top: 100px; }
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.account-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-family: var(--sora);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.account-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.account-nav a:hover { background: var(--surface); color: var(--orange); }
.account-nav a.is-active {
  background: var(--orange-tint);
  color: var(--orange-dark);
  box-shadow: inset 3px 0 0 var(--orange);
}

/* Sidebar turns into a horizontal scroll strip on narrow screens. */
@media (max-width: 899px) {
  .account-nav {
    flex-direction: row;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .account-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .account-nav a { flex: 0 0 auto; }
  .account-nav a.is-active { box-shadow: inset 0 -3px 0 var(--orange); }
}

.account-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 28px);
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-card + .account-card { margin-top: 20px; }
.account-card > h2,
.account-card > h3 {
  font-family: var(--sora);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
}

.timeline-simple {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  display: grid;
  gap: 20px;
}
.timeline-simple::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.timeline-simple > li {
  position: relative;
  min-width: 0;
  overflow-wrap: anywhere;
}
.timeline-simple > li::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--orange);
}
.timeline-simple > li:last-child::after {
  content: '';
  position: absolute;
  left: -18px;
  top: 20px;
  bottom: -20px;
  width: 2px;
  background: var(--white);
}
.timeline-simple .t {
  display: block;
  font-family: var(--sora);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.timeline-simple .d { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.timeline-simple .b { display: block; font-size: 14px; margin-top: 4px; }

/* ==========================================================================
   7. Empty states and utilities
   ========================================================================== */

.shop-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(32px, 6vw, 56px) clamp(20px, 4vw, 32px);
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--line-dark);
  border-radius: 14px;
  color: var(--muted);
  font-size: 15px;
}
.shop-empty h2,
.shop-empty h3 {
  margin: 0;
  font-family: var(--sora);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.shop-empty p { margin: 0; max-width: 46ch; }
.shop-empty svg { width: 34px; height: 34px; color: var(--line-dark); }

.price-note { font-size: 13px; color: var(--muted); line-height: 1.6; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   8. Narrow screens
   ========================================================================== */

@media (max-width: 640px) {
  .shop-bar-inner,
  .shop-bar:not(:has(.shop-bar-inner)) { padding-left: 16px; padding-right: 16px; }
  .shop-search { flex: 1 0 160px; margin-left: 8px; }

  .product-grid { gap: 16px; }
  .product-card-body { padding: 14px 16px; }
  .product-actions { padding-top: 4px; }
  .product-actions > * { flex: 1 1 100%; }
  .product-badge { font-size: 10px; padding: 4px 8px; }

  .gallery-nav { width: 36px; height: 36px; }
  .gallery-thumb { flex-basis: 62px; width: 62px; height: 62px; }
  .spec-table th, .spec-table td { padding: 10px 12px; }

  .review-summary { padding: 18px; }
  .review-score-block { text-align: left; }
  .review-item { padding: 18px 0; }
  .review-reply { margin-left: 0; padding: 12px 14px; }
  .star-input label { font-size: 26px; }

  /* Cart line: thumb spans the rows, everything else stacks beside it. */
  .cart-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 16px 0;
  }
  .cart-thumb { width: 72px; height: 72px; }

  .summary-card { padding: 18px; }
  .checkout-steps h2,
  .checkout-steps h3,
  .checkout-steps .step-head { font-size: 17px; }
  .pay-method { padding: 14px 15px; }

  .order-hero { padding: 22px 20px; gap: 16px; }
  .order-line { padding: 12px 14px; }
  .account-card { padding: 18px; }
  .shop-empty { padding: 32px 18px; }
}

@media (max-width: 400px) {
  .shop-bar-inner,
  .shop-bar:not(:has(.shop-bar-inner)) { gap: 6px 8px; padding: 8px 14px; }
  .shop-bar a:not(.shop-cart-btn),
  .shop-bar-link { padding: 8px 12px; font-size: 13px; }
  .shop-cart-btn { padding: 8px 12px; font-size: 13px; }
  .shop-search { min-width: 140px; }

  .product-card-body { padding: 12px 14px; gap: 6px; }
  .product-price { font-size: 17px; }
  .product-name { font-size: 15px; }
  .wishlist-btn, .wishlist-form { top: 8px; right: 8px; }
  .wishlist-btn { width: 32px; height: 32px; }
  .product-badges { top: 8px; left: 8px; max-width: calc(100% - 56px); }

  .qty-btn { flex-basis: 34px; width: 34px; height: 36px; }
  .qty-input { flex-basis: 44px; width: 44px; height: 36px; font-size: 14px; }

  .review-score { font-size: 36px; }
  .review-bar-row { grid-template-columns: 32px minmax(0, 1fr) 38px; gap: 8px; font-size: 12px; }
  .star-input label { font-size: 24px; }

  /* Two real columns only: the qty stepper needs the full content width. */
  .cart-row {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-areas:
      "thumb details"
      "thumb qty"
      "thumb total"
      "thumb remove";
    gap: 8px 10px;
  }
  .cart-thumb { width: 60px; height: 60px; }
  .cart-line-total { font-size: 15px; }
  .cart-row .cart-line-total,
  .cart-row > :nth-child(4) { justify-self: start; text-align: left; }

  .coupon-form .input,
  .coupon-form .btn { flex: 1 1 100%; width: 100%; }

  .summary-total { font-size: 18px; }
  .summary-row { font-size: 14px; }
  .checkout-steps h2::before,
  .checkout-steps h3::before,
  .checkout-steps .step-head::before { flex-basis: 26px; width: 26px; height: 26px; font-size: 13px; }

  .order-line .t { margin-left: 0; }
  .timeline-simple { padding-left: 20px; gap: 16px; }
  .timeline-simple > li::before { left: -20px; }
  .timeline-simple > li:last-child::after { left: -14px; }
}

/* ==========================================================================
   Class index — grep here before inventing a new name.

   Shop chrome ........ .shop-bar  .shop-bar-inner  .shop-bar-link (+.is-active)
                        .shop-search  .shop-cart-btn  .cart-badge (+.is-empty)
   Product grid ....... .product-grid  .product-card (+.is-unavailable)
                        .product-media  .product-thumb  .product-thumb-ph
                        .product-card-body  .product-brand  .product-name
                        .product-price-row  .product-price  .product-was
                        .product-rating  .stars-inline
                        .product-badges  .product-badge (+.is-sale .is-new
                                                          .is-out .is-low)
                        .product-actions  .wishlist-btn (+.is-active)
                        .wishlist-form
   Product detail ..... .product-detail  .gallery  .gallery-main  .gallery-slide
                        (+.is-active)  .gallery-nav (+.prev/.next or
                        .is-prev/.is-next)  .gallery-thumbs  .gallery-thumb
                        (+.is-active)  .gallery-counter
                        .qty-picker  .qty-btn  .qty-input
                        .spec-table  .stock-pill (+.in-stock .low-stock .out-stock)
   Reviews ............ .review-summary  .review-score-block  .review-score
                        .review-bars  .review-bar-row (.s/.c)  .review-bar-track
                        .review-bar-fill  .review-list  .review-item
                        .review-head  .review-author  .review-date
                        .review-verified  .review-title  .review-body
                        .review-reply (.who)  .star-input
   Cart / checkout .... .cart-layout  .cart-row  .cart-thumb  .cart-details (.n/.m)
                        .cart-qty  .cart-line-total  .cart-remove
                        .summary-card  .summary-row (.k/.v, +.is-discount)
                        .summary-total  .coupon-form  .checkout-steps
                        .pay-methods  .pay-method (+.is-selected .is-disabled)
                        .pay-method-head  .pay-fee  .pay-unavailable
   Order / account .... .order-hero (.k/.v/.num)  .order-lines  .order-line
                        (img/.n/.q/.t)  .order-meta-grid (.k/.v)
                        .account-layout  .account-nav (a.is-active)  .account-card
                        .timeline-simple (.t/.d/.b)
   Utilities .......... .shop-empty  .price-note  .sr-only

   Markup notes
   - .cart-row expects five children in this order: thumb, details, qty,
     line total, remove. Give them the .cart-* classes above (or rely on the
     nth-child fallback). Under 640px the thumb spans all rows.
   - .star-input needs radios in 5 -> 4 -> 3 -> 2 -> 1 order, each immediately
     followed by its <label for="...">; the container is direction: rtl.
   - .gallery-main is the positioning context for .gallery-slide,
     .gallery-nav and .gallery-counter.
   - .shop-bar parks under the sticky site header using --shop-bar-top
     (66 / 74 / 75px by breakpoint). Put it directly after the header.
   - Tables still belong inside <div class="table-scroll">.
   ========================================================================== */

/* ==========================================================================
   Two-up product grid on phones
   Two cards share a 320px screen, so each column is about 133px. Everything
   inside the card is scaled to that: smaller type, tighter padding, stacked
   buttons, and a shorter thumbnail so the card does not become a tower.
   ========================================================================== */

@media (max-width: 619px) {
  .product-card-body { padding: 12px 12px 14px; gap: 6px; }

  .product-thumb,
  .product-thumb-ph { aspect-ratio: 1 / 1; }
  .product-thumb-ph { font-size: 11px; }
  .product-thumb-ph svg { width: 22px; height: 22px; }

  .product-brand { font-size: 10px; letter-spacing: 0.05em; }

  .product-name { font-size: 13.5px; line-height: 1.35; }

  .product-price-row { gap: 6px; }
  .product-price { font-size: 15px; }
  .product-was { font-size: 12px; }

  .product-rating { font-size: 11px; gap: 4px; }
  .stars-inline { letter-spacing: 1px; font-size: 11px; }

  /* The blurb is the first thing to go — the name and price carry the card. */
  .product-card-body .product-excerpt,
  .product-card-body .price-note { display: none; }

  .product-badges { top: 8px; left: 8px; gap: 4px; }
  .product-badge { font-size: 9.5px; padding: 3px 6px; letter-spacing: 0.02em; }

  .wishlist-btn { top: 8px; right: 8px; width: 30px; height: 30px; }
  .wishlist-btn svg { width: 15px; height: 15px; }

  /* Side-by-side buttons cannot fit; stack them full width. */
  .product-actions { flex-direction: column; gap: 6px; }
  .product-actions > * { width: 100%; flex: 0 0 auto; }
  .product-actions .btn { font-size: 12.5px; padding: 9px 8px; }

  .stock-pill { font-size: 10px; padding: 3px 7px; }
}

/* Very narrow phones: shave the gutter so the cards keep usable width. */
@media (max-width: 360px) {
  .product-grid { gap: 10px; }
  .product-card-body { padding: 10px 10px 12px; }
  .product-name { font-size: 13px; }
  .product-price { font-size: 14px; }
  .product-actions .btn { font-size: 12px; padding: 8px 6px; }
}

/* ==========================================================================
   Shop bar: two rows on a phone, one row on a wide screen
   The basket and the account link must never scroll out of reach, so on small
   screens they sit in a fixed top row and only the categories scroll.
   ========================================================================== */

/* --- Wide screens: collapse the two groups back into the single strip. --- */
@media (min-width: 900px) {
  .shop-bar-primary,
  .shop-bar-actions,
  .shop-bar-scroll { display: contents; }
}

/* --- Phones and small tablets: stacked rows. --- */
@media (max-width: 899px) {
  .shop-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;          /* the inner scroller handles the sideways bit */
    padding: 0;
  }

  .shop-bar-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px clamp(14px, 4vw, 32px);
    min-width: 0;
  }

  .shop-bar-home {
    min-width: 0;
    padding: 6px 0;
    font-size: 15px;
  }
  .shop-bar-home span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shop-bar-home:hover { background: transparent; border-color: transparent; }

  .shop-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  .shop-cart-btn,
  .shop-bar-account {
    padding: 8px 12px;
    font-size: 13px;
    gap: 6px;
  }
  .shop-bar-account {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 99px;
  }
  .shop-bar-account span {
    max-width: 8ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Second row: the categories and search scroll together. */
  .shop-bar-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 clamp(14px, 4vw, 32px) 9px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    padding-top: 9px;
  }
  .shop-bar-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .shop-bar-scroll > * { flex: 0 0 auto; }

  .shop-bar-scroll .shop-search {
    margin-left: 0;
    flex: 0 0 200px;
    min-width: 180px;
  }
}

/* Narrow phones: drop the word "Basket" and keep only the icon plus count,
   so the brand keeps enough room and nothing collides. */
@media (max-width: 430px) {
  .shop-cart-label { display: none; }
  .shop-cart-btn { padding: 8px 10px; }
  .shop-bar-home { font-size: 14px; }
  .shop-bar-home span { max-width: 11ch; }
  .shop-bar-account span { max-width: 7ch; }
  .shop-bar-scroll .shop-search { flex: 0 0 170px; min-width: 160px; }
}

@media (max-width: 360px) {
  .shop-bar-home span { max-width: 8ch; }
  .shop-bar-account span { display: none; }   /* icon-only account button */
  .shop-bar-account { padding: 8px 10px; }
}

/* ==========================================================================
   Live basket feedback
   ========================================================================== */

/* The add button once the product is already in the basket. */
.btn.is-in-basket,
[data-add-btn].is-in-basket {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok-text);
}
.btn.is-in-basket:hover,
[data-add-btn].is-in-basket:hover {
  background: var(--ok-line);
  border-color: var(--ok-line);
  color: var(--white);
}
[data-add-btn].is-busy { opacity: .7; cursor: progress; }
[data-add-btn]:disabled { cursor: not-allowed; }

/* A tick appears in front of the label when the item is in the basket. */
[data-add-btn].is-in-basket [data-add-label]::before {
  content: '✓';
  margin-right: 6px;
  font-weight: 700;
}

/* "View basket" link, revealed only once something has been added. */
[data-view-basket] {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--orange);
}
[data-view-basket]:hover { color: var(--orange-dark); }
[data-view-basket][hidden] { display: none; }

/* The count pill nudges when it changes, so the update is noticed. */
.cart-badge.is-bumped { animation: cart-bump .4s ease; }
@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---- Toasts ------------------------------------------------------------ */

.shop-toasts {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.shop-toast {
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
  padding: 13px 18px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--orange);
}
.shop-toast.is-in { opacity: 1; transform: translateY(0); }
.shop-toast.is-error { border-left-color: var(--danger); }

/* Sit above the floating chat widget on a phone. */
@media (max-width: 640px) {
  .shop-toasts { bottom: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-badge.is-bumped { animation: none; }
  .shop-toast { transition: none; opacity: 1; transform: none; }
}

/* ==========================================================================
   Search sits in the fixed row, beside the account link
   It must never be inside the horizontal scroller — a shopper should be able
   to search without discovering that the bar swipes sideways.
   ========================================================================== */

@media (max-width: 899px) {
  /* brand | search | cart + account, all on the one visible row */
  .shop-bar-primary { flex-wrap: nowrap; gap: 8px; }

  .shop-bar-primary .shop-search {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;          /* lets it shrink instead of pushing the row wide */
    max-width: none;
    margin-left: 0;
    padding: 2px 3px 2px 12px;
  }
  .shop-bar-primary .shop-search input { padding: 7px 0; font-size: 13.5px; }
  .shop-bar-primary .shop-search button { flex: 0 0 28px; width: 28px; height: 28px; }
  .shop-bar-primary .shop-search button svg { width: 14px; height: 14px; }

  .shop-bar-actions { order: 3; }

  /* The brand gives up room first — the search field is worth more here. */
  .shop-bar-home { order: 1; flex: 0 1 auto; max-width: 34%; }
}

/* Below this the brand wordmark would squeeze the search field, so the mark
   stands in for it and the search keeps a usable width. */
@media (max-width: 620px) {
  .shop-bar-home span { display: none; }
  .shop-bar-home { max-width: none; flex: 0 0 auto; padding: 6px 2px; }
  .shop-bar-home svg { width: 20px; height: 20px; }
  .shop-cart-label { display: none; }
  .shop-bar-account span { display: none; }
  .shop-bar-account,
  .shop-cart-btn { padding: 8px 11px; }
  .shop-bar-primary .shop-search { min-width: 120px; }
}

/* ---------- Proof of payment -------------------------------------------- */

.proof-file {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.proof-file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 auto;
}

.proof-card .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.proof-card .badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.proof-card .badge-warn { background: #fffaeb; color: #b54708; }
.proof-card .badge-danger { background: var(--danger-bg); color: #912018; }
.proof-card .badge-mute { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

.proof-card input[type="file"] { padding: 9px 12px; font-size: 13.5px; }

@media (max-width: 520px) {
  .proof-file { padding: 10px 12px; }
  .proof-card .btn { width: 100%; }
}

/* At 320px the primary row has ~300px to work with once the scrollbar and
   padding are gone; let the search shrink further so nothing pokes out. */
@media (max-width: 360px) {
  .shop-bar-primary { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .shop-bar-primary .shop-search { min-width: 0; flex: 1 1 90px; padding-left: 10px; }
  .shop-bar-primary .shop-search input { font-size: 13px; }
  .shop-bar-actions { gap: 6px; }
  .shop-cart-btn, .shop-bar-account { padding: 7px 9px; }
}

/* ---- Live basket updates (cart page) ---------------------------------- */

/* A row dims while its request is in flight and fades before it is removed. */
.cart-row { transition: opacity .25s ease; }
.cart-row.is-busy { opacity: .55; }
.cart-row.is-leaving { opacity: 0; }

/* Inline error under the discount-code field. */
.coupon-error { margin: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--danger); }

/* Equal-width digits so totals do not wobble sideways as they repaint. */
.cart-line-total,
.summary-row .v,
.summary-total .v { font-variant-numeric: tabular-nums; }

/* Basket steppers keep a full-size touch target on small screens (the
   generic small-screen stepper above shrinks to 34px). */
@media (max-width: 480px) {
  .cart-row .qty-btn { flex-basis: 40px; width: 40px; min-width: 40px; height: 40px; }
  .cart-row .qty-input { height: 40px; }
}

/* The [hidden] attribute must win over the display rules above — the cart
   script toggles these rows with it. */
.summary-row[hidden],
.summary-card .price-note[hidden],
[data-coupon-applied][hidden],
[data-coupon-entry][hidden] { display: none !important; }
