/* ============================================================
   SCREENS — Portadas (v1..v4), listados (v1..v6) y fichas
   (v1..v5) del rediseño flexible (fase C).
   ------------------------------------------------------------
   CSS semántico propio (prefijo .dv-*) sobre las variables del
   design system; ver nota de decisión en blocks.css. Solo se
   carga cuando el directorio tiene una variante de pantalla
   activa. Breakpoints: 640 / 768 / 1024 px.
   ============================================================ */

.dv-section { padding: var(--space-10) 0; }
.dv-count { font-family: var(--font-mono); color: var(--text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }

/* ---------- heros de portada ---------- */
.dv-hero { position: relative; text-align: center; padding: var(--space-20) 0 var(--space-16); background: var(--surface-page); }
.dv-hero.is-compact { padding: var(--space-16) 0 var(--space-10); }
.dv-hero h1 { font-size: clamp(2rem, 5vw, var(--text-4xl)); margin-bottom: var(--space-4); text-wrap: balance; }
.dv-hero h1 .hl { color: var(--green-600); }
.dv-hero .sub { font-size: var(--text-lg); color: var(--text-body); font-weight: var(--fw-medium); max-width: 560px; margin: 0 auto var(--space-8); line-height: 1.5; }
.dv-hero.is-brand { background: linear-gradient(135deg, var(--brand) 0%, var(--green-700) 100%); }
.dv-hero.is-brand h1, .dv-hero.is-brand h1 .hl { color: var(--on-brand); }
.dv-hero.is-brand .sub { color: color-mix(in srgb, var(--on-brand) 88%, transparent); }

/* buscador grande de portada */
.dv-search {
  max-width: 620px;
  margin: 0 auto;
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-card);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
}
.dv-search svg { width: 20px; height: 20px; color: var(--text-muted); flex: none; margin-left: var(--space-3); }
.dv-search input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--text-strong);
  padding: var(--space-3) var(--space-2);
}
.dv-search .btn { flex: none; }
.dv-search.is-bordered { box-shadow: none; border: 1.5px solid var(--border-default); }
.dv-search.is-bordered:focus-within { border-color: var(--brand); box-shadow: var(--ring-focus); }
.dv-search.is-left { margin: 0; }
.dv-search.is-grow { max-width: none; flex: 1; width: 100%; }

.dv-chips { margin-top: var(--space-6); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.dv-chip-onbrand {
  display: inline-flex; align-items: center;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--on-brand) 16%, transparent);
  color: var(--on-brand);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  padding: 6px 16px;
}
.dv-chip-onbrand:hover { background: color-mix(in srgb, var(--on-brand) 26%, transparent); text-decoration: none; }

/* rejilla de categorias (tiles verticales) */
.dv-grid-cats { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, 1fr); margin-top: var(--space-5); }
@media (min-width: 640px) { .dv-grid-cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .dv-grid-cats { grid-template-columns: repeat(4, 1fr); } }
.dv-cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  text-align: center;
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-4);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dv-cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-brand); text-decoration: none; }
.dv-cat-tile .ico {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
}
.dv-cat-tile .ico svg { width: 24px; height: 24px; }
.dv-cat-tile .name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); color: var(--text-strong); }
.dv-cat-tile .count { font-size: var(--text-xs); color: var(--text-muted); font-weight: var(--fw-semibold); }

/* hero partido (home v3) */
.dv-split { display: grid; gap: var(--space-10); align-items: center; padding-top: var(--space-8); }
@media (min-width: 768px) { .dv-split { grid-template-columns: 1fr 1fr; } }
.dv-split h1 { font-size: clamp(1.9rem, 4vw, var(--text-3xl)); margin: var(--space-4) 0; text-wrap: balance; }
.dv-split h1 .hl { color: var(--green-600); }
.dv-split .sub { color: var(--text-body); margin-bottom: var(--space-6); line-height: 1.55; }
.dv-split .dv-search { max-width: 460px; }
.dv-split-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card-lg);
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  color: var(--on-brand);
  overflow: hidden;
}
.dv-split-media svg { width: 56px; height: 56px; opacity: .7; }
.dv-split-media img { max-width: 60%; max-height: 45%; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.18)); }
.dv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--green-700);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  padding: 6px 12px;
}
.dv-badge svg { width: 13px; height: 13px; }

/* franja compacta (home v4) */
.dv-strip { padding: var(--space-8) 0; background: var(--surface-card); border-bottom: 1.5px solid var(--border-subtle); }
.dv-strip-inner { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 640px) { .dv-strip-inner { flex-direction: row; align-items: center; } }
.dv-strip h1 { font-size: var(--text-2xl); flex: none; }

/* fila de chips con scroll horizontal */
.dv-chip-row { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); scrollbar-width: thin; }
.dv-chip-row .chip { flex: none; }

/* ---------- listados ---------- */
.dv-list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); justify-content: space-between; }
.dv-listing { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
@media (min-width: 768px) { .dv-listing { grid-template-columns: 260px 1fr; align-items: start; } }
.dv-filters {
  display: none;
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}
@media (min-width: 768px) { .dv-filters { display: block; position: sticky; top: 96px; } }
.dv-filters-title { font-size: var(--text-sm); margin-bottom: var(--space-3); }
.dv-filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dv-filters a { font-size: var(--text-sm); color: var(--text-muted); font-weight: var(--fw-semibold); }
.dv-filters a:hover { color: var(--brand); }
.dv-filters-empty { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.grid-2-fixed { display: grid; gap: var(--space-5); grid-template-columns: 1fr; align-content: start; }
@media (min-width: 1024px) { .grid-2-fixed { grid-template-columns: repeat(2, 1fr); } }

/* lista + mapa (listado v2) */
.dv-listmap { display: grid; gap: var(--space-5); }
@media (min-width: 1024px) { .dv-listmap { grid-template-columns: 1fr 400px; align-items: start; } }
.dv-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.dv-map {
  display: none;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--brand-soft);
  color: var(--brand);
  place-items: center;
  height: 600px;
}
@media (min-width: 1024px) { .dv-map { display: grid; position: sticky; top: 96px; } }
.dv-map > svg { width: 48px; height: 48px; opacity: .6; }
.dv-map.is-inline {
  display: flex; align-items: center; gap: var(--space-4);
  height: auto; position: static;
  padding: var(--space-6);
}
.dv-map.is-inline > svg { width: 36px; height: 36px; flex: none; }
.dv-map-address { color: var(--text-strong); font-weight: var(--fw-semibold); margin: 0; }

/* fila de empresa (listado v2) */
.dv-row {
  display: flex; gap: var(--space-4);
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dv-row:hover { border-color: var(--border-brand); box-shadow: var(--shadow-sm); }
.dv-row.is-featured { border-color: var(--accent); }
.dv-row-media {
  width: 104px; min-height: 92px; flex: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  color: var(--on-brand);
}
.dv-row-media svg { width: 26px; height: 26px; }
.dv-row-body { flex: 1; min-width: 0; }
.dv-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.dv-row-top h3 { font-size: var(--text-lg); margin: 0; }
.dv-row-top a { color: var(--text-strong); }
.dv-row-meta { display: flex; align-items: center; gap: 5px; font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.dv-row-meta svg { width: 13px; height: 13px; flex: none; }
.dv-row-desc { font-size: var(--text-sm); color: var(--text-body); margin-top: var(--space-2); }
.dv-row-actions { display: flex; gap: var(--space-4); margin-top: var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-bold); }

/* tiles horizontales de subcategoria (listado v3) */
.dv-cat-rows { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .dv-cat-rows { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dv-cat-rows { grid-template-columns: repeat(3, 1fr); } }
.dv-cat-row {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dv-cat-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-brand); text-decoration: none; }
.dv-cat-row .ico {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
}
.dv-cat-row .ico svg { width: 26px; height: 26px; }
.dv-cat-row .body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dv-cat-row .name { font-family: var(--font-display); font-weight: 600; color: var(--text-strong); }
.dv-cat-row .desc { font-size: var(--text-sm); color: var(--text-muted); }

/* banda de cabecera de categoria (listado v4) */
.dv-cat-band { background: var(--surface-card); border-bottom: 1.5px solid var(--border-subtle); padding-bottom: var(--space-8); }
.dv-cat-band-inner { display: flex; align-items: center; gap: var(--space-4); }
.dv-cat-band-inner .ico {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.dv-cat-band-inner .ico svg { width: 28px; height: 28px; }

/* tabla (listado v5) */
.dv-table-wrap {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow-x: auto;
}
.dv-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.dv-table th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  font-weight: var(--fw-bold);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.5px solid var(--border-subtle);
}
.dv-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.dv-table tbody tr:last-child td { border-bottom: none; }
.dv-table tbody tr:hover { background: var(--surface-hover); }
.dv-cell-name { display: flex; align-items: center; gap: var(--space-3); }
.dv-cell-name a { color: var(--text-strong); font-family: var(--font-display); font-weight: 600; }
.dv-cell-name .ico {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.dv-cell-name .ico svg { width: 16px; height: 16px; }
.dv-cell-action { text-align: right; }
.dv-cell-action a { font-weight: var(--fw-bold); white-space: nowrap; }
.chip.is-table { font-size: var(--text-2xs); padding: 2px 10px; }
@media (max-width: 639px) { .dv-hide-sm { display: none; } }
@media (max-width: 767px) { .dv-hide-md { display: none; } }

/* rejilla de logos (listado v6) */
.dv-logo-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .dv-logo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dv-logo-grid { grid-template-columns: repeat(4, 1fr); } }
.dv-logo-item {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color .15s ease, background .15s ease;
}
.dv-logo-item:hover { border-color: var(--border-brand); text-decoration: none; }
.dv-logo-item .ico {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
}
.dv-logo-item .ico svg { width: 20px; height: 20px; }
.dv-logo-item .name {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-sm); color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* insignia de pack en linea (filas/tabla) */
.badge-featured.is-inline {
  position: static;
  display: inline-flex;
  transform: none;
  margin-left: var(--space-2);
}

/* ---------- fichas de empresa ---------- */
.dv-cover {
  height: 150px;
  border-radius: var(--radius-card-lg);
  background: linear-gradient(135deg, var(--brand) 0%, var(--green-700) 100%);
}
@media (min-width: 768px) { .dv-cover { height: 210px; } }

.dv-co-grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr; margin-top: var(--space-6); align-items: start; }
@media (min-width: 900px) { .dv-co-grid { grid-template-columns: 1fr 360px; } }
.dv-co-grid.is-overlap { margin-top: calc(-1 * var(--space-12)); padding: 0 var(--space-4); }
@media (min-width: 900px) { .dv-co-grid.is-overlap { margin-top: calc(-1 * var(--space-16)); padding: 0 var(--space-8); } }

.dv-co-head { display: flex; gap: var(--space-4); align-items: flex-start; }
.dv-co-tile {
  width: 72px; height: 72px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-lg);
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.dv-co-tile svg { width: 34px; height: 34px; }
.dv-co-head h1 { font-size: var(--text-2xl); }
.dv-co-meta { color: var(--text-muted); margin-top: 2px; }
.dv-co-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); align-items: center; }
.dv-co-head.is-centered { flex-direction: column; align-items: center; text-align: center; }
.dv-co-head.is-centered .dv-co-chips { justify-content: center; }

.dv-co-center { max-width: 720px; margin: 0 auto; text-align: center; padding-top: var(--space-4); }
.dv-co-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-6); }

/* galeria decorativa (ficha v2) */
.dv-gallery { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, 1fr); margin-top: var(--space-6); }
@media (min-width: 768px) { .dv-gallery { grid-template-columns: repeat(4, 1fr); } }
.dv-gallery-tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  color: var(--on-brand);
}
.dv-gallery-tile svg { width: 26px; height: 26px; opacity: .7; }
.dv-gallery-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.dv-gallery-tile.is-main { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.dv-gallery-tile.is-main svg { width: 40px; height: 40px; }
.dv-gallery-tile.is-alt { background: linear-gradient(135deg, var(--green-600) 0%, var(--brand) 100%); }
@media (max-width: 767px) { .dv-gallery-tile.is-alt { display: none; } }

/* pestañas (ficha v4) */
.dv-tabs { display: flex; overflow-x: auto; border-bottom: 1.5px solid var(--border-subtle); }
.dv-tab {
  flex: none;
  background: none; border: none; cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
}
.dv-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.dv-tabpanel { padding: var(--space-6); }
.dv-tabpanel.is-hidden { display: none; }
.dv-tabpanel section { margin-top: 0 !important; }
