/* HI5 store pages: title, toolbar, product grid, filter panel. Tokens: design HI5 Ink and Signal Red. */

/* ---------- Page frame: full width, no sidebar ---------- */
body.hi5-archive { background: var(--hi5-bg); }
body.hi5-archive #content > .ast-container,
body.hi5-archive .site-content > .ast-container { display: block; width: 100%; max-width: none; padding: 0; }
body.hi5-archive #primary { float: none; width: 100%; max-width: none; margin: 0; padding: 0; background: transparent; }
body.hi5-archive.ast-separate-container #primary { padding: 0; margin: 0; }
body.hi5-archive #secondary,
body.hi5-archive .woocommerce-products-header,
body.hi5-archive .ast-breadcrumbs-wrapper,
body.hi5-archive .ast-archive-description,
body.hi5-archive .woocommerce-result-count,
body.hi5-archive .woocommerce-ordering { display: none; }

/* ---------- Title ---------- */
.hi5-shop-title {
  margin: 0;
  padding: 28px var(--hi5-pad) 22px;
  color: var(--hi5-ink);
  font: 500 clamp(26px, 3vw, 34px)/1.15 var(--hi5-font);
  text-align: center;
}

/* ---------- Toolbar ---------- */
.hi5-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px var(--hi5-pad) 24px;
  color: var(--hi5-ink);
  font-family: var(--hi5-font);
}
.hi5-toolbar *, .hi5-fdrawer, .hi5-fdrawer * { box-sizing: border-box; }
.hi5-toolbar__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hi5-toolbar__right { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-width: 0; }

body.hi5-archive .hi5-toolbar button,
body.hi5-archive .hi5-toolbar button:hover,
body.hi5-archive .hi5-toolbar button:focus,
body.hi5-archive .hi5-fdrawer button,
body.hi5-archive .hi5-fdrawer button:hover,
body.hi5-archive .hi5-fdrawer button:focus {
  box-shadow: none;
  text-shadow: none;
  text-transform: none;
}
body.hi5-archive .hi5-toolbar :is(a, button, select):focus-visible,
body.hi5-archive .hi5-fdrawer :is(a, button, input, select, summary):focus-visible { outline: 2px solid var(--hi5-accent); outline-offset: 3px; }

/* Filter button */
body.hi5-archive .hi5-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 176px;
  height: 48px;
  margin: 0;
  padding: 0 22px;
  border: 1.5px solid var(--hi5-ink);
  border-radius: var(--hi5-r-sm);
  background: var(--hi5-bg);
  color: var(--hi5-ink);
  font: 500 17px/1 var(--hi5-font);
  cursor: pointer;
}
body.hi5-archive .hi5-filter-btn:hover { background: var(--hi5-surface); color: var(--hi5-ink); border-color: var(--hi5-ink); }
.hi5-filter-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hi5-filter-btn__count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--hi5-r-pill); background: var(--hi5-ink); color: var(--hi5-bg); font: 800 11px/1 var(--hi5-font); }

/* Sort */
.hi5-sort { position: relative; display: flex; align-items: center; }
.hi5-sort > svg { position: absolute; left: 16px; width: 20px; height: 20px; fill: none; stroke: var(--hi5-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.hi5-sort::after { content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--hi5-ink); border-bottom: 2px solid var(--hi5-ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
body.hi5-archive .hi5-sort select {
  -webkit-appearance: none;
  appearance: none;
  width: 240px;
  max-width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 44px 0 46px;
  border: 1px solid var(--hi5-line);
  border-radius: var(--hi5-r-sm);
  background: var(--hi5-bg);
  color: var(--hi5-ink);
  font: 500 16px/1 var(--hi5-font);
  box-shadow: none;
  cursor: pointer;
}
body.hi5-archive .hi5-sort select:hover { border-color: var(--hi5-ink-soft); }

/* Breadcrumb */
.hi5-crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; font: 500 15px/1.3 var(--hi5-font); color: var(--hi5-ink); }
.hi5-crumbs li { margin: 0; padding: 0; }
.hi5-crumbs li + li::before { content: '/'; margin: 0 9px; color: var(--hi5-ink-soft); }
.hi5-crumbs a { color: var(--hi5-ink-soft); text-decoration: none; }
.hi5-crumbs a:hover { color: var(--hi5-ink); text-decoration: underline; text-decoration-color: var(--hi5-accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Count and view switch */
.hi5-count { font: 500 16px/1 var(--hi5-font); white-space: nowrap; }
.hi5-view { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border: 1px solid var(--hi5-line); border-radius: var(--hi5-r-sm); font: 500 16px/1 var(--hi5-font); }
.hi5-view__label { margin-right: 4px; }
body.hi5-archive .hi5-view button { min-width: 24px; height: 32px; margin: 0; padding: 0 4px; border: 0; background: transparent; color: var(--hi5-ink-soft); font: 500 17px/1 var(--hi5-font); cursor: pointer; }
body.hi5-archive .hi5-view button:hover { background: transparent; color: var(--hi5-ink); }
body.hi5-archive .hi5-view button[aria-pressed='true'] { color: var(--hi5-ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--hi5-accent); text-decoration-thickness: 2px; text-underline-offset: 7px; }
.hi5-view__sep { width: 1px; height: 16px; background: var(--hi5-line); }

/* ---------- Product grid ---------- */
body.hi5-archive ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--hi5-cols, 4), minmax(0, 1fr));
  gap: 4px;
  float: none;
  width: 100%;
  margin: 0;
  padding: 0 clamp(4px, .6vw, 10px);
  list-style: none;
}
body.hi5-archive ul.products::before,
body.hi5-archive ul.products::after { content: none !important; display: none !important; }
body.hi5-archive ul.products li.hi5-card {
  position: relative;
  float: none !important;
  clear: none !important;
  width: auto !important;
  margin: 0 0 28px !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

body.hi5-archive ul.products li.hi5-card .hi5-card__media {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--hi5-surface);
}
body.hi5-archive ul.products li.hi5-card .hi5-card__media img {
  position: absolute !important;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  box-shadow: none;
}
.hi5-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: var(--hi5-r-sm);
  background: var(--hi5-bg);
  color: var(--hi5-ink);
  font: 800 11px/1 var(--hi5-font);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hi5-card__badge--sale { background: var(--hi5-ink); color: var(--hi5-bg); }
.hi5-card__badge--sold { color: var(--hi5-ink-soft); }
.hi5-card__bar { display: flex; gap: 2px; margin-top: 6px; }
.hi5-card__bar span { flex: 1; height: 3px; background: var(--hi5-line); }
.hi5-card__bar span.is-active { background: var(--hi5-ink); }

.hi5-card__body { padding: 14px 4px 0; }
body.hi5-archive ul.products li.hi5-card .hi5-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
  padding: 0;
  color: var(--hi5-ink);
  font: 500 17px/1.3 var(--hi5-font);
}
.hi5-card__title a { color: var(--hi5-ink); text-decoration: none; }
.hi5-card__title a:hover { color: var(--hi5-ink); text-decoration: underline; text-decoration-color: var(--hi5-accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hi5-card__price { color: var(--hi5-ink); font: 700 17px/1.2 var(--hi5-font); }
.hi5-card__price del { margin-right: 8px; color: var(--hi5-ink-soft); font-weight: 500; }
.hi5-card__price ins { background: none; text-decoration: none; }
.hi5-card__price--sold { color: var(--hi5-ink-soft); font-weight: 500; }

/* ---------- Pagination and empty state ---------- */
body.hi5-archive .woocommerce-pagination { padding: 24px var(--hi5-pad) 64px; text-align: center; }
body.hi5-archive .woocommerce-pagination ul.page-numbers { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; list-style: none; }
body.hi5-archive .woocommerce-pagination ul li { float: none; margin: 0; padding: 0; border: 0; }
body.hi5-archive .woocommerce-pagination li > .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hi5-line);
  border-radius: var(--hi5-r-pill);
  background: transparent;
  color: var(--hi5-ink);
  font: 700 15px/1 var(--hi5-font);
  text-decoration: none;
}
body.hi5-archive .woocommerce-pagination li > a.page-numbers:hover { border-color: var(--hi5-ink); background: transparent; color: var(--hi5-ink); }
body.hi5-archive .woocommerce-pagination li > .page-numbers.current { border-color: var(--hi5-ink); background: var(--hi5-ink); color: var(--hi5-bg); }
body.hi5-archive .woocommerce-info,
body.hi5-archive .woocommerce-no-products-found .woocommerce-info { margin: 24px var(--hi5-pad) 64px; padding: 28px; border: 1px solid var(--hi5-line); border-radius: var(--hi5-r-sm); background: var(--hi5-surface); color: var(--hi5-ink); font: 500 17px/1.5 var(--hi5-font); text-align: center; }
body.hi5-archive .woocommerce-info::before { display: none; }

/* ---------- Filter panel ---------- */
.hi5-fdrawer {
  position: fixed;
  top: var(--hi5-adminbar);
  left: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  background: var(--hi5-bg);
  color: var(--hi5-ink);
  font-family: var(--hi5-font);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .3s;
}
.hi5-fdrawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.hi5-fdrawer__top { flex: none; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 var(--hi5-pad); border-bottom: 1px solid var(--hi5-line); }
.hi5-fdrawer .hi5-fdrawer__title { margin: 0; color: var(--hi5-ink); font: 800 22px/1.1 var(--hi5-font); }
body.hi5-archive .hi5-fdrawer .hi5-fclose { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 -10px 0 0; padding: 0; border: 0; background: transparent; color: var(--hi5-ink); cursor: pointer; }
body.hi5-archive .hi5-fdrawer .hi5-fclose:hover { background: transparent; color: var(--hi5-accent); }
.hi5-fclose svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.hi5-fform { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.hi5-fscroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--hi5-pad) 24px; }
.hi5-fsec { border-bottom: 1px solid var(--hi5-line); }
.hi5-fsec summary { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; list-style: none; color: var(--hi5-ink); font: 800 15px/1.2 var(--hi5-font); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.hi5-fsec summary::-webkit-details-marker { display: none; }
.hi5-fsec summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.hi5-fsec[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.hi5-fsec__body { padding: 0 0 22px; }

.hi5-fcats, .hi5-fcats ul { margin: 0; padding: 0; list-style: none; }
.hi5-fcats li { margin: 0; padding: 0; }
.hi5-fcats ul { padding-left: 16px; }
.hi5-fcats > ul { padding-left: 0; }
.hi5-fcats a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--hi5-ink); font: 500 16px/1.3 var(--hi5-font); text-decoration: none; }
.hi5-fcats a:hover { color: var(--hi5-ink); text-decoration: underline; text-decoration-color: var(--hi5-accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.hi5-fcats .is-current > a { font-weight: 800; }
.hi5-fcats a small { color: var(--hi5-ink-soft); font: 500 14px/1 var(--hi5-font); }

.hi5-fprice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hi5-fprice label { display: block; }
.hi5-fprice span { display: block; margin-bottom: 6px; color: var(--hi5-ink-soft); font: 600 13px/1 var(--hi5-font); }
body.hi5-archive .hi5-fprice input[type='number'] { width: 100%; height: 46px; margin: 0; padding: 0 14px; border: 1px solid var(--hi5-line); border-radius: var(--hi5-r-sm); background: var(--hi5-bg); color: var(--hi5-ink); font: 500 16px/1 var(--hi5-font); box-shadow: none; }

.hi5-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hi5-chip { position: relative; display: inline-block; margin: 0; }
.hi5-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.hi5-chip span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--hi5-line); border-radius: var(--hi5-r-pill); color: var(--hi5-ink); font: 600 15px/1 var(--hi5-font); }
.hi5-chip input:hover + span { border-color: var(--hi5-ink); }
.hi5-chip input:checked + span { border-color: var(--hi5-ink); background: var(--hi5-ink); color: var(--hi5-bg); }
.hi5-chip input:focus-visible + span { outline: 2px solid var(--hi5-accent); outline-offset: 2px; }

.hi5-fform__foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--hi5-pad); border-top: 1px solid var(--hi5-line); background: var(--hi5-bg); }
.hi5-clear { color: var(--hi5-ink); font: 700 15px/1 var(--hi5-font); text-decoration: underline; text-decoration-color: var(--hi5-accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
body.hi5-archive .hi5-fdrawer .hi5-apply { height: 48px; margin: 0; padding: 0 30px; border: 0; border-radius: var(--hi5-r-pill); background: var(--hi5-ink); color: var(--hi5-bg); font: 800 16px/1 var(--hi5-font); cursor: pointer; }
body.hi5-archive .hi5-fdrawer .hi5-apply:hover { background: var(--hi5-ink-soft); color: var(--hi5-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  body.hi5-archive ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hi5-view { display: none; }
}
@media (max-width: 900px) {
  .hi5-toolbar { grid-template-columns: 1fr auto; }
  .hi5-crumbs { display: none; }
}
@media (max-width: 700px) {
  body.hi5-archive ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  body.hi5-archive ul.products li.hi5-card .hi5-card__media { border-radius: 16px; }
  .hi5-card__badge { top: 10px; left: 10px; }
  .hi5-card__body { padding-top: 10px; }
  body.hi5-archive ul.products li.hi5-card .hi5-card__title, .hi5-card__price { font-size: 15px; }
  .hi5-toolbar { grid-template-columns: 1fr; padding: 0 var(--hi5-pad) 16px; }
  .hi5-toolbar__right { display: none; }
  .hi5-toolbar__left { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--hi5-line); border-radius: 8px; overflow: hidden; }
  body.hi5-archive .hi5-filter-btn { min-width: 0; width: 100%; border: 0; border-radius: 0; font-size: 16px; }
  .hi5-sort { border-left: 1px solid var(--hi5-line); }
  body.hi5-archive .hi5-sort select { width: 100%; border: 0; border-radius: 0; font-size: 16px; }
  .hi5-fdrawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
  .hi5-fdrawer, .hi5-fsec summary::after { transition: none !important; }
}
