/* Palatou Shop — faceted archives (S3). WP Grid Builder renders the facets; every colour here is a theme
   token (ink on paper, gold only as hairlines), so none of WPGB's default skin shows. Loaded only on the
   shop, product categories/brands and search (inc/filters.php). */

/* ---------- WPGB's own variables, re-pointed at the theme ---------- */
.ps-shop {
  --wpgb-accent-scheme-1: var(--ink);
  --wpgb-border-radius: 6px;
  --wpgb-border-width: 1px;
  --wpgb-grey-100: var(--surface);
  --wpgb-grey-200: var(--line);
  --wpgb-grey-500: var(--ink-faint);
  --wpgb-grey-700: var(--ink-soft);
  --wpgb-grey-800: var(--ink);
  --wpgb-grey-900: var(--ink);
  --wpgb-red: var(--gold-deep);
  font-family: var(--font);
}

/* ---------- Layout: sidebar 280px at 1024+, results as a container ---------- */
.ps-shop { display: grid; grid-template-columns: minmax(0, 1fr); }
.ps-results { min-width: 0; container-type: inline-size; }
@media (min-width: 1024px) {
  .ps-shop { grid-template-columns: 280px minmax(0, 1fr); gap: 0 clamp(40px, 4vw, 64px); align-items: start; }
  .ps-filters {
    position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: 4px; scrollbar-width: thin;
    /* 2026-09-29: the header is sticky and slides back on scroll-up; menu.js publishes its height while
       shown (0 while hidden), so the sidebar moves down with it instead of sitting under it. */
    top: calc(var(--cd-header-offset, 0px) + 24px);
    max-height: calc(100vh - 48px - var(--cd-header-offset, 0px));
    transition: top .2s ease, max-height .2s ease;
  }
  .ps-filters__close, .ps-filters__foot, .ps-filters-open, .ps-filters-backdrop { display: none !important; }
}

/* The theme's product grid, counted in the results column instead of the viewport. */
.ps-results .woocommerce ul.products, .woocommerce .ps-results ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 620px) { .woocommerce .ps-results ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 24px; } }
@container (min-width: 1000px) { .woocommerce .ps-results ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 64px 28px; } }

/* ---------- Sidebar ---------- */
.ps-filters__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ps-filters__close { appearance: none; margin: 0; padding: 0; border: 0; background: transparent; }
.ps-filters__title {
  margin: 0; font: 500 11px/1.4 var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint);
}
@media (min-width: 1024px) {
  .ps-filters__head { padding: 18px 0 14px; border-top: 1px solid var(--line); }
}
.ps-shop .ps-facet { margin: 0; }
.ps-filters .ps-facet:not(:empty) { padding: 20px 0 22px; border-top: 1px solid var(--line); }
.ps-filters .ps-facet--q:not(:empty) { border-top: 0; padding-top: 4px; }
.ps-shop .wpgb-facet fieldset,
.ps-shop .wpgb-facet > fieldset:last-child { margin: 0; padding: 0; border: 0; min-width: 0; }   /* WPGB adds 40px below */

/* ---------- Drawer below 1024 ---------- */
@media (max-width: 1023px) {
  .ps-filters {
    position: fixed; inset: 0 auto 0 0; z-index: 70; width: min(420px, 92vw);
    display: flex; flex-direction: column; background: var(--bg);
    box-shadow: 0 0 0 1px var(--line), 24px 0 60px -30px rgba(22, 20, 15, .35);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .28s;
  }
  .ps-filters.is-open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
  .ps-filters:focus { outline: none; }
  .ps-filters__head { padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); }
  .ps-filters__title { font-size: 12px; color: var(--ink); }
  .ps-filters__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px; }
  .ps-filters__foot { padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
  .ps-filters__apply { width: 100%; justify-content: center; }
  .ps-filters-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(42, 39, 36, .38); }
  .ps-filters-backdrop[hidden] { display: none; }
  html.ps-scroll-locked, html.ps-scroll-locked body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-filters, .ps-filters.is-open { transition: none; }
}

/* ---------- Toolbar: filters button · result count · sort ---------- */
.ps-toolbar--facets { min-height: 72px; }
.ps-filters-open {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; margin: 0;
  border: 1px solid rgba(152, 128, 52, .5); border-radius: 12px; background: transparent; color: var(--ink);
  font: 500 14px/1 var(--font); cursor: pointer;
}
.ps-filters-open:hover { background: rgba(152, 128, 52, .06); border-color: var(--gold); }
.ps-filters-open .ps-svg { width: 18px; height: 18px; }
.ps-toolbar--facets .ps-facet--apotelesmata { flex: 1; min-width: 0; }
.ps-shop .wpgb-result-count, .ps-shop .ps-facet--apotelesmata {
  font: 500 11px/1.4 var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint);
}
.ps-toolbar--facets .ps-facet--sort { margin-left: auto; }
@media (max-width: 1023px) {
  .ps-toolbar--facets { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 0; }
  .ps-toolbar--facets .ps-filters-open { grid-area: 1 / 1; }
  .ps-toolbar--facets .ps-facet--sort { grid-area: 1 / 2; justify-self: end; max-width: 100%; margin: 0; }
  .ps-toolbar--facets .ps-facet--apotelesmata { grid-area: 2 / 1 / 3 / -1; }
}

/* ---------- Active selections + «Καθαρισμός όλων» ---------- */
.ps-selection { display: none; }
.ps-selection.has-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 40px; padding: 16px 0 4px; }
.ps-selection .ps-facet--epiloges ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* ---------- Results ---------- */
.ps-results__content { min-height: 240px; padding-top: 32px; }
.ps-results__content.wpgb-loading, .ps-shop .wpgb-loading { opacity: 1; }
.ps-results .woocommerce-notices-wrapper:empty { display: none; }

/* Empty state */
.ps-noresults { max-width: 560px; padding: clamp(40px, 6vw, 72px) 0; }
.ps-noresults__title { margin: 0 0 10px; font: 300 clamp(24px, 2.4vw, 30px)/1.2 var(--font-display); color: var(--ink); }
.ps-noresults__text { margin: 0 0 24px; color: var(--ink-soft); }

/* Pagination facet */
.ps-shop .ps-facet--selida:not(:empty) { margin-top: clamp(48px, 6vw, 80px); }

/* ---------- Facet internals: WPGB markup in the theme's type and colours ---------- */
.ps-shop .wpgb-facet { color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-facet-title { margin: 0 0 16px; font: 500 11px/1.4 var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.ps-shop .wpgb-facet :focus-visible,
.ps-shop .wpgb-facet .wpgb-checkbox:focus-visible .wpgb-checkbox-control { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

/* Checkbox lists (Μάρκα, Περιοχή, Ανάγκη, Χρώμα) */
.ps-shop .wpgb-facet .wpgb-hierarchical-list li { margin: 12px 0 0; }
.ps-shop .wpgb-facet .wpgb-checkbox-facet .wpgb-checkbox { align-items: center; min-height: 24px; cursor: pointer; }
.ps-shop .wpgb-facet .wpgb-checkbox-facet .wpgb-checkbox-control {
  width: 18px; height: 18px; border-radius: 5px; border-color: var(--ink-faint); background: #fff;
}
.ps-shop .wpgb-facet .wpgb-checkbox-facet .wpgb-checkbox:hover:not([tabindex="-1"]) .wpgb-checkbox-control { border-color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-checkbox-facet .wpgb-checkbox[aria-pressed="true"] .wpgb-checkbox-control { background: var(--ink); border-color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-checkbox-label { padding-left: 12px; font: 400 14px/1.45 var(--font); color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-checkbox-label > span { color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.ps-shop .wpgb-facet .wpgb-checkbox[aria-disabled="true"] { opacity: .45; cursor: default; }
.ps-shop .wpgb-facet .wpgb-toggle-hidden {
  margin: 14px 0 0; padding: 4px 0; background: none; border: 0; border-bottom: 1px solid rgba(152, 128, 52, .45); border-radius: 0;
  font: 500 12px/1.4 var(--font); letter-spacing: .04em; color: var(--gold-deep);
}
.ps-shop .wpgb-facet .wpgb-toggle-hidden:hover { background: none; color: var(--ink); border-color: var(--gold); }

/* «Διαθέσιμο / Σε προσφορά» as switches */
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox-control {
  width: 36px; height: 20px; border-radius: 999px; border-color: var(--line); background: var(--surface-2);
  justify-content: flex-start; transition: background-color .2s ease, border-color .2s ease;
}
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox-control::before { display: none; }
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox .wpgb-checkbox-control::after,
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox[aria-pressed="true"] .wpgb-checkbox-control::after {
  width: 14px; height: 14px; top: 0; margin-left: 2px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(22, 20, 15, .25); transform: none; transition: margin-left .2s ease;
}
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox[aria-pressed="true"] .wpgb-checkbox-control { background: var(--ink); border-color: var(--ink); }
.ps-shop .ps-facet--diathesimo .wpgb-checkbox-facet .wpgb-checkbox[aria-pressed="true"] .wpgb-checkbox-control::after { margin-left: 18px; }

/* Τιμή: a gold hairline track, white thumbs; hidden when nothing is left to range over */
.ps-shop .ps-facet--timi:has(input.wpgb-range[max="0"]) { display: none; }
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-slider { height: 2px; margin: 16px 0 18px; border-radius: 2px; background: var(--line); }
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-slider .wpgb-range-progress { background: var(--gold); }
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-slider .wpgb-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(22, 20, 15, .15);
}
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-values { font: 500 13px/1.4 var(--font); color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-clear {
  padding: 4px 0; background: none; border-radius: 0; border-bottom: 1px solid rgba(152, 128, 52, .45);
  font: 500 12px/1.4 var(--font); color: var(--gold-deep);
}
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-clear:hover:not([disabled]) { background: none; color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-range-facet .wpgb-range-clear[disabled] { opacity: 0; pointer-events: none; }

/* Αναζήτηση and Ταξινόμηση: the theme's fields */
.ps-shop .wpgb-facet .wpgb-search-facet .wpgb-input {
  width: 100%; min-height: 48px; padding: 12px 40px 12px 44px; text-indent: 0;
  font: 400 15px/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ps-shop .wpgb-facet .wpgb-search-facet .wpgb-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(152, 128, 52, .15); }
.ps-shop .wpgb-facet .wpgb-search-facet .wpgb-input-icon { margin-left: 16px; color: var(--ink-faint); }
.ps-shop .wpgb-facet .wpgb-sort-facet label { position: relative; display: block; }
.ps-shop .wpgb-facet .wpgb-sort-facet select.wpgb-select {
  box-sizing: border-box; height: auto; min-height: 44px; min-width: 200px; padding: 10px 44px 10px 16px;
  font: 400 14px/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.ps-shop .wpgb-facet .wpgb-sort-facet select.wpgb-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(152, 128, 52, .15); }
.ps-shop .wpgb-facet .wpgb-sort-facet .wpgb-select-controls { color: var(--ink-faint); }
.ps-shop .wpgb-facet .wpgb-sort-facet .wpgb-select-separator { display: none; }
@media (max-width: 1023px) {
  .ps-shop .wpgb-facet .wpgb-sort-facet select.wpgb-select { min-width: 0; max-width: 100%; }
}

/* Επιλογές: outlined pills with ×; «Καθαρισμός όλων» as a text link */
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-inline-list { margin: 0; gap: 8px; }
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-inline-list li { margin: 0; }
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button,
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button[aria-pressed="true"] {
  padding: 5px 12px 5px 10px; border: 1px solid rgba(152, 128, 52, .5); border-radius: 999px; background: transparent; color: var(--ink);
}
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button:hover { background: rgba(152, 128, 52, .06); border-color: var(--gold); }
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button-label { padding: 0 0 0 6px; font: 500 13px/24px var(--font); color: var(--ink); }
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button-control::before,
.ps-shop .wpgb-facet .wpgb-selection-facet .wpgb-button-control::after { width: 1.25px; background: var(--ink); }
.ps-shop .wpgb-facet button.wpgb-reset {
  margin: 0; padding: 4px 0; background: none; color: var(--ink); border-radius: 0; border-bottom: 1px solid rgba(152, 128, 52, .5);
  font: 500 13px/1.4 var(--font); letter-spacing: 0;
}
.ps-shop .wpgb-facet button.wpgb-reset:hover { color: var(--gold-deep); border-color: var(--gold); }

/* Αποτελέσματα */
.ps-shop .wpgb-facet .wpgb-result-count { font: inherit; color: inherit; }

/* Σελιδοποίηση: the theme's pagination pills */
.ps-shop .wpgb-facet .wpgb-pagination { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-shop .wpgb-facet .wpgb-pagination li { height: auto; min-width: 0; margin: 0; line-height: 1; font-weight: 500; }
.ps-shop .wpgb-facet .wpgb-pagination li a,
.ps-shop .wpgb-facet .wpgb-pagination li a:hover,
.ps-shop .wpgb-facet .wpgb-pagination li .wpgb-dots-page {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(152, 128, 52, .45); background: transparent;
  font: 500 13px/1 var(--font); color: var(--ink);
}
.ps-shop .wpgb-facet .wpgb-pagination li a:hover { background: rgba(152, 128, 52, .06); border-color: var(--gold); }
.ps-shop .wpgb-facet .wpgb-pagination li a[aria-current] { background: var(--black); border-color: var(--black); color: var(--on-black); }
.ps-shop .wpgb-facet .wpgb-pagination li .wpgb-dots-page { border-color: transparent; }

/* Χρώμα: the search box over the list (assets/filters.js); while it has text, every match shows and «Περισσότερα» hides */
.ps-shop .ps-facet-search { margin: 0 0 14px; }
.ps-shop .ps-facet-search input[type="search"] {
  width: 100%; min-height: 44px; padding: 10px 14px; font: 400 14px/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s ease, box-shadow .2s ease;
}
.ps-shop .ps-facet-search input[type="search"]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(152, 128, 52, .15); }
.ps-shop .ps-facet-search__none { margin: 10px 0 0; font: 400 13px/1.4 var(--font); color: var(--ink-faint); }
.ps-shop .ps-facet--xroma.is-searching .wpgb-checkbox-facet li { display: none; }
.ps-shop .ps-facet--xroma.is-searching .wpgb-checkbox-facet li.ps-match { display: block; }
.ps-shop .ps-facet--xroma.is-searching .wpgb-toggle-hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .ps-filters { transition: none; } }
