/* ============================================================
   APAC Instant Search Widget — Full-page Doofinder-style layout
   ============================================================ */

:root {
  --asw-blue:         #2563eb;
  --asw-blue-dark:    #1d4ed8;
  --asw-bg:           #ffffff;
  --asw-sidebar-bg:   #f8f9fa;
  --asw-border:       #e5e7eb;
  --asw-text:         #111827;
  --asw-text-muted:   #6b7280;
  --asw-radius:       6px;
  --asw-z:            99999;
  --asw-header-h:     68px;
  --asw-sidebar-w:    270px;
  --asw-control-h:    32px;
}

/* ── Overlay ─────────────────────────────────────────────── */

/* Backdrop behind the centred panel */
#asw-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: calc(var(--asw-z) - 1);
}
#asw-backdrop.asw-open { display: block; }

#asw-overlay {
  display: none;
  position: fixed;
  /* ── Compact panel (initial / no query) ──
     Full width, anchored to top, ~75 vh tall — page visible below */
  top: 0;
  left: 0;
  width: 100%;
  height: 75vh;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  background: #fff;
  z-index: var(--asw-z);
  flex-direction: column;
  overflow: hidden;
  transition: height 0.2s ease, box-shadow 0.2s ease;
}
#asw-overlay.asw-open {
  display: flex;
  animation: aswSlideIn 0.18s ease;
}
@keyframes aswSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Expanded: full window once the user types ── */
#asw-overlay.asw-expanded {
  height: 100%;
  box-shadow: none;
}
/* Backdrop is hidden when overlay is full-screen (handled in JS) */

/* ── Header ──────────────────────────────────────────────── */

#asw-header {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--asw-header-h);
  padding: 0 24px;
  border-bottom: 2px solid var(--asw-border);
  flex-shrink: 0;
  background: #fff;
}
#asw-logo { flex-shrink: 0; display: flex; align-items: center; }
#asw-logo a { display: flex; align-items: center; text-decoration: none; }
#asw-logo img { height: 51px; width: auto; display: block; }
#asw-logo-text {
  font-size: 28px;
  font-weight: 800;
  color: #1a3c6e;
  letter-spacing: -0.5px;
}

/* ── Header search form (mirrors Doofinder dfd-searchbox) ── */

#asw-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--asw-blue);
  padding: 0;
  gap: 0;
  min-width: 0;
}
#asw-search-bar:focus-within { border-bottom-color: var(--asw-blue); }

.asw-search-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 8px;
}
.asw-search-icon-wrap {
  display: flex;
  align-items: center;
  color: var(--asw-text-muted);
}
.asw-search-icon-wrap svg { display: block; }

#asw-search-main {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-bottom: 4px;
}
.asw-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
#asw-query {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  font-size: 16px;
  color: var(--asw-text);
  background: transparent;
  caret-color: var(--asw-blue);
  padding: 0;
  margin: 0;
  /* suppress native clear button on type=search */
}
#asw-query::-webkit-search-decoration,
#asw-query::-webkit-search-cancel-button,
#asw-query::-webkit-search-results-button,
#asw-query::-webkit-search-results-decoration { display: none; }
#asw-query::placeholder { color: #9ca3af; }

#asw-clear {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--asw-text-muted);
  padding: 0;
  line-height: 1;
  align-items: center;
  justify-content: center;
}
#asw-clear:hover { color: var(--asw-text); }
#asw-clear.asw-visible { display: flex; }

#asw-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--asw-text-muted);
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
}
#asw-close:hover { color: var(--asw-text); }

/* ── Body ────────────────────────────────────────────────── */

#asw-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────── */

#asw-sidebar {
  width: var(--asw-sidebar-w);
  flex-shrink: 0;
  background: var(--asw-sidebar-bg);
  border-right: 1px solid var(--asw-border);
  overflow-y: auto;
  padding: 20px 0;
}
.asw-facet-group { padding: 0 16px 20px; }

.asw-facet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: var(--asw-text);
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.asw-facet-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--asw-text-muted);
  padding: 0;
  line-height: 1;
  transition: transform 0.2s;
}
.asw-facet-group.asw-collapsed .asw-facet-toggle { transform: rotate(180deg); }
.asw-facet-group.asw-collapsed .asw-facet-search,
.asw-facet-group.asw-collapsed .asw-facet-list,
.asw-facet-group.asw-collapsed .asw-view-more { display: none; }

.asw-facet-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9dadb;
  border-radius: 4px;
  padding: 0 10px;
  margin-bottom: 10px;
  background: #fff;
  height: 36px;
  box-sizing: border-box;
  overflow: hidden;
}
.asw-facet-search:focus-within { border-color: #767a7b; }
.asw-facet-search svg { color: #767a7b; flex-shrink: 0; width: 16px; height: 16px; }
.asw-facet-search input {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  font-size: 13px;
  color: var(--asw-text);
  flex: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
  height: 100%;
  line-height: normal;
}
.asw-facet-search input::placeholder { color: #9a9d9e; }

.asw-facet-list { list-style: none; margin: 0; padding: 0; }
.asw-facet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13.5px;
  color: var(--asw-text);
}
.asw-facet-item input[type="checkbox"] {
  width: 15px; height: 15px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
  accent-color: var(--asw-blue);
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: 0;
}
.asw-facet-item label {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 400;
  text-transform: capitalize;
  line-height: 1.4;
  margin: 0;
}
.asw-facet-item label:hover { color: var(--asw-blue); }
.asw-facet-count { font-size: 12px; color: var(--asw-text-muted); }

.asw-view-more {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--asw-blue);
  padding: 6px 0; display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.asw-view-more:hover { text-decoration: underline; }

.asw-facet-terms-count {
  font-size: 11.5px;
  color: var(--asw-text-muted);
  padding: 2px 0 4px;
}

/* ── Results area ────────────────────────────────────────── */

#asw-results-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#asw-results-bar {
  display: none; /* hidden until a query is active */
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--asw-border);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: nowrap;
  min-height: 44px;
}
#asw-body.asw-has-query #asw-results-bar { display: flex; }

#asw-count { font-size: 14px; color: var(--asw-text-muted); }
#asw-count strong { color: var(--asw-text); }

/* Sort wrap hidden until results are rendered */
#asw-sort-wrap {
  display: none;
  position: relative;
  flex-shrink: 0;
}
#asw-body.asw-has-results #asw-sort-wrap { display: block; }

#asw-sort-btn {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-radius);
  font-size: 13px;
  color: var(--asw-text);
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}
#asw-sort-btn:hover { border-color: #9ca3af; }
#asw-sort-label { font-weight: 600; margin-left: 2px; }
.asw-sort-arrow { font-size: 12px; margin-left: 4px; color: var(--asw-text-muted); }

#asw-sort-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 170px;
  background: #fff;
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10;
  overflow: hidden;
}
#asw-sort-dropdown.asw-sort-open { display: block; }
.asw-sort-option {
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--asw-text);
  cursor: pointer;
  transition: background 0.1s;
}
.asw-sort-option:hover { background: #f3f4f6; }
.asw-sort-option--active { font-weight: 600; color: var(--asw-blue); }

#asw-status {
  padding: 60px 24px;
  text-align: center;
  color: var(--asw-text-muted);
  font-size: 14px;
  display: none;
}
#asw-body.asw-has-query #asw-status { display: block; }
#asw-body.asw-has-results #asw-status { display: none; }
.asw-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--asw-border);
  border-top-color: var(--asw-blue);
  border-radius: 50%;
  animation: aswSpin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes aswSpin { to { transform: rotate(360deg); } }

#asw-scroll { display: none; flex: 1; overflow-y: auto; padding: 0 24px 24px; }
#asw-body.asw-has-query #asw-scroll { display: block; }

/* ── Product grid ────────────────────────────────────────── */

#asw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

/* ── Product card ────────────────────────────────────────── */

.asw-card {
  display: flex;
  flex-direction: column;
  height: 100%;           /* stretch to fill grid cell so all cards are equal height */
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.asw-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #d1d5db; }

/* Inner link wraps image + body only — footer is a sibling outside the <a> */
.asw-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;                /* push footer to bottom */
  text-decoration: none;
  color: inherit;
}

.asw-card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: #f9fafb;
  overflow: hidden;
}
.asw-card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8px;
}
.asw-card-img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db;
}

.asw-badge-stock {
  position: absolute;
  top: 8px; left: 8px;
  height: var(--asw-control-h);
  line-height: var(--asw-control-h);
  font-size: 11px; font-weight: 700;
  padding: 0 8px;
  border-radius: 3px;
  box-sizing: border-box;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.asw-badge-stock.in  { background: var(--asw-blue); color: #fff; }
.asw-badge-stock.out { background: #9ca3af; color: #fff; }
.asw-badge-stock.pre { background: #f59e0b; color: #fff; }

.asw-card-body {
  padding: 10px 12px 6px;
  flex: 1;                /* grows so footer stays pinned at bottom of card */
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.asw-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--asw-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asw-card-name em { font-style: normal; color: var(--asw-blue); }
.asw-card-meta { font-size: 12.5px; color: var(--asw-text-muted); line-height: 1.5; }
.asw-card-meta strong { color: var(--asw-text); font-weight: 600; }

.asw-card-price { font-size: 14px; font-weight: 600; color: var(--asw-text); margin-top: 6px; }
.asw-card-price .__pound-symbol { font-weight: 700; }
.asw-card-price .__ex-vat { font-size: 11px; color: var(--asw-text-muted); font-weight: 400; }

.asw-card-footer { padding: 8px 12px 12px; margin-top: auto; }
.asw-cart-wrap   { display: flex; flex-direction: column; gap: 6px; }

/* Qty stepper */
.asw-stepper     { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--asw-border); border-radius: var(--asw-radius); overflow: hidden; height: var(--asw-control-h); box-sizing: border-box; }
.asw-step-btn    { background: #f3f4f6; border: none; padding: 0 10px; font-size: 16px; line-height: var(--asw-control-h); height: var(--asw-control-h); box-sizing: border-box; cursor: pointer; color: var(--asw-text); flex-shrink: 0; }
.asw-step-btn:hover { background: var(--asw-border); }
.asw-qty-input   { flex: 1; border: none; border-left: 1px solid var(--asw-border); border-right: 1px solid var(--asw-border); text-align: center; font-size: 14px; width: 0; min-width: 0; height: var(--asw-control-h); padding: 0 4px; box-sizing: border-box; -moz-appearance: textfield; }
.asw-qty-input::-webkit-inner-spin-button,
.asw-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* In-basket indicator */
.asw-in-basket      { font-size: 12px; color: #16a34a; font-weight: 600; text-align: center; }
.asw-backorder-warn  { font-size: 11px; color: #92400e; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 4px; padding: 4px 8px; text-align: center; }
.asw-backorder-qty   { display: inline-block; font-size: 12px; font-weight: 600; color: #000; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 4px; padding: 3px 8px; margin-top: 4px; }

/* Pre-order ETA in card body — hidden on desktop (image badge covers it there) */
.asw-preorder-eta { display: none; }

@keyframes asw-spin {
  to { transform: rotate(360deg); }
}

.asw-add-btn {
  width: 100%;
  height: var(--asw-control-h);
  background: var(--asw-blue);
  color: #fff;
  border: none;
  border-radius: var(--asw-radius);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.asw-add-btn:hover    { background: var(--asw-blue-dark); }
.asw-add-btn:disabled { opacity: 0.7; cursor: default; }
.asw-add-btn--added   { background: #16a34a; }
.asw-add-btn--added:hover { background: #15803d; }

/* Adding… state — spinner replaces text, button non-interactive */
.asw-add-btn--adding {
  color: transparent;
  pointer-events: none;
  cursor: default;
  opacity: 0.85;
}
.asw-add-btn--adding::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: asw-spin 0.6s linear infinite;
}

/* ── Infinite scroll load-more sentinel ─────────────────── */

#asw-load-more { padding: 20px 0 8px; text-align: center; }
.asw-load-more-spinner .asw-spinner { margin: 0 auto; }
/* Invisible scroll trigger — no spinner shown while idle, only during active fetch */
.asw-load-more-sentinel { height: 1px; visibility: hidden; }

/* ── Back to top ─────────────────────────────────────────── */

#asw-back-top {
  display: none;
  position: sticky;
  bottom: 20px;
  float: right;
  margin-right: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--asw-blue);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 5;
  transition: background 0.15s, opacity 0.2s;
  align-items: center;
  justify-content: center;
}
#asw-back-top:hover { background: var(--asw-blue-dark); }
#asw-back-top.asw-back-top-visible { display: flex; }

/* ── Empty / pre-search state ────────────────────────────── */

#asw-empty-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#asw-body.asw-has-query #asw-empty-pane { display: none; }
#asw-body:not(.asw-has-query) #asw-sidebar { display: none; }

.asw-rec-header {
  padding: 18px 24px 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--asw-text);
  border-bottom: 1px solid var(--asw-border);
  flex-shrink: 0;
}

/* Carousel wrapper — buttons sit flush left/right */
.asw-carousel-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}
.asw-carousel {
  flex: 1;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 20px 16px;
  align-items: flex-start;
}
.asw-carousel::-webkit-scrollbar { display: none; }
.asw-carousel-btn {
  flex-shrink: 0;
  width: 36px;
  align-self: center;
  background: #fff;
  border: 1px solid var(--asw-border);
  border-radius: 50%;
  height: 36px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--asw-text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  margin: 0 8px;
  z-index: 2;
}
.asw-carousel-btn:hover { background: var(--asw-blue); color: #fff; border-color: var(--asw-blue); }

/* Prev button hidden until user scrolls right */
.asw-carousel-prev { display: none; }
.asw-carousel-prev.asw-visible { display: flex; }

/* Carousel cards — height:auto lets align-items:stretch equalise all card heights */
.asw-carousel .asw-card {
  flex-shrink: 0;
  width: 210px;
  height: auto;          /* override base height:100% so stretch can work */
}

/* Both grid and carousel: move the flex gap from "between price and button"
   up into the image area. Body is natural height, pushed to the bottom of
   the card-link by margin-top:auto — so name/price/buttons sit together at
   the bottom, gap absorbs into the image section above.                     */
.asw-carousel .asw-card-body,
#asw-grid .asw-card-body {
  flex: none;
  margin-top: auto;
}
/* Match the top of the tile (image fills flush) — no extra gap below button */
.asw-carousel .asw-card-footer,
#asw-grid .asw-card-footer {
  padding-bottom: 0;
}

/* ── Popular searches (sidebar empty state) ─────────────── */

.asw-popular-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--asw-text);
  padding: 0 16px 12px;
}
.asw-popular-list  { list-style: none; margin: 0; padding: 0; }
.asw-popular-item  {
  display: block;
  padding: 7px 16px;
  font-size: 13.5px;
  color: var(--asw-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.asw-popular-item:hover { background: rgba(37,99,235,0.06); color: var(--asw-blue); }

/* ── Responsive ──────────────────────────────────────────── */

/* grid columns handled by auto-fill minmax — no manual breakpoint needed */
/* Mobile-only elements — hidden on desktop, shown via media query below */
#asw-sidebar-close { display: none; }

/* Mobile filter button — hidden on desktop */
#asw-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-radius);
  font-size: 13px;
  color: var(--asw-text);
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#asw-filter-btn:hover { border-color: #9ca3af; }

@media (max-width: 860px)  {
  #asw-filter-btn { display: flex; }
  #asw-grid { grid-template-columns: repeat(2, 1fr); }
  #asw-scroll { padding: 0 12px 12px; }

  /* Sidebar as slide-in overlay on mobile */
  #asw-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    z-index: 20;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #asw-sidebar.asw-sidebar-open {
    transform: translateX(0);
  }
  /* Close button inside sidebar */
  #asw-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--asw-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--asw-text);
  }
  #asw-sidebar-close button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--asw-text-muted);
    line-height: 1;
    padding: 4px 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  /* Dim overlay behind sidebar */
  #asw-sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 19;
    cursor: pointer;
  }
  #asw-sidebar-backdrop.asw-visible { display: block; }
}
@media (max-width: 480px)  {
  #asw-grid { grid-template-columns: 1fr; gap: 8px; }
  #asw-header { padding: 0 12px; gap: 10px; }
  #asw-logo  { display: none; }

  /* ── eBay-style horizontal card: image left · text right ── */

  /* Card link becomes a row */
  #asw-grid .asw-card-link {
    flex-direction: row;
    align-items: stretch;
    min-height: 110px;
  }

  /* Image thumbnail: fixed 110px square on the LEFT */
  #asw-grid .asw-card-img-wrap {
    order: 1;
    width: 110px;
    min-width: 110px;
    flex-shrink: 0;
    padding-top: 0;          /* override the 75% padding-top trick */
    height: auto;
    min-height: 110px;
    border-right: 1px solid var(--asw-border);
  }
  #asw-grid .asw-card-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 6px;
  }

  /* Body: right side, flexible */
  #asw-grid .asw-card-body {
    order: 2;
    flex: 1;
    padding: 8px 10px 6px;
    gap: 3px;
    min-width: 0;            /* prevent text overflow stretching card */
  }

  /* Name: slightly smaller on mobile, still 2-line clamp */
  #asw-grid .asw-card-name {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  /* Meta: tighter */
  #asw-grid .asw-card-meta { font-size: 12px; }

  /* Price row */
  #asw-grid .asw-card-price { font-size: 13px; margin-top: 4px; }

  /* Badge: top-left corner of the image thumbnail — hide pre-order badge (too long to fit) */
  #asw-grid .asw-badge-stock {
    top: 5px;
    left: 5px;
    font-size: 10px;
    padding: 0 5px;
    height: 18px;
    line-height: 18px;
  }
  #asw-grid .asw-badge-stock.pre { display: none; }

  /* Pre-order ETA: shown at the top of the card body (right side) — matches desktop badge style */
  #asw-grid .asw-preorder-eta {
    display: inline-block;
    align-self: flex-start;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 8px;
    height: 22px;
    line-height: 22px;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
  }

  /* Footer: full-width strip below the row — compact */
  #asw-grid .asw-card-footer {
    padding: 5px 10px 8px;
  }

  /* Stepper + button on one line, equal height */
  #asw-grid .asw-cart-wrap {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
  }

  /* Stepper: fixed width, same height as button */
  #asw-grid .asw-stepper {
    flex-shrink: 0;
    width: 110px;
    height: 36px;
    box-sizing: border-box;
  }
  #asw-grid .asw-step-btn {
    height: 36px;
    line-height: 36px;
    padding: 0 10px;
    font-size: 18px;
    min-width: 36px;
  }
  #asw-grid .asw-qty-input {
    height: 36px;
    font-size: 14px;
  }

  /* Add to basket: equal height, fills remaining space */
  #asw-grid .asw-add-btn {
    flex: 1;
    height: 36px;
    font-size: 13px;
  }
}
