/* ═══════════════════════════════════════════
   Tema v2 — Categorías
   Prefijo: v2c-  · Mobile first
   (La tarjeta .v2-catcard y la cabecera .v2-pagehead están en theme.css)
═══════════════════════════════════════════ */

/* ── BUSCADOR ─────────────────────────────── */

.v2c-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 540px;
  height: 50px;
  margin: 20px 0 0;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: #fff;
  color: var(--v2-muted);
  transition: box-shadow 0.2s ease;
}

.v2c-search:focus-within {
  box-shadow: 0 0 0 2px rgba(29, 29, 31, 0.18);
}

.v2c-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 15px;
}

.v2c-search input::placeholder {
  color: #9a9aa2;
}

.v2c-product-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(29, 29, 31, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
}

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

.v2c-product-search .v2c-q {
  overflow-wrap: anywhere;
}

/* ── GRILLA ───────────────────────────────── */

/* Móvil: 2 columnas con una sola imagen grande por tarjeta */
.v2c-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v2c-grid .v2-catcard[hidden],
.v2c-group[hidden] {
  display: none;
}

.v2c-grid .v2-catcard-media {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.v2c-grid .v2-catcard-tile:not(:first-child) {
  display: none;
}

.v2c-grid .v2-catcard-tile:first-child {
  grid-row: auto;
}

.v2c-grid .v2-catcard-name {
  display: -webkit-box;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── SIN RESULTADOS ───────────────────────── */

.v2c-noresults {
  margin-top: 32px;
  padding: 40px 20px;
  border: 1px dashed var(--v2-line);
  border-radius: 20px;
  text-align: center;
}

.v2c-noresults[hidden] {
  display: none;
}

.v2c-noresults p {
  margin: 0 0 16px;
  color: var(--v2-muted);
  font-size: 14px;
}

.v2c-noresults p span {
  color: var(--v2-ink);
  font-weight: 600;
}

/* ── Tablet: collage completo, 3 columnas ─── */

@media (min-width: 700px) {
  .v2c-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .v2c-grid .v2-catcard-media--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .v2c-grid .v2-catcard-media--3 {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .v2c-grid .v2-catcard-tile:not(:first-child) {
    display: block;
  }

  .v2c-grid .v2-catcard-media--3 .v2-catcard-tile:first-child {
    grid-row: span 2;
  }

  .v2c-grid .v2-catcard-name {
    font-size: 14px;
  }

  .v2c-search {
    margin-top: 24px;
  }
}

/* ── Desktop: 4 columnas ──────────────────── */

@media (min-width: 1024px) {
  .v2c-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}
