/* =====================================================================
   Mobile & tablet product listing (< 1024px)
   ---------------------------------------------------------------------
   Modelled on how large Dutch retailers list products on phones
   (bol.com, Coolblue, Gamma, IKEA — reviewed November 2026):
   - Products as compact LIST ROWS: image left, facts + price right,
     the whole row is the tap target (no per-card button).
   - A STICKY bar under the header: Filters · Sort · view toggle, plus a
     horizontally scrolling row of one-tap filter pills.
   - Optional 2-column TILES view (bol's grid/list switch).
   Desktop (>= 1024px) is intentionally untouched, so this layer is scoped
   to max-width. EXCEPTION to "mobile-first" (LAYOUT_SAFETY_CONTRACT §7):
   writing these as base styles would change the approved desktop grid.
   Loaded after shop-retail.css on every listing page.
   ===================================================================== */

/* Pills and view toggle are created by shop-filters.js; hidden on desktop. */
.shop-quickbar,
.shop-view-toggle { display: none; }

/* Size range + lead time lines (all widths). */
.shop-listing .product-card__facts {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--shop-muted);
}
.shop-listing .product-card__lead {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--success-dark, #059669);
}
.shop-listing .product-card__lead svg { flex-shrink: 0; }

@media (max-width: 1023.98px) {

  /* ---------- Result count (moved above the sticky bar by JS) ---------- */
  .shop-listing .shop-products > .shop-toolbar__count {
    display: block;
    margin: 0 0 var(--space-xs);
    font-size: var(--text-sm);
    color: var(--shop-muted);
  }

  /* ---------- Sticky toolbar ---------- */
  .shop-listing .shop-toolbar {
    position: sticky;
    top: var(--header-height);
    z-index: 20;
    display: block;
    margin: 0 calc(-1 * var(--gutter, 16px)) var(--space-md);
    padding: var(--space-xs) var(--gutter, 16px);
    background: #fff;
    border-bottom: 1px solid var(--shop-line);
  }
  .shop-listing .shop-toolbar__sort {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-xs);
  }
  .shop-listing .shop-toolbar__sort .mobile-filter-toggle {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--cta-bg, #1D4E89);
    color: var(--cta-text, #fff);
    font-weight: 700;
  }
  .shop-listing .shop-toolbar__sort .mobile-filter-toggle svg,
  .shop-listing .shop-toolbar__sort .mobile-filter-toggle svg path {
    color: inherit;
    fill: currentColor;
  }
  .shop-listing .shop-toolbar__sort .mobile-filter-toggle__count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--accent-yellow, #FFCC33);
    color: var(--accent-yellow-ink, #0B2442);
    font-size: 12px;
    line-height: 20px;
  }
  .shop-listing .shop-toolbar__sort #sort-select {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    border-radius: 8px;
    font-size: 16px; /* >= 16px: no iOS zoom on focus */
  }
  .shop-listing .shop-view-toggle {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--shop-line);
    border-radius: 8px;
    background: #fff;
    color: var(--shop-ink);
    cursor: pointer;
  }
  .shop-listing .shop-view-toggle:focus-visible,
  .shop-listing .shop-pill:focus-visible {
    outline: 2px solid var(--cta-bg, #1D4E89);
    outline-offset: 2px;
  }

  /* ---------- One-tap filter pills ---------- */
  .shop-listing .shop-quickbar:not([hidden]) {
    display: flex;
    gap: var(--space-xs);
    margin: var(--space-xs) calc(-1 * var(--gutter, 16px)) 0;
    padding: 2px var(--gutter, 16px);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .shop-listing .shop-quickbar::-webkit-scrollbar { display: none; }
  .shop-listing .shop-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--shop-line);
    border-radius: 999px;
    background: #fff;
    color: var(--shop-ink);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }
  .shop-listing .shop-pill[aria-pressed="true"] {
    border-color: var(--cta-bg, #1D4E89);
    background: var(--brand-50, #edf2f9);
    color: var(--cta-bg, #1D4E89);
  }

  /* The active-filter chips row stays, but tighter. */
  .shop-listing .filter-chips-container:not([hidden]) { margin-bottom: var(--space-xs); }
  .shop-listing .filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shop-listing .filter-chip { flex: 0 0 auto; white-space: nowrap; }

  /* ---------- Product LIST ROW (default) ---------- */
  .shop-listing .products-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .shop-listing .products-grid .product-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(112px, 40%) minmax(0, 1fr);
    column-gap: var(--space-sm);
    align-items: start;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--shop-line);
  }
  .shop-listing .products-grid .product-card:first-child { padding-top: 0; }
  .shop-listing .products-grid .product-card__media { grid-column: 1; grid-row: 1; }
  .shop-listing .products-grid .product-card__body { grid-column: 2; grid-row: 1; padding: 0; }

  /* Whole row opens the product (stretched link); heart stays above it. */
  .shop-listing .products-grid .product-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .shop-listing .products-grid .product-card__save {
    z-index: 2;
    top: 6px;
    right: 6px;
    width: 40px;
    height: 40px;
    box-shadow: 0 1px 3px rgba(11, 36, 66, 0.16);
  }
  .shop-listing .products-grid .product-card__save svg { width: 20px; height: 20px; }
  .shop-listing .products-grid .product-card__badge { z-index: 2; }

  /* Second image view and the full-width button move to the product page. */
  .shop-listing .products-grid .product-card__image-views,
  .shop-listing .products-grid .product-card__actions--retail { display: none; }

  .shop-listing .products-grid .product-card__title,
  .shop-listing .products-grid .product-card .product-card__title a {
    font-size: var(--text-base);
    line-height: 1.3;
  }
  .shop-listing .products-grid .product-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .shop-listing .products-grid .product-card__variant {
    margin: 2px 0 0;
    font-size: var(--text-sm);
    line-height: 1.35;
  }
  .shop-listing .products-grid .product-card__facts {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--shop-muted);
  }
  .shop-listing .products-grid .product-card__offer { margin-top: 0; padding-top: var(--space-xs); }
  .shop-listing .products-grid .product-card__price { gap: 2px 6px; }
  .shop-listing .products-grid .product-card__price-from {
    flex-basis: auto;
    font-size: 13px;
    color: var(--shop-muted);
  }
  /* Keep the yellow price tag, at a size that fits a row. */
  .shop-listing .products-grid .product-card__price-current,
  .shop-listing .products-grid .product-card__price-current:first-child {
    font-size: 1.375rem;
    letter-spacing: -0.02em;
  }
  .shop-listing .products-grid .product-card__currency { padding-top: 1px; font-size: 13px; }
  .shop-listing .products-grid .product-card__price-current--request { font-size: var(--text-base); }
  .shop-listing .products-grid .product-card__summary {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
  }
  .shop-listing .products-grid .product-card__lead {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--success-dark, #059669);
  }
  .shop-listing .products-grid .product-card__lead svg { flex-shrink: 0; }

  /* ---------- TILES view (2 columns) ---------- */
  .shop-listing .products-grid.products-grid--tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg) var(--space-sm);
  }
  .shop-listing .products-grid--tiles .product-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-bottom: 0;
  }
  .shop-listing .products-grid--tiles .product-card__body { padding-top: var(--space-xs); }
  .shop-listing .products-grid--tiles .product-card__title,
  .shop-listing .products-grid--tiles .product-card .product-card__title a { font-size: var(--text-sm); }
  .shop-listing .products-grid--tiles .product-card__title { -webkit-line-clamp: 2; line-clamp: 2; }
  .shop-listing .products-grid--tiles .product-card__facts,
  .shop-listing .products-grid--tiles .product-card__lead { display: none; }
  .shop-listing .products-grid--tiles .product-card__price-current,
  .shop-listing .products-grid--tiles .product-card__price-current:first-child { font-size: 1.25rem; }
}

/* Tablet: two list rows side by side, three tiles. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .shop-listing .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-lg); }
  .shop-listing .products-grid .product-card:nth-child(2) { padding-top: 0; }
  .shop-listing .products-grid.products-grid--tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Small phones (320–359px): narrower image column. */
@media (max-width: 359.98px) {
  .shop-listing .products-grid .product-card { grid-template-columns: 104px minmax(0, 1fr); }
}
