/* ============================================================
   FROST LABS — SHOP ARCHIVE STYLESHEET (product archive only)
   Arrangement only — every value is a v1.0 token; product cards,
   tabs, fields, buttons, badges, trust-strip and footer are
   reused from base.css, not redefined here. Loaded only on the
   shop / product category / product search archives.
   ============================================================ */

/* ---- Breadcrumb: shared component, now defined in base.css ---- */

/* ---- Shop hero (compact archive header) ----------------- */
.shop-hero { position: relative; overflow: hidden; padding-top: var(--sp-16); padding-bottom: var(--sp-10); }
/* the single sanctioned subtle glow, very low opacity, behind the title */
.shop-hero::before { content: ''; position: absolute; top: -30%; left: 50%; width: 760px; height: 760px; transform: translateX(-50%); background: radial-gradient(circle, var(--accent-dim) 0%, transparent 60%); opacity: .5; pointer-events: none; }
.shop-hero__inner { position: relative; max-width: 600px; }
.shop-hero__kicker { display: block; margin-bottom: var(--sp-3); }
.shop-hero__title { color: var(--text-primary); }
.shop-hero__intro { margin-top: var(--sp-4); }
.shop-hero__count { display: block; margin-top: var(--sp-5); font-size: 13px; color: var(--text-muted); }

/* ---- Toolbar (sticky discovery bar) --------------------- */
.shop-toolbar {
  position: sticky; top: var(--nav-h); z-index: 40;          /* below --z-nav (50) */
  background: var(--bg-base); padding-block: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--dur-base) var(--ease-out);
}
.shop-toolbar.is-stuck {                                      /* mirrors the navbar's stuck blur */
  background: rgba(12,12,14,0.85);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.shop-toolbar__sentinel { position: absolute; top: -1px; height: 1px; width: 1px; }

/* Category tabs: reuse .tabs/.tab, made horizontally scrollable on small screens */
.shop-cats { overflow-x: auto; margin-bottom: var(--sp-4); scrollbar-width: none; }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cats .tabs { margin-bottom: 0; }
.tab[aria-current="page"] { background: var(--bg-overlay); color: var(--text-primary); }  /* link-tab active state */

.shop-toolbar__bar { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.shop-search { position: relative; flex: 1; min-width: 220px; }
.shop-search .field { padding-left: 40px; }
.shop-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.shop-toolbar__meta { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.shop-count { color: var(--text-muted); white-space: nowrap; }

/* Select control (sort) — built on .field tokens; v1.0 chevron mask */
.field-select { position: relative; }
.field-select select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 38px 10px 14px; background: var(--bg-elevated);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-primary); font: inherit; font-size: 14px; cursor: pointer;
  outline: none; transition: border-color var(--dur-fast);
}
.field-select select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field-select::after {
  content: ''; position: absolute; right: 13px; top: 50%; width: 12px; height: 12px;
  transform: translateY(-50%); pointer-events: none; background-color: var(--text-secondary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 12px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---- Active-filter chips -------------------------------- */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.filter-chips:empty { display: none; }
.filter-chips:not(:empty) { padding-top: var(--sp-5); }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--accent-dim); color: var(--accent); border: none;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background-color var(--dur-fast);
}
.filter-chip:hover { background: var(--accent-glow); }
.filter-chip svg { width: 12px; height: 12px; }
.filter-chips__clear { font-size: 12px; }

/* ---- Filter panel / drawer ------------------------------ */
/* Base = inline panel (no-JS usable). .js upgrades to a slide-over drawer. */
.shop-filters { margin-top: var(--sp-5); }
.shop-filters__overlay { display: none; }
.shop-filters__panel {
  display: flex; flex-direction: column; gap: var(--sp-6);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--sp-6);
}
.shop-filters__head { display: flex; align-items: center; justify-content: space-between; }
.filter-group { border: none; display: flex; flex-direction: column; gap: var(--sp-3); }
.filter-group__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.filter-price { display: flex; align-items: center; gap: var(--sp-2); }
.filter-price .field { width: 100%; }
.filter-check { display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.filter-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.shop-filters__actions { margin-top: auto; display: flex; align-items: center; gap: var(--sp-2); }

/* JS drawer behavior */
.js .shop-filters { position: fixed; inset: 0; z-index: var(--z-drawer); margin: 0; visibility: hidden; }
.js .shop-filters.is-open { visibility: visible; }
.js .shop-filters__overlay { display: block; position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.js .shop-filters.is-open .shop-filters__overlay { opacity: 1; }
.js .shop-filters__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(360px, 86vw);
  border: none; border-left: 1px solid var(--border-subtle); border-radius: 0;
  overflow-y: auto; transform: translateX(100%); transition: transform var(--dur-base) var(--ease-out);
}
.js .shop-filters.is-open .shop-filters__panel { transform: none; }

/* ---- Loading skeleton (matches card footprint → no CLS) -- */
.skeleton-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.skeleton-card__media { aspect-ratio: 1; background: var(--bg-elevated); }
.skeleton-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.skeleton-line { height: 12px; border-radius: var(--radius-sm); background: var(--bg-elevated); }
.skeleton-line--sm { width: 40%; }
.skeleton-line--lg { width: 80%; }
.skeleton { position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  animation: frost-shimmer 1.4s infinite;
}
@keyframes frost-shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; display: none; } }

/* ---- Empty state ---------------------------------------- */
.shop-empty { text-align: center; max-width: 480px; margin-inline: auto; padding-block: var(--sp-20); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.shop-empty[hidden] { display: none; }
.shop-empty svg { color: var(--text-muted); }
.shop-empty h2 { color: var(--text-primary); }
.shop-empty__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-3); }

/* ---- Pagination ----------------------------------------- */
.shop-pagination { margin-top: var(--sp-10); }
.shop-end { text-align: center; color: var(--text-muted); margin-top: var(--sp-4); }
.shop-pages ul { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.shop-pages a, .shop-pages span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-secondary);
  font-size: 14px; transition: border-color var(--dur-fast), color var(--dur-fast);
}
.shop-pages a:hover { border-color: var(--accent); color: var(--accent); }
.shop-pages .current { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.shop-loadmore.is-loading { opacity: 0.6; pointer-events: none; }

/* ---- Newsletter band ------------------------------------ */
.newsletter__inner { max-width: 560px; margin-inline: auto; text-align: center; }
.newsletter__inner h2 { color: var(--text-primary); margin-top: var(--sp-2); }
.newsletter__form { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.newsletter__form .field { flex: 1; }
.newsletter__status { margin-top: var(--sp-3); font-size: 13px; color: var(--success); }
.newsletter__status[data-error] { color: var(--danger); }
.newsletter__note { margin-top: var(--sp-3); color: var(--text-muted); }

/* ---- Educational section (learn-before-you-buy cards) --- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.edu-card { position: relative; display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--sp-6); transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.edu-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.edu-card__icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: var(--sp-4); }
.edu-card__title { color: var(--text-primary); margin-bottom: var(--sp-2); }
.edu-card__link { margin-top: auto; padding-top: var(--sp-4); font-size: 13px; font-weight: 600; color: var(--accent); }
.edu-card__link::after { content: ''; position: absolute; inset: 0; }

/* ---- Shop responsive (inherits homepage grid breakpoints) */
@media (max-width: 900px) {
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .shop-toolbar__bar { gap: var(--sp-3); }
  .shop-toolbar__meta { width: 100%; justify-content: space-between; }
  .shop-count { order: -1; flex-basis: 100%; }
  .newsletter__form { flex-direction: column; }
  .edu-grid { grid-template-columns: 1fr; }
}
