/* ═══════════════════════════════════════════
   Tema v4 (Comercial) — Tienda y listado filtrado
   Prefijo: v4s-  · Barra de precio: v4-range
═══════════════════════════════════════════ */

.v4s-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.v4s-crumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 13px;
  color: var(--v4-muted);
}

.v4-main .v4s-crumbs a {
  color: var(--v4-muted);
  text-decoration: none;
}

.v4-main .v4s-crumbs a:hover {
  color: var(--v4-ink);
}

.v4s-crumbs [aria-current] {
  color: var(--v4-ink);
  font-weight: 600;
}

.v4s-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 24px;
}

.v4s-title {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.v4s-count {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--v4-muted);
}

.v4s-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.v4s-sort select,
.v4s-mbar-sort select {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
  font-weight: 500;
  color: var(--v4-ink);
  cursor: pointer;
}

.v4s-mbar {
  display: none;
}

.v4s-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

/* ── Filtros (computadora: columna fija al costado) ── */
.v4s-filters {
  flex: 0 0 260px;
  position: sticky;
  top: 140px;
}

.v4s-filters-backdrop,
.v4s-filters-top {
  display: none;
}

.v4s-filters-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.v4s-filters-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.v4s-group-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.v4s-cats {
  display: flex;
  flex-direction: column;
}

.v4s-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--v4-ink);
  text-decoration: none;
}

.v4s-cat:hover {
  background: var(--v4-soft);
}

.v4s-cat-count {
  color: var(--v4-muted);
}

.v4s-cat.is-active {
  background: var(--v4-ink);
  color: #ffffff;
  font-weight: 700;
}

.v4s-cat.is-active .v4s-cat-count {
  color: #d1d5db;
}

.v4s-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 14px;
  cursor: pointer;
}

.v4s-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--v4-sale);
}

.v4s-filters-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.v4s-filters-actions .v4-btn {
  height: 46px;
  padding: 0 12px;
}

/* ── Barra de rango de precio ── */
.v4-range-values {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
}

.v4-range-values span {
  padding: 6px 10px;
  border: 1.5px solid var(--v4-line);
  border-radius: 8px;
  min-width: 72px;
  text-align: center;
}

.v4-range-track {
  position: relative;
  height: 28px;
}

.v4-range-track::before,
.v4-range-fill {
  content: "";
  position: absolute;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
}

.v4-range-track::before {
  left: 0;
  right: 0;
  background: var(--v4-line);
}

.v4-range-fill {
  left: 0;
  right: 0;
  background: var(--v4-ink);
}

.v4-range-track input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
}

.v4-range-track input[type="range"]::-webkit-slider-runnable-track {
  background: none;
  height: 28px;
}

.v4-range-track input[type="range"]::-moz-range-track {
  background: none;
}

.v4-range-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--v4-ink);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.2);
  cursor: grab;
}

.v4-range-track input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--v4-ink);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.2);
  cursor: grab;
}

.v4-range-track input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 3px solid color-mix(in srgb, var(--v4-accent) 45%, transparent);
  outline-offset: 2px;
}

/* ── Listado ── */
.v4s-list {
  flex: 1;
  min-width: 0;
}

.v4s-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.v4s-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.v4s-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: var(--v4-soft);
  color: var(--v4-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.v4s-chip:hover {
  border-color: var(--v4-ink);
}

.v4s-chip-clear {
  font-size: 13px;
  font-weight: 600;
  color: var(--v4-muted);
  text-decoration: underline;
}

.v4-empty .v4-btn {
  margin-top: 8px;
}

.v4s-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.v4s-page {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--v4-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--v4-ink);
  text-decoration: none;
}

.v4s-page:hover {
  border-color: var(--v4-ink);
}

.v4s-page.is-active {
  background: var(--v4-ink);
  border-color: var(--v4-ink);
  color: #ffffff;
}

/* ── Celular: hoja de filtros ── */
@media (max-width: 1023px) {
  .v4s-crumbs {
    padding: 14px 4px 0;
    font-size: 12px;
  }

  .v4s-head {
    margin: 8px 4px 6px;
  }

  .v4s-title {
    font-size: 26px;
  }

  .v4s-count {
    margin-top: 2px;
    font-size: 14px;
  }

  .v4s-sort {
    display: none;
  }

  .v4s-mbar {
    position: sticky;
    top: 104px; /* debajo del encabezado fijo (barra + buscador) */
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 -12px 12px;
    padding: 8px 12px 10px;
    background: #ffffff;
  }

  .v4s-mbar-btn {
    height: 46px;
    border-radius: 12px;
    border: 1.5px solid var(--v4-ink);
    background: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--v4-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
  }

  .v4s-mbar-count {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--v4-ink);
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .v4s-mbar-sort select {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
  }

  .v4s-layout {
    display: block;
  }

  .v4s-filters {
    position: fixed;
    inset: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    visibility: hidden;
    pointer-events: none;
  }

  .v4s-filters.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  .v4s-filters-backdrop {
    display: block;
    flex: 1;
    border: 0;
    background: rgba(17, 24, 39, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
  }

  .v4s-filters.is-open .v4s-filters-backdrop {
    opacity: 1;
  }

  .v4s-filters-panel {
    max-height: 86vh;
    gap: 0;
    background: #ffffff;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    font-family: var(--v4-font);
  }

  .v4s-filters.is-open .v4s-filters-panel {
    transform: translateY(0);
  }

  .v4s-filters-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 12px;
    border-bottom: 1px solid var(--v4-line);
  }

  .v4s-filters-grip {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 5px;
    margin-left: -20px;
    border-radius: 3px;
    background: #d1d5db;
  }

  .v4s-filters-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
  }

  .v4s-filters-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--v4-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--v4-ink);
  }

  .v4s-filters-body {
    overflow-y: auto;
    padding: 16px;
    gap: 24px;
  }

  .v4s-cats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .v4s-cat {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1.5px solid var(--v4-line);
    font-weight: 600;
  }

  .v4s-cat.is-active {
    border-color: var(--v4-ink);
  }

  .v4s-check {
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
  }

  .v4s-check input {
    width: 22px;
    height: 22px;
  }

  .v4s-filters-actions {
    grid-template-columns: 1fr 2fr;
    padding: 12px 16px 20px;
    border-top: 1px solid var(--v4-line);
  }

  .v4s-filters-actions .v4-btn {
    height: 50px;
  }

  .v4s-pagination {
    margin-top: 28px;
  }
}
