/* ==========================================================================
   WS Theme — shop.css
   The /parduotuve catalog: filter sidebar (desktop) / off-canvas drawer
   (mobile), product grid, toolbar, load-more, and the header live-search
   dropdown. Enqueued on product archives + wherever the header search lives.

   Mobile-first, plain CSS. Every colour / spacing value references a design
   token from main.css / project-overrides.css. The product CARD itself is
   styled in woocommerce.css (shared with the homepage); this file only owns
   the catalog chrome around it. Transition durations match the rest of the
   site (0.2s colour, 0.25s lift, 0.3s drawer/header, 0.4s reveal).

   Contents:
     1. Shop header
     2. Layout (sidebar + results)
     3. Toolbar (count + sort)
     4. Product grid + reveal
     5. Filter controls
     6. Mobile drawer + backdrop
     7. Load more + spinner + loading state
     8. Root shop SEO content
     9. Live-search dropdown
    10. Reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Shop header
   -------------------------------------------------------------------------- */
.shop {
  padding-block: var(--spacing-xl);
}

/* Give the catalog more room on wide viewports than the default container.
   Below 1400px this is a no-op (container just fills the width); the sidebar
   (260px) and 3-column grid are unchanged. */
.shop .container {
  max-width: 1400px;
}

.shop__header {
  margin-bottom: var(--spacing-lg);
}

/* Breadcrumb trail: small muted meta text above the title, same register as
   the product-card category label. The current page is unlinked. */
.shop__breadcrumb {
  margin-bottom: var(--spacing-sm);
}

.shop__breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.shop__breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.shop__breadcrumb-item + .shop__breadcrumb-item::before {
  content: "›";
  margin-inline: var(--spacing-xs);
}

.shop__breadcrumb a {
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.shop__breadcrumb a:hover,
.shop__breadcrumb a:focus-visible {
  color: var(--color-accent-text);
}

.shop__breadcrumb [aria-current='page'] {
  color: var(--color-text);
}

.shop__title {
  font-size: clamp(1.8rem, 5vw, 2.75rem);
}

.shop__kicker {
  margin: 0 0 var(--spacing-xs);
  color: var(--color-accent-text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shop__intro {
  margin-top: var(--spacing-sm);
  max-width: 48rem;
  color: var(--color-text-muted);
}

.shop__intro--root {
  line-height: 1.7;
}

.shop__content {
  margin-top: var(--spacing-sm);
  max-width: 48rem;
  color: var(--color-text-muted);
}

/* main.js applies the clamp only after the shared disclosure is ready. With
   JavaScript unavailable, the full server-rendered description stays visible. */
.shop__intro.is-disclosure-ready:not(.is-expanded) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Text-link style toggle, same register as .pl-account-card__link. Starts
   [hidden]; main.js reveals it only when the clamp actually hides content. */
.shop__intro-toggle {
  margin-top: var(--spacing-xs);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.shop__intro-toggle:hover,
.shop__intro-toggle:focus-visible {
  color: var(--color-accent-text);
}

/* --------------------------------------------------------------------------
   2. Layout
   Mobile: single column (sidebar is an off-canvas drawer, section 6).
   Desktop (>=992px): fixed-width sidebar + fluid results column.
   -------------------------------------------------------------------------- */
.shop__layout {
  position: relative;
}

@media (min-width: 992px) {
  .shop__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
  }

  .shop__layout--wide {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   3. Toolbar
   -------------------------------------------------------------------------- */
.shop__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.shop__count {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.shop__sort {
  position: relative;
  display: inline-flex;
}

/* Native select, re-skinned to the dark theme with a custom caret. */
.shop__sort-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 calc(var(--spacing-lg) + var(--spacing-sm)) 0 var(--spacing-md);
  color: var(--color-text);
  background-color: var(--color-bg-surface);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  /* Custom chevron (design-system §04) as an inline-SVG background. Stroke is
     #949494; keep in sync with --color-text-muted because data URIs can't read
     CSS variables. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23949494' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 14px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.shop__sort-select:hover {
  border-color: var(--color-accent);
}

.shop__sort-select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.14);
}

.shop__active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.shop__active-filters[hidden] {
  display: none;
}

.shop__filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.shop__filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 44px;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.shop__filter-chip:hover,
.shop__filter-chip:focus-visible {
  border-color: var(--color-accent);
}

.shop__filter-clear {
  min-height: 44px;
  padding: var(--spacing-xs);
  color: var(--color-accent-text);
  font-size: 0.875rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Product grid + reveal
   2 columns on mobile, 3 from 992px (sidebar present). The card visuals come
   from woocommerce.css; here we only place items in the grid.
   AJAX-inserted items animate in via the .is-enter / .is-enter-active classes
   (added by shop-filters.js). Server-rendered items show immediately so
   content is never hidden without JS.
   -------------------------------------------------------------------------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin: 0;
  padding: 0;
  transition: opacity 0.25s ease;
}

.shop-grid__item {
  display: flex;
}

.shop-grid__item > .product-card {
  width: 100%;
}

/* Enter animation for freshly inserted cards. */
.shop-grid__item.is-enter {
  opacity: 0;
  transform: translateY(15px);
}

.shop-grid__item.is-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.shop__empty {
  margin: var(--spacing-lg) 0;
  color: var(--color-text-muted);
  text-align: center;
}

@media (min-width: 992px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* The sale archive has no 260px filter rail, so use the extra width for a
     fourth track instead of stretching three portrait cards. */
  .shop--sale .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   5. Filter controls
   -------------------------------------------------------------------------- */
.shop-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.shop-filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.shop-filters__heading {
  font-size: 1.1rem;
}

.shop-filters__clear {
  padding: 0;
  color: var(--color-accent-text);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.shop-filters__clear:hover,
.shop-filters__clear:focus-visible {
  color: var(--color-accent-text);
}

.shop-filters__clear.is-hidden {
  display: none;
}

/* One rounded panel wrapping every filter group. */
.shop-filters__panel {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Each group: padded, divided from the next by a soft hairline. */
.shop-filter {
  margin: 0;
  padding: var(--spacing-md);
  border: 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.shop-filter:last-of-type {
  border-bottom: 0;
}

/* The AJAX-swapped attribute region ([data-shop-attrs]) wraps its fieldsets in
   a div, so they get their own :last-of-type context — keep the standard block
   separator there (the on-sale toggle still follows this wrapper). */
.shop-filters__attrs .shop-filter:last-of-type {
  border-bottom: 1px solid var(--color-border-soft);
}

/* Hint shown in place of the attribute groups until a category is picked
   (see template-parts/shop/filters-attributes.php). */
.shop-filter__hint {
  margin: 0;
  padding: var(--spacing-md);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-soft);
}

.shop-filter__legend {
  margin-bottom: var(--spacing-sm);
  padding: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.shop-filter__options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Whole row is the target; it highlights on hover (not just the box). */
.shop-filter__option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 calc(var(--spacing-xs) * -1);
  padding: var(--spacing-xs);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-muted);
  transition:
    background-color 0.15s ease,
    color 0.2s ease;
}

.shop-filter__option:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.035);
}

.shop-filter__option.is-disabled,
.shop-filter__option:has(input:disabled) {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.shop-filter__option.is-disabled:hover,
.shop-filter__option:has(input:disabled):hover {
  background-color: transparent;
}

.shop-filter__option--child {
  padding-left: var(--spacing-md);
  font-size: 0.9375rem;
}

/* Custom checkbox: the real <input>, restyled via appearance:none so it stays
   keyboard-operable and announced as a checkbox. Checkmark is a rotated border
   on ::before that scales in. */
.shop-filter__checkbox {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  background-color: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: 5px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.shop-filter__checkbox::before {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -1px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s ease;
}

.shop-filter__checkbox:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.35);
}

.shop-filter__checkbox:checked::before {
  transform: rotate(45deg) scale(1);
}

.shop-filter__checkbox:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.2);
}

.shop-filter__name {
  flex: 1 1 auto;
  font-size: 0.875rem;
}

.shop-filter__option:has(.shop-filter__checkbox:checked) .shop-filter__name {
  color: var(--color-text);
  font-weight: 500;
}

/* Count: a small pill. */
.shop-filter__count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 2px 8px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--color-text-muted);
  background-color: var(--color-bg-card);
  border-radius: 20px;
}

/* Price range: two inputs with an inset € + an icon apply button. */
.shop-filter__price {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.shop-filter__price-field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.shop-filter__price-input {
  width: 100%;
  padding: 11px 24px 11px 12px;
  color: var(--color-text);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  /* Drop the native number spinner. */
  appearance: textfield;
  -moz-appearance: textfield;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.shop-filter__price-input::-webkit-outer-spin-button,
.shop-filter__price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-filter__price-input:focus,
.shop-filter__price-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.14);
}

.shop-filter__price-eur {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.shop-filter__price-sep {
  flex: 0 0 auto;
  width: 10px;
  height: 1px;
  background-color: var(--color-border);
}

/* Compact icon button (not a WC .button, so no cascade conflict). */
.shop-filter__price-apply {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background-color: var(--color-accent);
  border-radius: var(--radius-md);
  transition:
    background-color 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}

.shop-filter__price-apply:hover,
.shop-filter__price-apply:focus-visible {
  background-color: var(--color-accent-hover);
  box-shadow: 0 0 16px rgba(255, 26, 26, 0.4);
}

.shop-filter__price-apply:active {
  transform: scale(0.93);
}

/* "Tik su nuolaida": name on the left, toggle switch on the right. */
.shop-filter__option--switch {
  justify-content: space-between;
  color: var(--color-text);
  font-weight: 500;
}

/* Toggle switch — a real role="switch" checkbox, restyled. The native checked
   state maps to the switch for assistive tech, so no JS sync is needed. */
.shop-filter__switch {
  flex: 0 0 auto;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  margin: 0;
  background-color: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.shop-filter__switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
  transition:
    transform 0.22s ease,
    background-color 0.2s ease;
}

.shop-filter__switch:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.35);
}

.shop-filter__switch:checked::before {
  transform: translateX(16px);
  background-color: #fff;
}

.shop-filter__switch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   6. Mobile drawer + backdrop
   The filter toggle + drawer chrome show below 992px; from 992px the sidebar
   is a static rail and the drawer affordances disappear.
   -------------------------------------------------------------------------- */
.shop__filter-toggle {
  display: inline-block;
  margin-bottom: var(--spacing-lg);
}

.shop__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.shop__drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.shop__drawer-close {
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.shop__sheet-footer {
  display: none;
}

.shop__drawer-close:hover,
.shop__drawer-close:focus-visible {
  color: var(--color-accent-text);
}

.shop__backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 991px) {
  body.is-shop-filter-open {
    overflow: hidden;
  }

  /* Bottom sheet: only its content scrolls; heading and CTA stay visible. */
  .shop__sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 310;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(85dvh, 760px);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.24s ease-out;
    overflow: hidden;
  }

  .shop__sidebar-inner {
    min-height: 0;
    overflow-y: auto;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  }

  .shop__drawer-head {
    position: sticky;
    top: calc(var(--spacing-md) * -1);
    z-index: 1;
    margin: calc(var(--spacing-md) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border-soft);
  }

  .shop-filters__head {
    justify-content: flex-end;
  }

  .shop-filters__heading {
    display: none;
  }

  .shop-filter__option {
    min-height: 44px;
  }

  .shop__sheet-footer {
    display: block;
    flex: 0 0 auto;
    padding: var(--spacing-md) var(--spacing-lg) calc(var(--spacing-md) + env(safe-area-inset-bottom));
    background-color: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
  }

  .shop__sheet-results {
    width: 100%;
    min-height: 48px;
  }

  .shop__layout.is-filter-open .shop__sidebar {
    transform: translateX(0);
  }

  .shop__layout.is-filter-open .shop__backdrop {
    opacity: 1;
  }
}

/* Desktop: static sticky rail, hide the drawer-only chrome. */
@media (min-width: 992px) {
  /* !important so WC core's `.woocommerce button.button` (0,2,1) can't keep the
     mobile-only filter toggle visible on desktop — a visible toggle steals the
     first grid cell and collapses the sidebar/grid two-column layout. */
  .shop__filter-toggle,
  .shop__drawer-head,
  .shop__sheet-footer,
  .shop__backdrop {
    display: none !important;
  }

  .shop__sidebar {
    position: sticky;
    /* Clear the sticky header (compact height) so the panel top isn't hidden
       behind it on scroll. The header keeps its own z-index, so no overlap. */
    top: calc(var(--header-height) + var(--spacing-md));
  }
}

/* --------------------------------------------------------------------------
   7. Load more + spinner + loading state
   -------------------------------------------------------------------------- */
.shop__loadmore-wrap {
  margin-top: var(--spacing-xl);
  text-align: center;
}

.shop__loadmore {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

/* Primary-button treatment: accent glow + slight lift on hover (WC core sets
   the accent fill; these add the glow/lift it doesn't). */
.shop__loadmore:hover,
.shop__loadmore:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 26, 26, 0.4);
}

.shop__loadmore:active {
  transform: scale(0.98);
}

/* `hidden` must always hide, even though these buttons carry WooCommerce's
   `.button` class — WC core's `.woocommerce button.button` rule (specificity
   0,2,1) otherwise out-ranks the attribute selector and forces them visible. */
.shop__loadmore[hidden] {
  display: none !important;
}

/* Shared spinner ring (load-more button + grid loading overlay). */
.shop__spinner {
  display: none;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ws-spin 0.7s linear infinite;
}

.shop__loadmore.is-loading .shop__spinner {
  display: inline-block;
}

@keyframes ws-spin {
  to {
    transform: rotate(360deg);
  }
}

/* While a filter/sort request is in flight, dim the grid and show a centered
   accent spinner over the results column. */
.shop__main {
  position: relative;
}

.shop-grid.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

.shop__main.is-loading::after {
  content: "";
  position: absolute;
  top: 8rem;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: -1.25rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: ws-spin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   8. Root shop SEO content
   -------------------------------------------------------------------------- */
.shop-seo {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border);
}

.shop-seo__inner {
  max-width: 48rem;
  margin-inline: auto;
}

.shop-seo__title {
  margin: 0 0 var(--spacing-md);
  font-size: clamp(1.5rem, 4vw, 2.125rem);
}

.shop-seo__intro,
.shop-seo__details {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.shop-seo__intro p,
.shop-seo__details p {
  margin: 0 0 var(--spacing-md);
}

.shop-seo__intro p:last-child,
.shop-seo__details p:last-of-type {
  margin-bottom: 0;
}

.shop-seo__details h3 {
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: var(--color-text);
  font-size: 1.25rem;
}

.shop-seo__details a:not(.button) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.shop-seo__cta {
  margin-top: var(--spacing-lg);
}

.shop-seo__toggle {
  margin-top: var(--spacing-md);
}

@media (max-width: 767px) {
  .shop-seo {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
  }
}

/* --------------------------------------------------------------------------
   9. Header search field + live-search dropdown
   The field (searchform.php) carries the magnifier inside it, a faint hex
   texture echo behind it, and an accent glow on focus. The dropdown sits in
   the revealed #header-search panel, directly below the field.
   -------------------------------------------------------------------------- */
.ws-search {
  position: relative;
}

/* Faint hexagon-motif echo behind the field (matches the hero/category grid). */
.ws-search__hex {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(60deg, transparent, transparent 11px, var(--color-accent) 11px, var(--color-accent) 12px),
    repeating-linear-gradient(-60deg, transparent, transparent 11px, var(--color-accent) 11px, var(--color-accent) 12px);
  background-size: 24px 42px;
  border-radius: 14px;
  pointer-events: none;
}

.ws-search__field {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 13px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.ws-search__field:focus-within {
  border-color: var(--color-accent);
  box-shadow:
    0 0 0 4px rgba(204, 0, 0, 0.14),
    0 0 24px rgba(204, 0, 0, 0.12);
}

.ws-search__icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.ws-search__field:focus-within .ws-search__icon {
  color: var(--color-accent-text);
}

.ws-search__input {
  flex: 1;
  min-width: 0;
  color: var(--color-text);
  font-size: 1rem;
  background: none;
  border: none;
  outline: none;
}

.ws-search__input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.ws-search__input::-webkit-search-decoration,
.ws-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.ws-search__kbd {
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 5px;
}

.live-search {
  margin-top: var(--spacing-sm);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.live-search[hidden] {
  display: none;
}

.live-search__results {
  margin: 0;
  padding: 0;
  max-height: min(60vh, 26rem);
  overflow-y: auto;
}

.live-search__item {
  border-bottom: 1px solid var(--color-border);
}

.live-search__item:last-child {
  border-bottom: 0;
}

.live-search__link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  transition: background-color 0.2s ease;
}

/* Hover + keyboard-active (aria-selected) share the same highlight. */
.live-search__link:hover,
.live-search__item.is-active .live-search__link {
  background-color: var(--color-bg-surface);
}

.live-search__thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.live-search__thumb img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: calc(var(--radius) / 2);
}

.live-search__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-search__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-search__price {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.live-search__price del {
  margin-right: var(--spacing-xs);
}

.live-search__price ins {
  text-decoration: none;
}

.live-search__empty {
  margin: 0;
  padding: var(--spacing-md);
  color: var(--color-text-muted);
}

.live-search__empty[hidden],
.live-search__all[hidden] {
  display: none;
}

.live-search__empty-hint {
  display: block;
  font-size: 0.85rem;
}

.live-search__all {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-accent-text);
  font-weight: 600;
  text-align: center;
  background-color: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  transition: color 0.2s ease;
}

.live-search__all:hover,
.live-search__all:focus-visible {
  color: var(--color-accent-text);
}

/* --------------------------------------------------------------------------
   10. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .shop-grid,
  .shop__sidebar,
  .shop__backdrop,
  .shop-grid__item.is-enter-active,
  .shop-filter__option,
  .shop-filter__checkbox,
  .shop-filter__checkbox::before,
  .shop-filter__switch,
  .shop-filter__switch::before,
  .shop-filter__price-input,
  .shop-filter__price-apply,
  .shop__sort-select,
  .shop__intro-toggle,
  .ws-search__field,
  .ws-search__icon,
  .shop__loadmore {
    transition: none;
  }

  .shop-grid__item.is-enter {
    opacity: 1;
    transform: none;
  }

  /* No decorative lift/scale on hover or press (checkbox/switch state still
     shows — just without easing). */
  .shop__loadmore:hover,
  .shop__loadmore:focus-visible,
  .shop__loadmore:active,
  .shop-filter__price-apply:active {
    transform: none;
  }

  .shop__spinner,
  .shop__main.is-loading::after {
    animation-duration: 1.4s;
  }
}
