/* ============================================================
   BLOCKS — Cabeceras (h1..h6) y pies (f1..f4) del rediseño
   flexible (fase B).
   ------------------------------------------------------------
   Decisión de build: el servidor no tiene node/npm, así que las
   utilidades Tailwind de la maqueta (variaciondisenos/assets/
   blocks-data.js) se han convertido a CSS semántico propio
   (prefijos .dh-* cabeceras, .df-* pies) usando las variables
   del design system (public/css/design-system/*). Así los skins
   de skins.css y los colores de marca del directorio re-tintan
   estos bloques sin recompilar nada.

   Este fichero solo se carga cuando el directorio tiene alguna
   variante de diseño activa: el diseño actual no lo usa.
   Breakpoints: 768px (md) y 1024px (lg), como la maqueta.
   ============================================================ */

/* ---------- base común de cabecera ---------- */
.dh {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface-card);
  border-bottom: 1.5px solid var(--border-subtle);
}
.dh a { text-decoration: none; }
.dh a:hover { text-decoration: none; }
.dh-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-3) var(--gutter);
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

/* Visibilidad responsive */
@media (max-width: 767px) { .dh-only-desktop { display: none !important; } }
@media (min-width: 768px) { .dh-only-mobile { display: none !important; } }

/* Logo / wordmark */
.dh-logo { display: flex; align-items: center; gap: 10px; flex: none; }
.dh-logo img { display: block; max-height: 38px; width: auto; }
.dh-logo-tile {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.dh-logo-tile svg, .dh-logo-tile i { width: 20px; height: 20px; }
.dh-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.dh-wordmark .hl { color: var(--green-600); }
.dh-logo.is-on-brand .dh-wordmark { color: var(--on-brand); }
.dh-logo.is-on-brand .dh-wordmark .hl { color: var(--on-brand); opacity: .85; }
.dh-logo.is-on-brand .dh-logo-tile {
  background: color-mix(in srgb, var(--on-brand) 18%, transparent);
  box-shadow: none;
}

/* Buscador de cabecera */
.dh-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-page);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-4);
  height: 44px;
}
.dh-search:focus-within { border-color: var(--brand); box-shadow: var(--ring-focus); }
.dh-search svg, .dh-search i { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
.dh-search input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-strong);
}
.dh-search .btn { flex: none; }
.dh-search-inline { display: none; }
@media (min-width: 768px) {
  .dh-search-inline { display: flex; flex: 1; max-width: 420px; }
  .dh-search-wide { max-width: none; }
  .dh-search-right { margin-left: auto; max-width: 360px; }
}
.dh-search-row { padding: 0 var(--gutter) var(--space-3); }
.dh-search-row[hidden] { display: none; }
@media (min-width: 768px) { .dh-search-row { display: none !important; } }

/* Navegación en línea */
.dh-nav { display: none; }
@media (min-width: 1024px) {
  .dh-nav { display: flex; align-items: center; gap: var(--space-5); font-size: var(--text-sm); }
}
.dh-nav a { color: var(--text-muted); font-weight: var(--fw-semibold); transition: color .15s ease; }
.dh-nav a:hover { color: var(--brand); }
.dh-nav.is-on-brand a { color: color-mix(in srgb, var(--on-brand) 85%, transparent); }
.dh-nav.is-on-brand a:hover { color: var(--on-brand); }
.dh-nav-toggle {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}
.dh-nav-toggle:hover { color: var(--brand); }
.dh-nav-toggle svg { width: 14px; height: 14px; }

/* CTA "Publica tu empresa" */
.dh-cta { display: none; }
@media (min-width: 768px) {
  .dh-cta {
    display: inline-flex; align-items: center;
    height: 44px; padding: 0 var(--space-5); flex: none;
    border-radius: var(--radius-button);
    background: var(--brand);
    color: var(--on-brand) !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-brand);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .dh-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand-lg); }
  .dh-cta.is-accent { background: var(--accent); color: var(--accent-fg) !important; box-shadow: var(--shadow-accent); }
  .dh-cta.is-inverse { background: var(--surface-card); color: var(--brand-press) !important; box-shadow: var(--shadow-md); }
}

/* Botones de icono y hamburguesa */
.dh-iconbtn, .dh-burger {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.dh-iconbtn { color: var(--text-muted); }
.dh-iconbtn:hover, .dh-burger:hover { color: var(--brand); border-color: var(--border-brand); }
.dh-iconbtn svg, .dh-burger svg { width: 18px; height: 18px; }
.dh-burger { margin-left: auto; }
.dh-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.dh-actions .dh-burger { margin-left: 0; }
.dh-push { margin-left: auto; }
@media (min-width: 768px) { .dh-burger { display: none; } }
.dh-burger.is-on-brand {
  border-color: color-mix(in srgb, var(--on-brand) 35%, transparent);
  color: var(--on-brand);
}

/* Panel móvil desplegable */
.dh-drawer {
  border-top: 1.5px solid var(--border-subtle);
  background: var(--surface-card);
  padding: var(--space-4) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.dh-drawer[hidden] { display: none; }
@media (min-width: 768px) { .dh-drawer { display: none !important; } }
.dh-drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.dh-drawer-nav a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.dh-drawer-nav a:hover { background: var(--brand-soft); }
.dh-drawer-nav svg { width: 16px; height: 16px; color: var(--brand); flex: none; }
.dh-drawer-cta {
  display: block; text-align: center;
  background: var(--brand);
  color: var(--on-brand) !important;
  border-radius: var(--radius-button);
  padding: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
}

/* ---------- h1 Centrado clásico: sticky translúcida con blur ---------- */
.dh-h1 {
  background: color-mix(in srgb, var(--surface-page) 85%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- h2 Barra de categorías ---------- */
.dh-h2 .dh-inner { min-height: 64px; }
.dh-chips {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: thin;
}
.dh-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  padding: 6px 14px;
  transition: color .15s ease, border-color .15s ease;
}
.dh-chip:hover { color: var(--brand); border-color: var(--border-brand); }
.dh-chip svg { width: 14px; height: 14px; }
.dh-chip.is-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- h3 Compacto minimal ---------- */
.dh-h3 .dh-inner { min-height: 60px; }
.dh-h3 .dh-inner { justify-content: space-between; }

/* ---------- h4 Hero integrado (banda de marca) ---------- */
.dh-h4 {
  background: linear-gradient(135deg, var(--brand) 0%, var(--green-700) 100%);
  border-bottom: none;
}

/* ---------- h5 Megamenú ---------- */
.dh-mega {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--surface-card);
  border-bottom: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}
.dh-mega[hidden] { display: none; }
@media (max-width: 1023px) { .dh-mega { display: none !important; } }
.dh-mega-grid {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.dh-mega-item {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  transition: background .15s ease;
}
.dh-mega-item:hover { background: var(--brand-soft); }
.dh-mega-ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--green-700);
}
.dh-mega-ico svg { width: 20px; height: 20px; }
.dh-mega-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--text-strong); }
.dh-mega-desc { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- h6 Topbar de contacto ---------- */
.dh-topbar { display: none; }
@media (min-width: 768px) {
  .dh-topbar { display: block; background: var(--green-700); color: var(--on-brand); }
}
.dh-topbar-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 36px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs);
}
.dh-topbar a, .dh-topbar-city { display: inline-flex; align-items: center; gap: 6px; color: var(--on-brand); }
.dh-topbar svg { width: 13px; height: 13px; }
.dh-topbar-contact { display: flex; gap: var(--space-5); }

/* ============================================================
   PIES (.df-*)
   ============================================================ */
.df { margin-top: var(--space-24); font-size: var(--text-sm); }
.df a { text-decoration: none; }
.df a:hover { text-decoration: underline; text-underline-offset: 3px; }

.df-cols {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-16) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .df-cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.df-brandcol { grid-column: span 2; padding-right: var(--space-4); }
@media (min-width: 768px) { .df-brandcol { grid-column: span 1; } }
.df-tagline { margin: var(--space-3) 0 0; color: var(--text-muted); line-height: var(--leading-relaxed); }
.df-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-strong);
  margin: 0 0 var(--space-3);
}
.df-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.df-links a { color: var(--text-muted); font-weight: var(--fw-semibold); }
.df-links a:hover { color: var(--brand); }
/* Columnas configurables del pie (settings.footer.columns): rejilla de N
   columnas iguales via --df-cols inline; en movil se mantiene la de 2. */
@media (min-width: 768px) {
  .df-cols.is-config { grid-template-columns: repeat(var(--df-cols, 4), minmax(0, 1fr)); }
}
.df-htmlcol { color: var(--text-muted); line-height: var(--leading-relaxed); }
.df-htmlcol a { color: var(--text-muted); font-weight: var(--fw-semibold); }
.df-htmlcol a:hover { color: var(--brand); }
.df-f4 .df-htmlcol, .df-f4 .df-htmlcol a { color: rgba(255, 255, 255, .75); }
.df-f4 .df-htmlcol a:hover { color: #fff; }
/* Enlaces legales junto al copyright (footer.legal_position = bottom) */
.df-legal-links a { color: inherit; font-weight: var(--fw-semibold); }
.df-legal { border-top: 1px solid var(--border-subtle); padding: var(--space-5) 0; }
.df-legal p {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- f1 Columnas completas ---------- */
.df-f1 { background: var(--surface-card); border-top: 1.5px solid var(--border-default); }

/* ---------- f2 CTA + columnas ---------- */
.df-cta-band { background: var(--brand); color: var(--on-brand); }
.df-cta-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-16) var(--gutter);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-6);
  text-align: center;
}
@media (min-width: 768px) {
  .df-cta-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.df-cta-inner h3 { color: var(--on-brand); font-family: var(--font-display); font-size: var(--text-2xl); margin: 0; }
.df-cta-inner p { color: var(--on-brand); opacity: .9; margin: 4px 0 0; }
.df-cta-btn {
  flex: none;
  background: var(--surface-card);
  color: var(--brand-press) !important;
  border-radius: var(--radius-button);
  padding: 14px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.df-f2 .df-body { background: var(--surface-card); border-top: 1.5px solid var(--border-default); }
.df-f2 .df-cols { padding-top: var(--space-12); padding-bottom: var(--space-12); }

/* ---------- f3 Minimal ---------- */
.df-f3 { background: var(--surface-page); border-top: 1.5px solid var(--border-default); }
.df-row {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-4);
}
@media (min-width: 768px) { .df-row { flex-direction: row; justify-content: space-between; } }
.df-inline-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-2) var(--space-5);
}
.df-inline-links a { color: var(--text-muted); font-weight: var(--fw-semibold); }
.df-inline-links a:hover { color: var(--brand); }
.df-social { display: flex; gap: var(--space-2); }
.df-social a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: color .15s ease, border-color .15s ease;
}
.df-social a:hover { color: var(--brand); border-color: var(--border-brand); }
.df-social svg { width: 16px; height: 16px; }
.df-copy { text-align: center; margin: 0; padding: 0 var(--gutter) var(--space-6); font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- f4 Oscuro (independiente del skin activo) ---------- */
.df-f4 {
  background: color-mix(in srgb, var(--green-800) 30%, #0b0d10);
  color: rgba(255, 255, 255, .92);
}
.df-f4 .df-title { color: #fff; }
.df-f4 .df-links a { color: rgba(255, 255, 255, .75); }
.df-f4 .df-links a:hover { color: #fff; }
.df-f4 .df-tagline { color: rgba(255, 255, 255, .7); }
.df-f4 .df-legal { border-top: 1px solid rgba(255, 255, 255, .12); }
.df-f4 .df-legal p { color: rgba(255, 255, 255, .6); }
.df-f4 .dh-wordmark { color: #fff; }
.df-f4 .dh-wordmark .hl { color: color-mix(in srgb, var(--brand) 55%, white); opacity: 1; }
.df-f4 .dh-logo-tile { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.df-dark-cta {
  display: inline-block;
  margin-top: var(--space-4);
  background: var(--brand);
  color: var(--on-brand) !important;
  border-radius: var(--radius-button);
  padding: 12px 20px;
  font-family: var(--font-display);
  font-weight: 600;
}
