/* ═══════════════════════════════════════════
   Tema v2 — Shop
   Prefijo: v2s-  · Mobile first
   (El modal de filtros conserva las clases que usa js/Shop.js)
═══════════════════════════════════════════ */

/* ── CABECERA ─────────────────────────────── */
/* El recuadro de color (.v2-pagehead) está en theme.css */

/* Mosaicos de categorías — móvil: 3 columnas, 5 categorías + "Ver todas" */
.v2s-cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.v2s-cat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--v2-ink);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.v2s-cat:hover {
  background: #fff;
}

.v2s-cat:nth-child(n + 6):not(.v2s-cat--all) {
  display: none;
}

.v2s-cat-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.v2s-cat-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}

.v2s-cat--all .v2s-cat-img {
  background: rgba(255, 255, 255, 0.5);
}

.v2s-cat-name {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── BANNER DE OFERTAS (dentro de la grilla) ── */

.v2s-promo {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 22px;
  background: var(--v2-soft);
  color: var(--v2-ink);
  text-decoration: none;
}

.v2s-promo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.v2s-promo-eyebrow {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.v2s-promo-title {
  margin: 6px 0 16px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.v2s-promo-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.v2s-promo-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.v2s-promo-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
}

/* ── LISTADO ──────────────────────────────── */

.v2s-list {
  margin-top: 32px;
}

.v2s-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.v2s-filter-btn {
  flex-shrink: 0;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
}

.v2s-filter-extra {
  display: none;
}

.v2s-empty {
  padding: 48px 20px;
  border: 1px dashed var(--v2-line);
  border-radius: 20px;
  color: var(--v2-muted);
  font-size: 14px;
  text-align: center;
}

.v2s-empty p {
  margin: 0;
}

/* ── PAGINACIÓN ───────────────────────────── */

.v2s-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.v2s-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: #fff;
  color: var(--v2-ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.v2s-page:hover {
  border-color: var(--v2-ink);
}

.v2s-page.is-active {
  border-color: var(--v2-ink);
  background: var(--v2-ink);
  color: #fff;
}

.v2s-page--nav {
  padding: 0;
}

.v2s-page-info {
  margin: 12px 0 0;
  color: var(--v2-muted);
  font-size: 12px;
  text-align: center;
}

/* ── MODAL DE FILTROS ─────────────────────── */
/* Móvil: hoja inferior · Desktop: diálogo centrado */

.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 20, 24, 0.45);
}

.filter-modal.active {
  display: flex;
}

.filter-content {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  padding: 24px 20px 22px;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  color: var(--v2-ink);
  font-family: var(--v2-font);
}

.filter-header h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.native-select {
  display: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--v2-line);
  border-radius: 12px;
  background: #fff;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-trigger.active {
  border-color: var(--v2-ink);
}

.custom-select-trigger .dropdown-arrow {
  flex-shrink: 0;
  color: var(--v2-muted);
  transition: transform 0.2s ease;
}

.custom-select-trigger.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* Las opciones se despliegan dentro del flujo para no quedar recortadas por el scroll del modal */
.custom-options {
  display: none;
  max-height: 220px;
  margin-top: 6px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--v2-line);
  border-radius: 12px;
  background: #fff;
}

.custom-options.show {
  display: block;
}

.custom-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.custom-option:hover {
  background: var(--v2-soft);
}

.custom-option.selected {
  background: var(--v2-soft);
  font-weight: 600;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-cancel,
.btn-apply {
  flex: 1;
  height: 46px;
  border-radius: 999px;
  font-family: var(--v2-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn-cancel {
  border: 1px solid #d6d6db;
  background: #fff;
  color: var(--v2-ink);
}

.btn-cancel:hover {
  border-color: var(--v2-ink);
}

.btn-apply {
  border: 0;
  background: var(--v2-ink);
  color: #fff;
}

.btn-apply:hover {
  background: #000;
}

/* ── Tablet ───────────────────────────────── */

@media (min-width: 700px) {
  .v2s-cats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
  }

  .v2s-cat:nth-child(n + 6):not(.v2s-cat--all) {
    display: flex;
  }

  .v2s-cat {
    padding: 7px 7px 10px;
  }

  .v2s-cat-name {
    font-size: 12px;
  }

  .v2s-filter-extra {
    display: inline;
  }
}

/* ── Desktop ──────────────────────────────── */

@media (min-width: 900px) {
  .v2s-list {
    margin-top: 48px;
  }

  .v2s-promo {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 32px 36px;
    border-radius: 24px;
  }

  .v2s-promo-title {
    margin: 8px 0 20px;
    font-size: 30px;
  }

  .v2s-promo-thumbs {
    flex: 0 1 440px;
    gap: 12px;
  }

  .v2s-toolbar {
    margin-bottom: 22px;
  }

  .filter-modal {
    align-items: center;
    padding: 20px;
  }

  .filter-content {
    padding: 28px 28px 26px;
    border-radius: 24px;
  }
}

@media (min-width: 1100px) {
  .v2s-cats {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
