/* NovaShop · filtros de colección y buscador con sugerencias (usa las variables del tema) */
:root { --ns-ink: var(--text, var(--ink, #1a1a1a)); --ns-bg: var(--bg, var(--surface, #fff)); --ns-focus: var(--accent, var(--primary, #1a1a1a)); }
.ns-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Listado con filtros ---------- */
.ns-coll.has-filters.is-sidebar { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 40px; align-items: start; }
.ns-coll-main { min-width: 0; }
.ns-coll.has-filters.is-sidebar .grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-coll[aria-busy="true"] .ns-coll-main { opacity: .55; transition: opacity .15s; pointer-events: none; }

.ns-f-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.ns-f-count { color: var(--ns-muted); font-size: .92em; margin-right: auto; }
.ns-f-sort select { height: 40px; border: 1px solid var(--ns-line); border-radius: var(--ns-r); padding: 0 34px 0 12px; font: inherit; font-size: .92em; background: var(--ns-bg); color: inherit; }
.ns-f-open { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--ns-line); border-radius: var(--ns-r); background: var(--ns-bg); color: inherit; font: inherit; font-size: .92em; cursor: pointer; }
.ns-f-open.is-always { display: inline-flex; }
.ns-f-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ns-ink); color: var(--ns-bg); font-size: 12px; line-height: 20px; text-align: center; }
.ns-f-chips { list-style: none; margin: -6px 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ns-f-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ns-soft); color: inherit; text-decoration: none; font-size: .88em; }
.ns-f-chips a:hover { background: var(--ns-line); }
.ns-f-chips .ns-f-clear { background: none; text-decoration: underline; text-underline-offset: 3px; padding-left: 4px; }

.ns-f-panel { font-size: .94em; }
.ns-f-head { display: none; }
.ns-f-group { border-bottom: 1px solid var(--ns-line); }
.ns-f-group:first-child { border-top: 1px solid var(--ns-line); }
.ns-f-group summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.ns-f-group summary::-webkit-details-marker { display: none; }
.ns-f-group summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.ns-f-group[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.ns-f-values { border: 0; margin: 0; padding: 0 0 14px; display: grid; gap: 2px; }
.ns-f-opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; min-height: 34px; cursor: pointer; }
.ns-f-opt input { width: 20px; height: 20px; margin: 2px; accent-color: var(--ns-ink); flex: none; }
.ns-f-label { flex: 1; }
.ns-f-n { color: var(--ns-muted); font-size: .86em; font-variant-numeric: tabular-nums; }
.ns-f-opt.is-empty { opacity: .45; cursor: default; }
.ns-f-opt.is-extra { display: none; }
.ns-f-values.is-open .ns-f-opt.is-extra { display: flex; }
.ns-f-more { justify-self: start; background: none; border: 0; padding: 6px 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ns-f-sw { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); flex: none; }
/* Muestras de color: la casilla queda oculta y el círculo hace de casilla */
.ns-f-values.is-swatches .ns-f-opt input { position: absolute; opacity: 0; }
.ns-f-values.is-swatches .ns-f-opt:has(input:checked) .ns-f-sw { box-shadow: 0 0 0 2px var(--ns-bg), 0 0 0 3.5px var(--ns-ink); }
.ns-f-values.is-swatches .ns-f-opt:has(input:checked) .ns-f-label { font-weight: 600; }
.ns-f-values.is-swatches .ns-f-opt:has(input:focus-visible) .ns-f-sw { outline: 2px solid var(--ns-focus); outline-offset: 3px; }
.ns-f-values.is-swatches .ns-f-opt:not(:has(.ns-f-sw)) .ns-f-label::before { content: ""; display: inline-block; width: 15px; height: 15px; margin-right: 10px; vertical-align: -2px; border: 1px solid var(--ns-line); border-radius: 3px; }
.ns-f-values.is-swatches .ns-f-opt:not(:has(.ns-f-sw)):has(input:checked) .ns-f-label::before { background: var(--ns-ink); box-shadow: inset 0 0 0 3px var(--ns-bg); }
.ns-f-price { display: flex; align-items: flex-end; gap: 8px; padding: 0 0 16px; }
.ns-f-price label { display: grid; gap: 4px; flex: 1; font-size: .85em; color: var(--ns-muted); }
.ns-f-price input { width: 100%; height: 38px; border: 1px solid var(--ns-line); border-radius: var(--ns-r); padding: 0 10px; font: inherit; color: var(--ns-ink); background: var(--ns-bg); }
.ns-f-price > span { padding-bottom: 9px; color: var(--ns-muted); }
.ns-f-cur { padding-bottom: 9px; color: var(--ns-muted); }
.ns-f-toggle { padding: 0 0 14px; }
.ns-f-actions { display: none; }
.ns-corrected { margin: 0 0 18px; color: var(--ns-muted); }

/* Cajón (móvil o diseño «cajón») */
@media (max-width: 899px) {
  .ns-coll.has-filters.is-sidebar { display: block; }
  .ns-coll.has-filters.is-sidebar .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-f-open { display: inline-flex; }
  .ns-f-count { order: 3; width: 100%; margin: 0; }
}
@media (max-width: 899px) { .ns-coll.has-filters .ns-f-panel { position: fixed; z-index: 1000; inset: 0 auto 0 0; width: min(380px, 88vw); background: var(--ns-bg); color: var(--ns-ink); padding: 0 20px; overflow-y: auto; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .18); display: flex; flex-direction: column; } }
.ns-coll.has-filters.is-drawer .ns-f-panel { position: fixed; z-index: 1000; inset: 0 auto 0 0; width: min(380px, 88vw); background: var(--ns-bg); color: var(--ns-ink); padding: 0 20px; overflow-y: auto; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
body.ns-f-is-open .ns-coll.has-filters .ns-f-panel { transform: none; }
@media (max-width: 899px) {
  .ns-coll.has-filters .ns-f-head, .ns-coll.has-filters .ns-f-actions { display: flex; }
}
.ns-coll.has-filters.is-drawer .ns-f-head, .ns-coll.has-filters.is-drawer .ns-f-actions { display: flex; }
.ns-f-head { justify-content: space-between; align-items: center; padding: 16px 0; position: sticky; top: 0; background: var(--ns-bg); z-index: 1; }
.ns-f-head h2 { font-size: 1.15em; margin: 0; }
.ns-f-close { width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: inherit; }
.ns-f-actions { position: sticky; bottom: 0; background: var(--ns-bg); padding: 16px 0 20px; margin-top: auto; flex-direction: column; gap: 10px; align-items: center; border-top: 1px solid var(--ns-line); }
.ns-f-apply { width: 100%; }
.ns-f-actions .ns-f-clear { color: inherit; font-size: .9em; }
.ns-f-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .4); }
body.ns-f-is-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .ns-f-panel { transition: none !important; } }

/* ---------- Sugerencias del buscador ---------- */
.ns-sg-wrap { position: relative; }
.ns-sg { position: absolute; z-index: 1001; top: calc(100% + 6px); right: 0; width: min(440px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--ns-bg); color: var(--ns-ink); border: 1px solid var(--ns-line); border-radius: calc(var(--ns-r) + 2px); box-shadow: 0 18px 50px rgba(0, 0, 0, .14); padding: 8px 0; text-align: left; font-size: 14px; }
.ns-sg.is-left { left: 0; right: auto; }
.ns-sg[hidden] { display: none; }
.ns-sg-title { padding: 10px 16px 4px; font-size: 12px; color: var(--ns-muted); }
.ns-sg-list { list-style: none; margin: 0; padding: 0; }
.ns-sg-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: inherit; text-decoration: none; cursor: pointer; }
.ns-sg-item[aria-selected="true"], .ns-sg-item:hover { background: var(--ns-soft); }
.ns-sg-item img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: var(--ns-soft); flex: none; }
.ns-sg-name { flex: 1; min-width: 0; }
.ns-sg-name mark { background: none; color: inherit; font-weight: 700; }
.ns-sg-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-sg-price s { color: var(--ns-muted); margin-right: 4px; font-size: .9em; }
.ns-sg-out { color: var(--ns-muted); font-size: 12px; display: block; }
.ns-sg-all { display: block; margin: 6px 16px 6px; padding: 10px 12px; text-align: center; border-radius: var(--ns-r); background: var(--ns-soft); color: inherit; text-decoration: none; font-weight: 600; }
.ns-sg-all[aria-selected="true"], .ns-sg-all:hover { background: var(--ns-line); }
.ns-sg-empty, .ns-sg-note { padding: 12px 16px; color: var(--ns-muted); }
