/* ==========================================================================
   BanSek Trade v2 — products page (direction correction D1–D3): the Arttex
   structure on paper. The card itself is in components.css.
   ========================================================================== */



/* --------------------------------------------------------------------------
   Page head
   -------------------------------------------------------------------------- */
.plist { padding-block: clamp(28px, 4vw, 56px) var(--space-l); }
.phead { display: grid; gap: 14px; margin-bottom: clamp(28px, 3.5vw, 48px); padding-top: 14px; border-top: 3px double var(--paper-3); }
.phead__title { font-size: clamp(40px, 5vw, 72px); }
.crumbs a { color: var(--steel); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink-2); }

.plist__layout { display: grid; gap: 32px; }
@media (min-width: 1024px) {
  .plist__layout { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
}

/* --------------------------------------------------------------------------
   Sidebar — sticky, 280px (D1). Below 1024px the same form lives in the
   bottom sheet.
   -------------------------------------------------------------------------- */
.fside { display: none; }
@media (min-width: 1024px) {
  .fside {
    display: block;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
    /* Ends above the floating Asistent pill (bottom left), never under it. */
    max-height: calc(100svh - var(--nav-h) - 104px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 22px 26px;
    border: 1px solid var(--paper-3);
    border-radius: var(--r-tile);
    scrollbar-width: thin;
  }
}
.filters { display: grid; gap: 0; }
.filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.filters__title { color: var(--ink); font-size: 12px; }
.filters__reset { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--lime-text); }
.filters__reset:hover { color: var(--ink); }
.fgroup { margin: 0; padding: 18px 0; border: 0; border-bottom: var(--hairline); min-width: 0; }
.fgroup__title { float: left; width: 100%; margin-bottom: 12px; padding: 0; }
.fgroup__title + * { clear: both; }

.fradio, .fcheck {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.fradio.is-quiet { color: var(--steel); }
.fradio input, .fcheck input { width: 16px; height: 16px; margin: 0; accent-color: var(--night); }
.fradio input:checked + .fradio__label { font-weight: 500; }
.fcount { font-size: 12px; color: var(--steel); }
.fsub { display: grid; }

/* Chips — pill checkboxes; active: lime-soft fill, green text (D1). */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { position: relative; display: inline-flex; }
/* The input covers the chip, transparent: it takes the clicks and draws the
   one focus ring (base.css) around the whole pill. */
.fchip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.fchip input:focus-visible { border-radius: var(--r-pill); }
.fchip input:disabled { cursor: not-allowed; }
.fchip__label { order: 0; }
.fchip {
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--paper-3);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color var(--dur-fast) var(--ease-soft), background-color var(--dur-fast) var(--ease-soft);
}
.fchip:hover { border-color: var(--ink-3); }
.fchip:has(input:checked) { background: var(--lime-soft); border-color: var(--lime-ink); color: var(--lime-text); }
.fchip:has(input:disabled) { opacity: .5; }

/* --------------------------------------------------------------------------
   Top bar (D2)
   -------------------------------------------------------------------------- */
.ptop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 12px;
  align-items: center;
  margin-bottom: 22px;
}
.ptop__search {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--paper-3);
  border-radius: var(--r-pill);
  color: var(--steel);
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.ptop__search:focus-within { border-color: var(--ink-3); }
.ptop__input { flex: 1; min-width: 0; border: 0; background: none; font-size: 15px; color: var(--ink); outline: none; }
.ptop__input::placeholder { color: var(--steel); }
.ptop__input::-webkit-search-cancel-button { filter: grayscale(1); }
.ptop__filters { justify-self: start; }
.ptop__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--night);
  color: var(--paper);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
.ptop__sort { display: inline-flex; align-items: center; gap: 10px; justify-self: end; }
.ptop__sort select {
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--paper-3);
  border-radius: var(--r-pill);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8' fill='none' stroke='%233E444D' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none;
  appearance: none;
  font-size: 13px;
  color: var(--ink);
}
.ptop__active { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ptop__chips { display: contents; }
.achip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--lime-ink);
  border-radius: var(--r-pill);
  background: var(--lime-soft);
  color: var(--lime-text);
  font-size: 13px;
}
.achip:hover { border-color: var(--ink); color: var(--ink); }
.ptop__clear { min-height: 34px; }
.ptop__count { grid-column: 1 / -1; color: var(--steel); }
@media (min-width: 1024px) {
  .ptop { grid-template-columns: minmax(0, 1fr) auto; }
  .ptop__search { grid-column: 1; }
  .ptop__filters { display: none; }
  .ptop__count { grid-column: 1; }
  .ptop__sort { grid-row: 1; grid-column: 2; }
}

/* --------------------------------------------------------------------------
   Grid — 3 / 2 / 1, gap 24px (D3)
   -------------------------------------------------------------------------- */
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.pgrid__item { display: flex; min-width: 0; }
.pgrid__item > .card { flex: 1; }
@media (min-width: 600px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pempty {
  display: grid;
  gap: 20px;
  justify-items: start;
  padding: clamp(28px, 4vw, 48px);
  border: 1px dashed var(--paper-3);
  border-radius: var(--r-tile);
}
.pempty__text { max-width: 30ch; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.3; }

/* Without JavaScript: the full list, no controls that cannot work. */
html:not(.js) .fside, html:not(.js) .ptop__search, html:not(.js) .ptop__filters, html:not(.js) .ptop__sort { display: none; }
@media (min-width: 1024px) { html:not(.js) .plist__layout { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   Bottom sheet (< 1024px)
   -------------------------------------------------------------------------- */
.fsheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-end;
  background: var(--night-40);
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease-soft);
}
.fsheet.is-open { opacity: 1; }
.fsheet__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 88svh;
  border-radius: var(--r-hero) var(--r-hero) 0 0;
  background: var(--paper);
  transform: translateY(24px);
  transition: transform var(--dur-mid) var(--ease-out);
}
.fsheet.is-open .fsheet__panel { transform: none; }
.fsheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter); border-bottom: var(--hairline); }
.fsheet__title { font-size: 24px; }
.fsheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gutter) 16px; }
.fsheet__foot { padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom)); border-top: var(--hairline); }
.fsheet__show { width: 100%; justify-content: center; }
.fsheet .filters__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fsheet .filters__head { justify-content: flex-end; border-bottom: 0; padding-bottom: 0; }
