/* Product archive - hero, filters and cards. Builds on design-system.css.
   No entrance animation anywhere: it was decoration and cost a repaint on
   every scroll. */

/* Same shape as the /ips/* hero: copy on one side, a large type tile on the
   other. In RTL that puts the tile on the left, matching those pages. */
.ar-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(18px, 3vw, 48px); align-items: center; margin-top: 14px; }
.ar-hero__text { min-width: 0; }
.ar-badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 900; letter-spacing: .06em;
  color: var(--ar-accent, var(--accent));
  background: color-mix(in srgb, var(--ar-accent, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ar-accent, var(--accent)) 32%, transparent);
  border-radius: 99px; padding: 4px 12px; margin-bottom: 10px;
}
.ar-hero__visual { display: grid; place-items: center; }
.ar-tile {
  width: 168px; height: 168px; border-radius: 38px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--ar-accent, var(--accent)) 16%, transparent), color-mix(in srgb, var(--ar-accent, var(--accent)) 3%, transparent));
  border: 1.5px solid color-mix(in srgb, var(--ar-accent, var(--accent)) 28%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--ar-accent, var(--accent)) 45%, transparent);
}
.ar-tile__icon {
  width: 74px; height: 74px; border-radius: 22px;
  background: var(--ar-grad, var(--accent)); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 16px 44px -12px color-mix(in srgb, var(--ar-accent, var(--accent)) 70%, transparent);
}
.ar-tile__label { font-size: 14px; font-weight: 900; color: var(--text); }

.ar-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ar-stat { font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 99px; padding: 6px 13px; white-space: nowrap; }
.ar-stat b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }

.ar-toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
/* Section header for the grid. */
.ar-listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 2px 0 14px; }
.ar-listhead h2 { font-size: clamp(18px, 2.2vw, 24px); font-weight: 900; letter-spacing: -.3px; margin: 0; color: var(--text); }
.ar-listhead .ar-count { margin-inline-start: 0; }

/* Capped rather than free-growing: as flex:1 1 240px with nothing to its end it
   stretched the full width of the page and read as a page-wide bar instead of a
   search field. It still fills the row on narrow screens. */
.ar-search { position: relative; flex: 1 1 220px; max-width: 340px; min-width: 0; }
.ar-search svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted2); pointer-events: none; }
.ar-search input {
  width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font: inherit; font-size: 14px; padding: 11px 42px 11px 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ar-search input::placeholder { color: var(--muted2); }
.ar-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.ar-sort { background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; padding: 11px 14px; cursor: pointer; }
.ar-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ar-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; margin-inline-start: auto; }
.ar-count b { color: var(--text); font-weight: 800; }

.ar-regions { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 14px; margin-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ar-regions::-webkit-scrollbar { display: none; }
.ar-region {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 99px;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 15px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ar-region span { font-size: 11px; font-weight: 700; color: var(--muted2); font-variant-numeric: tabular-nums; }
.ar-region:hover { border-color: var(--border2); color: var(--text); }
.ar-region.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ar-region.is-active span { color: rgba(255, 255, 255, .75); }
.ar-region:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ds-product-card { position: relative; }
.ds-product-card:hover { border-color: var(--accent); box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--accent) 70%, transparent); }
.ds-product-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ds-product-card[hidden] { display: none !important; }

.ar-price-from { display: flex; align-items: baseline; gap: 5px; }
.ar-price-from small { font-size: 11px; color: var(--muted2); font-weight: 600; }
.ar-price-from b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }

.ar-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ar-chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface, rgba(139, 92, 246, .10)); border: 1px solid var(--border); color: var(--muted); }

.ar-empty { text-align: center; padding: clamp(40px, 6vw, 68px) 20px; border: 1px dashed var(--border2); border-radius: var(--ds-radius-lg, 20px); background: var(--card); }
.ar-empty svg { color: var(--muted2); margin-bottom: 12px; }
.ar-empty h3 { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.ar-empty p { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.ar-empty button { background: transparent; border: 1px solid var(--border2); border-radius: 12px; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; padding: 10px 22px; cursor: pointer; }
.ar-empty button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .ar-hero { grid-template-columns: auto 1fr; gap: 11px; }
  .ar-stats { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .ar-hero__icon { width: 38px; height: 38px; border-radius: 11px; }
  .ar-hero__icon svg { width: 18px; height: 18px; }
  .ar-hero__text p { font-size: 12.5px; }
  .ar-stat { font-size: 11.5px; padding: 5px 11px; }
  .ar-toolbar { gap: 8px; padding: 10px 0; }
  .ar-count { margin-inline-start: 0; order: 3; width: 100%; }
  .ar-sort { flex: 1 1 auto; }
  /* Two per row: one-per-row turned thirty-six products into a very long
     scroll, which was the original complaint. */
  .ds-grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .ds-product-card__title { font-size: 13px; line-height: 1.5; }
  .ar-price-from b { font-size: 13.5px; }
  .ar-chips { gap: 4px; }
  .ar-chip { font-size: 9.5px; padding: 2px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-product-card, .ar-region, .ar-search input { transition: none; }
}
/* Load more / scroll sentinel */
.ar-more { display: flex; justify-content: center; margin-top: clamp(20px, 3vw, 32px); }
.ar-more button { background: var(--card); border: 1px solid var(--border2); border-radius: 14px; color: var(--text); font: inherit; font-size: 14px; font-weight: 800; padding: 12px 30px; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.ar-more button:hover { border-color: var(--accent); color: var(--accent); }
.ar-more button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ar-more[hidden] { display: none; }

@media (max-width: 900px) {
  .ar-hero { gap: 16px; }
  .ar-tile { width: 128px; height: 128px; border-radius: 30px; }
  .ar-tile__icon { width: 58px; height: 58px; border-radius: 18px; }
  .ar-tile__icon svg { width: 30px; height: 30px; }
  .ar-tile__label { font-size: 12px; }
}

@media (max-width: 640px) {
  /* The tile stays - it is the page's identity - but shrinks hard, because the
     complaint was vertical scrolling and a 168px hero is a third of a phone. */
  .ar-hero { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .ar-tile { width: 86px; height: 86px; border-radius: 22px; gap: 0; }
  .ar-tile__icon { width: 46px; height: 46px; border-radius: 14px; box-shadow: none; }
  .ar-tile__icon svg { width: 24px; height: 24px; }
  .ar-tile__label { display: none; }
  .ar-badge { font-size: 10px; padding: 3px 9px; margin-bottom: 7px; }
  .ar-stats { margin-top: 10px; }
}
