/* Los colores (--fg, --bg, --accent, etc.) los define el tema activo en
   css/themes/*.css, cargado después de este archivo — ver includes/header.php
   e includes/themes.php. Este archivo es solo estructura/layout. */
:root {
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

a { color: inherit; }

/* Saltar al contenido: invisible hasta que recibe el foco con el teclado. */
.skip-link {
  position: absolute; left: 8px; top: -64px; z-index: 100000;
  background: var(--bg); color: var(--fg); padding: 10px 16px; border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.brand img { display: block; width: 32px; height: auto; }
.brand-wide img { width: auto; height: 36px; max-width: 60vw; }
.brand-text span { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.main-nav { display: flex; gap: 16px; font-size: 14px; align-items: center; }
.main-nav a { text-decoration: none; }
.main-nav a:hover { text-decoration: underline; }
.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.lang-switch a { text-decoration: none; padding: 2px 4px; }
.lang-switch a.is-active { font-weight: 700; color: var(--fg); text-decoration: underline; }
.google-translate-widget { font-size: 13px; }
.google-translate-widget .goog-te-gadget { font-family: inherit !important; color: var(--muted) !important; }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  width: 30px; height: 30px; font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.theme-toggle:hover { background: var(--border); }
.nav-toggle {
  display: none;
  background: none; border: none; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--fg); padding: 4px 6px;
}
@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 0 12px;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { display: block; width: 100%; padding: 8px 4px; }
}

/* Submenús desplegables (v1.28): el enlace del padre + un botón ▾; la lista se abre al pasar el mouse, con el teclado
 * (foco dentro) o con el botón. En el celular quedan abiertos, sangrados bajo su padre. */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.nav-dropdown-toggle { background: none; border: 0; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 6px 4px; min-width: 24px; min-height: 24px; }
.nav-submenu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 200px;
  flex-direction: column; gap: 2px; padding: 6px; background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.nav-submenu a { display: block; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.nav-submenu a:hover { background: var(--border); text-decoration: none; }
.nav-dropdown:hover > .nav-submenu, .nav-dropdown:focus-within > .nav-submenu, .nav-dropdown.is-open > .nav-submenu { display: flex; }
@media (max-width: 720px) {
  .nav-dropdown { display: block; width: 100%; }
  .nav-dropdown-toggle { display: none; }
  .nav-submenu { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; background: none; }
}

/* Widgets y plantillas de página (v1.30) */
.widget-area-footer { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.widget-area-sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget-title { font-size: 15px; margin: 0 0 8px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li + li { margin-top: 6px; }
.widget li.widget-menu-child { padding-left: 14px; }
.widget-search { display: flex; gap: 6px; }
.widget-search input { flex: 1; min-width: 0; }
.page-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.page-with-sidebar .widget-area-sidebar { position: sticky; top: 16px; padding-top: 24px; }
@media (max-width: 860px) { .page-with-sidebar { grid-template-columns: 1fr; } .page-with-sidebar .widget-area-sidebar { position: static; } }
body.page-template-aterrizaje .site-footer { display: none; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 13px;
}
.site-footer-image { display: block; max-height: 56px; width: auto; margin-bottom: 10px; }
/* Imagen de pie de página a todo el ancho (Diseño, activada por defecto)
 * — mismo truco de romper .wrap que .hero-band.full-bleed, banner en vez
 * de logo chico. */
.site-footer-image.full-bleed {
  width: calc(100vw - var(--sbw, 0px)); max-height: none; height: 220px; object-fit: cover;
  position: relative; left: 50%; right: 50%;
  margin-left: calc(-50vw + var(--sbw, 0px) / 2); margin-right: calc(-50vw + var(--sbw, 0px) / 2); margin-bottom: 16px;
}
@media (max-width: 640px) { .site-footer-image.full-bleed { height: 140px; } }
.site-footer-text { margin: 0 0 6px; white-space: pre-line; }

/* Imagen destacada de una propiedad (negocio.php, inmobiliaria) — portada
 * a todo el ancho arriba de la ficha, mismo truco de romper .wrap que
 * .hero-band.full-bleed y la imagen de pie de página. Va de
 * background-image (no <img>) para poder reusar el mismo parallax de
 * siempre (background-attachment:fixed, ver .hero-band.parallax) cuando
 * está activado en Diseño. */
.property-hero-image {
  width: calc(100vw - var(--sbw, 0px)); position: relative; left: 50%; right: 50%;
  margin-left: calc(-50vw + var(--sbw, 0px) / 2); margin-right: calc(-50vw + var(--sbw, 0px) / 2); margin-bottom: 20px;
  height: 420px; background-size: cover; background-position: center;
}
@media (max-width: 640px) { .property-hero-image { height: 240px; } }

/* El contenido de la ficha de propiedad (precio, specs, galería,
 * contacto…) y de la portada de inmobiliaria (destacadas, zonas,
 * carruseles, filtro) se quedan a un ancho de lectura razonable
 * SIEMPRE, aunque el sitio tenga "Ancho completo" activado en Diseño
 * (esa opción libera a .wrap de su max-width, y sin este freno propio
 * el contenido queda pegado a los bordes de la ventana — se ve mal,
 * sobre todo con una portada de foto ya ocupando todo el ancho). La
 * portada en sí (.hero-band / .property-hero-image) no entra en este
 * contenedor — sigue teniendo su propio ancho completo opcional,
 * independiente de esto. .property-content: negocio.php (solo si hay
 * imagen destacada, ver $hasHero — sin ella .wrap ya alcanza).
 * .content-frame: theme-templates/rs-brixtapa/home.php (siempre). */
.property-content, .content-frame { max-width: 960px; margin: 0 auto; }

main.wrap { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* Flash messages */
.flash { padding: 10px 14px; border-radius: var(--radius); margin: 16px 0; font-size: 14px; }
.flash-success { background: #dcfce7; color: #14532d; }
.flash-error { background: #fee2e2; color: #7f1d1d; }
.flash-warning { background: #fef3c7; color: #78350f; }
@media (prefers-color-scheme: dark) {
  .flash-success { background: #14532d; color: #dcfce7; }
  .flash-error { background: #7f1d1d; color: #fee2e2; }
  .flash-warning { background: #78350f; color: #fef3c7; }
}

/* Typography */
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 8px; color: var(--muted); }
.lead { color: var(--muted); max-width: 560px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field .field-label { font-size: 13px; font-weight: 500; }
.field .field-label { display: block; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="url"], input[type="number"], input[type="time"], input[type="file"], input[type="search"], input[type="date"], input[type="datetime-local"],
select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  width: 100%;
}
textarea { resize: vertical; }
.row { display: flex; gap: 12px; }
.row > .field { flex: 1; }
/* Campos extra de una ficha (fecha, lugar, precio…): en varias líneas, al menos 200px cada uno (v1.16) */
.row.cf-row { flex-wrap: wrap; }
.row.cf-row > .field { flex: 1 1 200px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-green { background: var(--green); color: var(--on-green, #fff); }
.btn-red { background: var(--red); color: var(--on-red, #fff); }
.btn-amber { background: var(--amber); color: #1f1300; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
@media (max-width: 640px) {
  /* Los botones .btn-sm de las tarjetas de listado ("☆ Guardar", "Ver
   * detalles") medían 24-32px de alto en celular, por debajo del mínimo
   * de touch target recomendado — min-height en vez de más padding, para
   * no ensanchar de más los usos ya compactos del panel de admin
   * (auditoría de accesibilidad). */
  .btn-sm { min-height: 44px; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* v2.20: portada sin título a la vista (Diseño → Portada). El <h1> queda para buscadores y lectores de pantalla; un texto
 * de portada vacío no deja hueco (las plantillas de los temas pintan su <p class="lead"> o su <h2> aunque esté vacío). */
body.home-title-hidden main h1 { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main p.lead:empty, main h2:empty { display: none; }
.btn-link { background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; font: inherit; }

/* Cards / lists */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } .row { flex-direction: column; } }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; margin: 2px 0; }

/* Insignia "En venta"/"En renta" (operacion_badge_html() en
 * includes/site-types.php) — pill con color + ícono, para que se note de
 * un vistazo cuál es cuál (antes era solo texto discreto en gris). */
.operacion-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
/* Texto mezclado con el color del texto del tema (--fg): más oscuro en los temas claros y más claro en los oscuros, para llegar a 4,5:1 sobre el fondo tenue. */
.operacion-badge-venta { background: rgba(34, 197, 94, .16); color: color-mix(in srgb, var(--green) 78%, var(--fg, #000)); }
.operacion-badge-renta { background: rgba(217, 119, 6, .16); color: color-mix(in srgb, var(--accent2, var(--amber)) 72%, var(--fg, #000)); }

/* Foto de portada de una tarjeta de listado (render_business_card()) —
 * clase en vez de style="" inline para que .bento-grid pueda pisar el
 * alto sin necesitar !important. */
.card-thumb { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }

/* Bento grid (Diseño → "Cómo se muestran los listados") — mosaico con
 * tarjetas de tamaño variable en vez de una grilla uniforme. Se repite
 * cada 6 tarjetas (1 grande 2×2 + 1 alta 1×2 + 4 normales); grid-auto-flow
 * dense rellena los huecos que deja esa variación con las tarjetas que
 * siguen, en vez de dejarlos en blanco. */
.bento-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  grid-auto-flow: dense;
}
.bento-grid .card { display: flex; flex-direction: column; overflow: hidden; }
.bento-grid .card-thumb { flex: 1 1 auto; min-height: 0; height: auto; }
.bento-grid .card:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
.bento-grid .card:nth-child(6n+4) { grid-row: span 2; }
@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .bento-grid .card:nth-child(6n+1), .bento-grid .card:nth-child(6n+4) { grid-column: span 1; grid-row: span 1; }
  .bento-grid .card-thumb { height: 150px; flex: none; }
}

/* Estilo de tarjeta (Diseño) — "flat" es el de siempre (sin clase extra);
 * dos variantes más para que dos sitios con el mismo tema no se vean
 * idénticos. Ver body_classes() en includes/theme_customizer.php. */
body.card-style-shadow .card {
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}
body.card-style-outlined .card {
  border-width: 2px;
  border-color: var(--accent);
}

/* Animaciones — solo si la función "card_animations" está activa
 * (admin/funciones.php agrega .fx-on en <body>). Respeta
 * prefers-reduced-motion. */
body.fx-on .card {
  transition: transform .15s ease, box-shadow .15s ease;
}
body.fx-on .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
body.fx-on .card img { transition: opacity .3s ease; }
body.fx-on .gallery img, body.fx-on [data-lightbox] {
  transition: transform .15s ease;
  cursor: zoom-in;
}
body.fx-on .gallery img:hover, body.fx-on [data-lightbox]:hover {
  transform: scale(1.05);
}
@media (prefers-reduced-motion: reduce) {
  body.fx-on .card, body.fx-on .card:hover, body.fx-on .gallery img, body.fx-on [data-lightbox] {
    transition: none; transform: none;
  }
}

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity .2s ease; cursor: zoom-out;
}
.lightbox-overlay.is-open { opacity: 1; }
.lightbox-overlay img {
  max-width: 90vw; max-height: 90vh; border-radius: var(--radius);
  transform: scale(.92); transition: transform .2s ease;
}
.lightbox-overlay.is-open img { transform: scale(1); }

/* Visor de fotos 360° (negocio.php + includes/footer.php) */
.gallery-thumb-360 { position: relative; cursor: pointer; }
.gallery-thumb-360 .badge-360 {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.7); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; letter-spacing: .02em;
}
.gallery-thumb-360 .pano-cta {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.72); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.gallery-thumb-360 .pano-cta::before { content: "\25B6\00a0"; font-size: 11px; }
.gallery-thumb-360:hover .pano-cta, .gallery-thumb-360:focus-visible .pano-cta { background: rgba(0,0,0,0.88); }
/* v2.18: nombre del panorama sobre la miniatura (ficha) y su campo en el editor de la ficha. */
.gallery-thumb-360 .pano-name {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 60px); background: rgba(0,0,0,0.7); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pano-names .pano-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pano-names .pano-name-row img { width: 96px; height: 48px; object-fit: cover; border-radius: 4px; flex: none; }
.pano-names .pano-name-row input { flex: 1; min-width: 0; }
.thumb .badge-360 { top: -6px; left: -6px; bottom: auto; right: auto; position: absolute; }
.thumb .badge-featured {
  position: absolute; bottom: -6px; left: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--amber); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.pano-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity .2s ease;
}
.pano-overlay.is-open { opacity: 1; }
.pano-viewer { width: 100%; height: 100%; }
.pano-loading { position: absolute; color: #fff; font-size: 14px; }
.pano-close {
  position: absolute; top: 16px; right: 16px; z-index: 1001;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.pano-close:hover { background: rgba(255,255,255,0.3); }
/* v2.18: nombre del panorama abajo a la izquierda (arriba a la izquierda están los controles de Pannellum). */
.pano-title {
  position: absolute; left: 16px; bottom: 16px; z-index: 1001; margin: 0; max-width: calc(100% - 32px);
  background: rgba(0,0,0,0.6); color: #fff; font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 6px;
  pointer-events: none;
}

/* Search bar */
.search-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.search-bar input[type="text"] { flex: 1; min-width: 200px; }
.search-bar select { width: auto; }

/* Hero de portada — banda de color (o foto de portada, si se sube una
 * desde Diseño) con el encabezado del sitio. En inmobiliaria envuelve
 * también la barra de búsqueda (protagonista, como raudarealestate.com);
 * en directorio/blog envuelve solo el encabezado. var(--navy) con
 * respaldo a var(--accent) porque el tema Predeterminado no define --navy. */
.hero-band {
  position: relative;
  background: var(--navy, var(--accent));
  background-size: cover;
  background-position: center;
  color: var(--hero-fg, #fff);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-bottom: 24px;
  overflow: hidden;
}
/* Sin imagen de portada, "cover_style" (Diseño) da variedad sin subir
 * nada — degradado usando el segundo color de acento, o un patrón sutil
 * de líneas. "plain" (por defecto) deja el color sólido de siempre. */
.hero-band.cover-style-gradient {
  background: linear-gradient(135deg, var(--navy, var(--accent)), var(--accent2, var(--accent)));
}
.hero-band.cover-style-pattern {
  background-color: var(--navy, var(--accent));
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0, rgba(255,255,255,.07) 2px, transparent 2px, transparent 14px);
}
.hero-band.has-cover::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, var(--cover-overlay, 0.45));
  /* z-index explícito: sin esto, el ::before (pintado primero, como si
     fuera el primer "hijo") quedaba por DEBAJO de .hero-band-slide/
     .hero-band-video (también z-index:0) en vez de encima — el
     oscurecido desaparecía detrás de la foto/video y el texto blanco
     perdía contraste. Ver .hero-band-slide/.hero-band-video más abajo
     (se quedan en 0, a propósito, para perder este empate). */
  z-index: 1;
}
.hero-band > * { position: relative; z-index: 1; }
.hero-band h1, .hero-band .lead { color: var(--hero-fg, #fff); }
.hero-band .lead { opacity: .85; max-width: none; }
.hero-band .search-bar { margin-bottom: 0; }
.hero-band .search-bar input, .hero-band .search-bar select { border: none; }

/* Alto de portada (Diseño) — "medium" es el padding de siempre. */
.hero-band.cover-height-small { padding: 18px 24px; }
.hero-band.cover-height-large {
  padding: 72px 24px; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}
/* Pantalla completa, estilo hero banner de una landing page. */
.hero-band.cover-height-full {
  min-height: 100vh; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0;
}

/* Video de portada (Diseño) — reemplaza la imagen de fondo; la imagen
 * (si también hay una cargada) queda solo como "poster" de respaldo
 * mientras el video carga. Mismo overlay oscurecedor que ya usa la
 * imagen, por encima del video. */
.hero-band.has-video .hero-band-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Carrusel de portada (Diseño → Imágenes de portada, hasta 5) —
 * hero_band_cover_html() arma una capa por foto, superpuestas; JS en
 * includes/footer.php va mostrando una por vez (cruce suave). Cada capa
 * tiene su propio zoom lento continuo (estilo houzez.co) — se nota más
 * en la que está visible, pero corre siempre, así no hace falta
 * reiniciar la animación al cambiar de foto. */
.hero-band .hero-band-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 0; opacity: 0;
  transition: opacity 1.4s ease;
  animation: heroKenBurns 14s ease-in-out infinite alternate;
}
.hero-band .hero-band-slide.is-active { opacity: 1; }
@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-band .hero-band-slide { animation: none; }
}

/* Parallax (Diseño) — el fondo se mueve más lento que el resto al hacer
 * scroll; sencillo, con CSS nomás (background-attachment:fixed), sin
 * JS. Solo tiene sentido en imágenes de fondo grandes (portada, bloques
 * de página) — la imagen del pie de página es un logo chico, no aplica
 * ahí. Se desactiva en celulares (soporte pobre/entrecortado, mejor
 * scroll normal) y se respeta prefers-reduced-motion. */
.hero-band.parallax, .page-block.parallax, .property-hero-image.parallax {
  background-attachment: fixed;
}
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  .hero-band.parallax, .page-block.parallax, .property-hero-image.parallax {
    background-attachment: scroll;
  }
}

/* Portada a todo el ancho (Diseño) — rompe el contenedor .wrap centrado
 * para que la imagen llegue de borde a borde de la ventana, en vez de
 * quedar recortada al ancho del contenido. Solo aplica con imagen de
 * portada cargada (ver hero_band_attrs() en includes/theme_customizer.php). */
.hero-band.full-bleed {
  width: calc(100vw - var(--sbw, 0px));
  position: relative;
  left: 50%; right: 50%;
  margin-left: calc(-50vw + var(--sbw, 0px) / 2); margin-right: calc(-50vw + var(--sbw, 0px) / 2);
  border-radius: 0;
}

/* Ancho de contenido (Diseño) — de fábrica el sitio queda centrado en
 * 960px; esta clase en <body> lo deja usar el ancho completo de la
 * ventana en vez de quedar en una columna angosta. */
body.content-full .wrap { max-width: none; }

/* Encabezado centrado (Diseño) — alternativa al logo a la izquierda +
 * nav a la derecha de siempre. */
body.header-center .site-header-inner { justify-content: center; gap: 40px; }

/* Margen lateral del sitio (Diseño → «Margen lateral del sitio», v1.24/v1.25): espacio a cada lado del CONTENIDO (el contenedor
 * .wrap del encabezado, del contenido y del pie). Los fondos de las bandas (encabezado, pie, bloques de color) no se tocan:
 * siguen de borde a borde. Sin la opción (valor por defecto) el body no lleva ninguna de estas clases y todo queda como
 * siempre. :where() deja la regla con la misma fuerza que .wrap para que un tema que ya fija su propio relleno gane. */
body.site-margin-16 { --site-margin: 16px; }
body.site-margin-32 { --site-margin: 32px; }
body.site-margin-64 { --site-margin: 64px; }
:where(body[class*="site-margin-"]) .wrap { padding-left: calc(16px + var(--site-margin)); padding-right: calc(16px + var(--site-margin)); }
@media (max-width: 640px) {
  body.site-margin-32 { --site-margin: 20px; }
  body.site-margin-64 { --site-margin: 24px; }
}

/* Casillas y botones de opción (v1.26): proporcionales al texto y con el color del tema; con el tamaño de fábrica del navegador
 * (13 px) quedaban diminutas junto a un texto de 16 px o más. :where() para que cualquier regla propia siga ganando. */
:where(input[type="checkbox"], input[type="radio"]) { width: 1.25em; height: 1.25em; min-width: 18px; min-height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }

/* Textos de ayuda sueltos dentro de un formulario apilado (p. ej. en Diseño, bajo cada título): como los de .field */
.stack > p.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; text-decoration: none; cursor: pointer; background: transparent; color: inherit; font: inherit; }
.tab.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Chip — insignias y etiquetas (categorías, "Nuevo", tags de blog). Estilo
 * base genérico aquí; algunos temas lo redefinen para su paleta. */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent2, var(--navy, var(--accent))); color: var(--accent2-fg, #fff);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500;
}

/* Insignias con fondo de color (verde = «Nuevo», ámbar = «Destacada», gris = «sin conectar»): el texto sale de variables del tema
 * (--on-green, --on-amber, --on-muted) porque el verde/ámbar claros del modo oscuro necesitan texto oscuro para llegar a 4,5:1. */
.chip[style*="--green"] { color: var(--on-green, #fff) !important; }
.chip[style*="--amber"] { color: var(--on-amber, #1f1300) !important; }
.chip[style*="--muted"] { color: var(--on-muted, #fff) !important; }
mark { background: #fde68a; color: #1f1300; border-radius: 2px; padding: 0 2px; }

/* Bloques de página (/pagina.php, ver admin/pagina-editor.php) — cada
 * bloque puede tener su propio color de fondo y una imagen, ya sea como
 * figura normal o llenando el bloque de fondo (image_as_background). */
.page-block {
  border-radius: var(--radius);
  margin: 24px 0;
  padding: 24px;
}
/* v1.51: fondos que se adaptan a la pantalla (responsive_bg_style() en includes/functions.php deja --bg-m y --bg-l en
 * el estilo en línea): la mediana (800 px) hasta 640 px de ancho y la grande (1600 px) en lo demás. */
.bg-responsive { --bg: var(--bg-l); }
@media (max-width: 640px) {
  .bg-responsive { --bg: var(--bg-m, var(--bg-l)); }
}
.page-block.has-bg-image {
  background-size: cover;
  background-position: center;
  min-height: 280px;
  display: flex;
  align-items: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
/* v1.51: los títulos sobre la foto heredan el blanco del bloque (con la regla general de h2 quedaban en --muted, gris
 * sobre la foto, y casi no se leían). */
.page-block.has-bg-image :where(h2, h3, h4) { color: inherit; }
.page-block-image {
  display: block;
  width: 100%;
  height: auto; /* v1.37: con width/height en el <img> el espacio queda reservado antes de cargar */
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.page-block-content { line-height: 1.6; }
/* Campos de ficha que dependen del «Tipo de ficha» (data-show-for, ver js/icms-ui.js) */
.field[hidden] { display: none !important; }
/* Diseños de bloque (campo layout, ver PAGE_BLOCK_LAYOUTS en includes/revisions.php) */
.page-block-columnas2 .page-block-content { column-count: 2; column-gap: 32px; }
.page-block-columnas3 .page-block-content { column-count: 3; column-gap: 28px; }
.page-block-columnas2 .page-block-content > *, .page-block-columnas3 .page-block-content > * { break-inside: avoid-column; }
.page-block-banner { text-align: center; padding: 56px 24px; }
.page-block-banner .page-block-content { font-size: 1.25em; max-width: 760px; margin: 0 auto; }
.page-block-tarjeta { background-color: var(--bg); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.page-block-destacado { border-left: 6px solid var(--accent); background-color: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
@media (max-width: 720px) {
  .page-block-columnas2 .page-block-content, .page-block-columnas3 .page-block-content { column-count: 1; }
}
.page-block-content p:first-child { margin-top: 0; }
.page-block-content p:last-child { margin-bottom: 0; }

/* Admin shell */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px; }
.admin-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-nav-toggle {
  display: none; background: none; border: none; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--fg); padding: 4px 6px;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; margin-top: 20px; }
.admin-sidebar nav a { padding: 6px 8px; border-radius: 6px; text-decoration: none; }
.admin-sidebar nav a:hover { background: var(--border); }

/* Desplegable "Ajustes" (Usuarios/Permisos/Diseño/Funciones/Contenido
 * demo/Actualizaciones anidados) — ver admin/includes/admin-header.php. */
.admin-subnav-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 6px 8px; border-radius: 6px; border: none; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.admin-subnav-toggle:hover { background: var(--border); }
.admin-subnav-caret { transition: transform .15s ease; }
.admin-subnav-toggle[aria-expanded="true"] .admin-subnav-caret { transform: rotate(180deg); }
.admin-subnav { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; }
.admin-subnav a { padding: 6px 8px; border-radius: 6px; text-decoration: none; font-size: 13px; }
.admin-subnav a:hover { background: var(--border); }
/* Ancho máximo (mismo problema que ya se corrigió del lado público, ver
 * .content-frame): sin esto, en un monitor ancho las listas del panel
 * (Propiedades, Usuarios…) quedaban con el nombre pegado a la izquierda
 * y los botones Editar/Suspender lejísimos a la derecha. 960px, igual que
 * .content-frame/.property-content del lado público — mismo ancho de
 * lectura en todo el sistema (antes era 1200px "porque acá hay tablas con
 * más columnas", pero ninguna tabla del panel pasa de 5 columnas cortas;
 * a 1200px las tarjetas con justify-content:space-between, como las de
 * Propiedades, se veían con el nombre y los botones demasiado separados
 * igual, solo que menos que sin tope). margin:0 auto funciona como flex
 * item (centra en el espacio que le sobra dentro de .admin-shell) sin
 * tocar el resto del layout. */
.admin-content { flex: 1; padding: 24px; min-width: 0; max-width: 960px; margin: 0 auto; }
.admin-user-box { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Lista arrastrable del orden del menú (admin/menu.php) — ver el drag-
 * and-drop en vanilla JS ahí mismo, sin ninguna librería. max-width más
 * ancho que otras listas del panel porque las filas de enlaces propios
 * llevan un formulario de edición inline (texto + URL) adentro. */
.nav-order-list { list-style: none; margin: 0 0 8px; padding: 0; max-width: 720px; }
.nav-order-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  margin-bottom: 4px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: grab; font-size: 14px; flex-wrap: wrap;
}
.nav-order-list li.is-dragging { opacity: .4; }
.nav-order-list li.nav-item-hidden { opacity: .55; border-style: dashed; }
.nav-order-handle { color: var(--muted); font-size: 16px; line-height: 1; }
/* Botones Subir/Bajar — alternativa operable por teclado al arrastrar y
 * soltar (que por sí solo no lo es), ver admin/menu.php. */
.nav-order-move { display: flex; flex-direction: column; gap: 0; }
.nav-order-move form { display: block; }
.nav-order-move button {
  font-size: 13px; line-height: 1; padding: 2px 4px; cursor: pointer;
  color: var(--fg); background: none; border: none;
}
.nav-order-move button:disabled { color: var(--border); cursor: default; }
.nav-item-edit-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 260px; min-width: 0; }
.nav-item-edit-form input { font-size: 13px; padding: 4px 6px; min-width: 0; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; min-height: 0; }
  .admin-sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .admin-nav-toggle { display: block; }
  .admin-sidebar nav {
    display: none;
    flex-direction: column;
    margin-top: 12px; gap: 2px;
  }
  .admin-sidebar nav.is-open { display: flex; }
  .admin-sidebar nav a { white-space: normal; }
  .admin-user-box { margin-top: 12px; padding-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .admin-user-box p { margin: 0 !important; }
  /* margin:auto en una columna flex quita el estirado: el contenido tomaba el ancho de lo más ancho que llevara */
  .admin-content { padding: 16px; margin: 0; width: 100%; }
}

/* Cualquier tabla se vuelve deslizable horizontal en vez de desbordar la
 * pantalla (paneles de admin con muchas columnas, en celulares angostos). */
.admin-content table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-grid .card { text-align: center; }
.stat-grid .stat-value { font-size: 24px; font-weight: 600; }
.stat-grid .stat-label { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; }
.gallery .thumb { position: relative; }
.gallery .thumb .remove {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent); color: var(--accent-fg);
  border: none; cursor: pointer; font-size: 12px; line-height: 1;
}

/* Carrusel automático (home.php de inmobiliaria: venta/renta) — scroll
 * horizontal nativo (como .gallery-scroll), con el JS de includes/footer.php
 * avanzando una "pantalla" a la vez cada pocos segundos. 2 propiedades
 * visibles por vez en escritorio, 1 sola en celular — nada más con CSS,
 * el JS no necesita saber cuántas caben. */
.auto-carousel { overflow: hidden; }
.auto-carousel-track {
  display: flex; gap: 16px; overflow-x: hidden; scroll-behavior: smooth;
}
.auto-carousel-item { flex: 0 0 calc(50% - 8px); min-width: 0; }
@media (max-width: 560px) {
  .auto-carousel-item { flex: 0 0 100%; }
}

/* Galería de la ficha pública (negocio.php): tira horizontal con scroll y
 * botones ‹ › a los costados, en vez de envolver en varias filas. */
.gallery-wrap { position: relative; padding: 0 32px; }
.gallery-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.gallery-scroll img {
  width: 220px; height: 220px; flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: var(--radius);
}
@media (max-width: 640px) { .gallery-scroll img { width: 160px; height: 160px; } }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font-size: 18px; line-height: 1;
  cursor: pointer; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gallery-nav-prev { left: 0; }
.gallery-nav-next { right: 0; }
.gallery-nav:disabled { opacity: .3; cursor: default; }
.gallery-nav:hover:not(:disabled) { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
@media (max-width: 640px) {
  /* 44px, no 30px — el mínimo recomendado de touch target; la galería de
   * fotos es una de las interacciones más usadas de una ficha en celular
   * (auditoría SEO/accesibilidad, hallazgo W5). */
  .gallery-wrap { padding: 0 46px; }
  .gallery-nav { width: 44px; height: 44px; font-size: 17px; }
}

/* Galería masonry (propósito "Fotógrafos", ver negocio.php) — columnas
 * CSS en vez de JS (Masonry.js/Isotope): cada foto conserva su
 * proporción real, sin recortes ni gap entre ellas, a diferencia de
 * .gallery-scroll (que sí recorta a cuadrado en una tira horizontal).
 * Inspirado en medios360.com — ver source/medios360-portafolio/notas.md. */
.masonry-gallery {
  display: block; column-count: 3; column-gap: 0;
}
.masonry-gallery a { display: block; }
.masonry-gallery img {
  width: 100%; height: auto; display: block;
  object-fit: initial; border-radius: 0; break-inside: avoid;
}
@media (max-width: 900px) { .masonry-gallery { column-count: 2; } }
@media (max-width: 560px) { .masonry-gallery { column-count: 1; } }

/* v2.19: tamaño de las fotos y galería a todo el ancho (Ajustes → Opciones de las fichas; fichas_gallery_classes()).
 * Valen para el mosaico (.masonry-gallery) y la cuadrícula (.gallery-grid). */
.masonry-gallery.gal-size-chica { column-count: 4; }
.masonry-gallery.gal-size-mediana { column-count: 3; }
.masonry-gallery.gal-size-grande { column-count: 2; }
.masonry-gallery.gal-size-completa { column-count: 1; }
.gallery-grid.gal-size-chica { grid-template-columns: repeat(4, 1fr); }
.gallery-grid.gal-size-mediana { grid-template-columns: repeat(3, 1fr); }
.gallery-grid.gal-size-grande { grid-template-columns: repeat(2, 1fr); }
.gallery-grid.gal-size-completa { grid-template-columns: 1fr; }
.gallery-grid.gal-size-completa a { aspect-ratio: auto; }
.gallery-grid.gal-size-completa img { height: auto; }
@media (max-width: 900px) {
  .masonry-gallery.gal-size-chica, .masonry-gallery.gal-size-mediana { column-count: 2; }
  .gallery-grid.gal-size-chica, .gallery-grid.gal-size-mediana { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .masonry-gallery.gal-size-mediana, .masonry-gallery.gal-size-grande { column-count: 1; }
  .gallery-grid.gal-size-mediana, .gallery-grid.gal-size-grande { grid-template-columns: 1fr; }
}
/* A todo el ancho: sale del contenedor del texto hasta las orillas de la ventana. */
/* --sbw = ancho de la barra de desplazamiento (lo pone js/icms-ui.js; sin JavaScript vale 0). */
.gal-full {
  box-sizing: border-box; width: calc(100vw - var(--sbw, 0px)); max-width: none;
  margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2) !important; margin-right: calc(50% - 50vw + var(--sbw, 0px) / 2) !important;
}
.gallery-grid.gal-full { padding-inline: 8px; }

/* Tarjeta de categoría a sangre completa con foto de fondo (portada del
 * propósito "Fotógrafos") — mismo patrón visual que .hero-band.has-cover
 * (degradado oscuro para legibilidad), pero en tamaño de tarjeta. */
.category-photo-tile {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); height: 220px;
  background-size: cover; background-position: center;
  color: #fff; text-decoration: none;
}
.category-photo-tile::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.55));
}
.category-photo-tile span {
  position: absolute; z-index: 1; left: 20px; bottom: 16px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.category-photo-tile:hover img,
.category-photo-tile:hover { filter: brightness(1.05); }

/* Zonas de inmobiliaria ("Busca por zona", rs-brixtapa) — mismo tile de
 * foto de arriba, pero con zoom + un leve giro al pasar el mouse en vez
 * del solo brillo que usa fotógrafos (pedido explícito, estilo "Find
 * Properties in These Cities" de portales inmobiliarios modernos). */
.zone-photo-tile { transition: transform .35s ease, box-shadow .35s ease; }
.zone-photo-tile:hover {
  transform: scale(1.06) rotate(-1deg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .zone-photo-tile { transition: none; }
  .zone-photo-tile:hover { transform: none; }
}

/* Botón flotante de WhatsApp (includes/footer.php) — fijo en la esquina,
 * visible en todo el sitio si hay un número configurado en Ajustes. */
.whatsapp-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
@media (max-width: 640px) {
  .whatsapp-float { right: 14px; bottom: 14px; width: 46px; height: 46px; }
  .whatsapp-float svg { width: 24px; height: 24px; }
}

/* Flechas de navegación dentro del lightbox (fotos siguiente/anterior). */
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 1001;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav-prev { left: 16px; }
.lightbox-nav-next { right: 16px; }

/* Utilidades de layout para plantillas por tema (theme-templates/) — capas
 * genéricas de estructura, sin color propio, para que cualquier tema las
 * pueda usar armando una portada con otra forma (panel lateral, filas de
 * listado, barra lateral de widgets…) en vez del layout por defecto. */
.layout-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .layout-sidebar { grid-template-columns: 1fr; } }

.filter-panel { position: sticky; top: 16px; }
.filter-panel .field { margin-bottom: 12px; }
.filter-panel .field:last-child { margin-bottom: 0; }
/* En columna única (ver .layout-sidebar arriba) el panel de filtros
 * queda apilado ARRIBA de los resultados, no al costado — dejarlo
 * "sticky" ahí lo mantendría pegado a la pantalla mientras se
 * desplazan los resultados debajo, tapándolos. Solo tiene sentido
 * fijo cuando de verdad está al costado (2 columnas). */
@media (max-width: 800px) { .filter-panel { position: static; } }

.sidebar-widget h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 0 0 10px; }
.sidebar-widget + .sidebar-widget { margin-top: 20px; }
.sidebar-widget .widget-list { list-style: none; margin: 0; padding: 0; }
.sidebar-widget .widget-list li { margin-bottom: 10px; font-size: 14px; }
.sidebar-widget .widget-list a { text-decoration: none; }
.sidebar-widget .widget-list a:hover { text-decoration: underline; }

.listing-row {
  display: flex; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.listing-row:first-child { padding-top: 0; }
.listing-row img { width: 140px; height: 105px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.listing-row .listing-body { flex: 1; min-width: 0; }
.listing-row h3 { margin: 0 0 4px; }
@media (max-width: 560px) { .listing-row { flex-direction: column; } .listing-row img { width: 100%; height: 160px; } }

/* ── Aviso de cookies (includes/maintenance.php, includes/footer.php) ── */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 560px; margin: 0 auto; padding: 14px 16px;
  background: var(--bg, #fff); color: var(--fg, #222);
  border: 1px solid var(--border, #ddd); border-radius: var(--radius, 8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.cookie-banner p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.cookie-banner-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Validación de formularios: el error se marca solo DESPUÉS de que la persona interactuó con el
 * campo (:user-invalid), no mientras todavía está escribiendo. */
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--red, #dc2626); box-shadow: 0 0 0 1px var(--red, #dc2626); }
input:user-valid:required, textarea:user-valid:required { border-color: var(--green, #15803d); }

/* Contacto y redes del pie de página (Ajustes) */
.site-footer-contact { margin: 0 0 6px; }
.site-footer-social { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* Cerrar sesión (formulario POST con token) dentro del menú */
.logout-form { display: inline; margin: 0; }

/* Aviso «Abierto ahora» en la ficha */
.open-now { margin: 4px 0 12px; font-weight: 600; }
.open-now-yes { color: #067647; }
.open-now-no { color: #b42318; }
@media (prefers-color-scheme: dark) { .open-now-yes { color: #47cd89; } .open-now-no { color: #fda29b; } }

/* Sesiones activas (Mi cuenta y panel) */
.session-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.session-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius, 8px); }
.session-item.session-current { border-color: var(--accent); }
.session-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.session-body { flex: 1; min-width: 0; }
.session-title, .session-meta { margin: 0; overflow-wrap: anywhere; }
.session-meta { font-size: 13px; color: var(--muted); }
.session-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-fg, #fff); font-size: 12px; font-weight: 600; }
.session-item form { margin: 0; flex-shrink: 0; }
.session-history { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.session-history th, .session-history td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 560px) { .session-item { flex-wrap: wrap; } .session-item form { margin-left: 34px; } }

/* Contraseñas nuevas: reglas, barra de seguridad y ver/ocultar (js/icms-password.js) */
.pw-toggle { align-self: flex-start; margin-top: 4px; padding: 4px 10px; min-height: 32px; font: inherit; font-size: 13px; background: transparent; color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius, 8px); cursor: pointer; }
.pw-toggle:hover { border-color: var(--fg); }
.pw-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.pw-fill { display: block; height: 100%; width: 0; background: #b42318; transition: width .2s; }
.pw-meter[data-level="2"] .pw-fill { background: #b54708; }
.pw-meter[data-level="3"] .pw-fill { background: #067647; }
.pw-meter[data-level="4"] .pw-fill { background: #05603a; }
.pw-label { margin: 4px 0 0; font-size: 13px; color: var(--fg); min-height: 1.2em; }
.pw-rules { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.pw-rule { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.pw-mark::before { content: "○"; display: inline-block; width: 1.1em; }
.pw-rule.pw-ok { color: #067647; }
.pw-rule.pw-ok .pw-mark::before { content: "✓"; font-weight: 700; }
.pw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pw-match { margin: 4px 0 0; font-size: 13px; min-height: 1.2em; }
.pw-match-ok { color: #067647; }
.pw-match-bad { color: #b42318; }
@media (prefers-color-scheme: dark) {
  .pw-fill { background: #f97066; }
  .pw-meter[data-level="2"] .pw-fill { background: #fdb022; }
  .pw-meter[data-level="3"] .pw-fill, .pw-meter[data-level="4"] .pw-fill { background: #47cd89; }
  .pw-rule.pw-ok, .pw-match-ok { color: #47cd89; }
  .pw-match-bad { color: #fda29b; }
}

/* Comentarios de las entradas (post.php, includes/comments.php) */
.comments-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.comments-sort { display: flex; gap: 12px; font-size: 13px; }
.comments-sort a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.comments-sort a.is-active { color: var(--fg); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.comment:target { background: var(--bg-soft, rgba(127,127,127,.08)); }
.comment-reply { margin: 10px 0 0 18px; padding: 8px 0 0 12px; border-bottom: 0; border-left: 3px solid var(--border); }
.comment-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.comment-head.has-avatar { align-items: center; gap: 4px 8px; }
/* Foto de Gravatar (v2.12): iniciales de fondo y, encima, la foto si existe (sin foto Gravatar manda una imagen transparente). */
.comment-avatar { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; color: #fff; font-size: 15px; font-weight: 600; line-height: 1; }
.comment-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; display: block; }
.comment-reply .comment-avatar { width: 28px; height: 28px; font-size: 13px; }
.comment-body { margin: 4px 0; overflow-wrap: anywhere; line-height: 1.55; }
.comment-time { font-size: 12px; }
.comment-badge { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 600; }
.comment-actions { margin: 4px 0 0; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.comment-actions a, .comment-actions .btn-link { color: var(--muted); }
.comment-actions .inline-form { display: inline; margin: 0; }
.comment-form textarea { width: 100%; }
.comments-more-wrap { text-align: center; margin: 16px 0; }
.comment-mine-pending { font-size: 13px; color: var(--muted); }
.comment-quote { margin: 4px 0 6px; padding: 4px 10px; border-left: 3px solid var(--border); color: var(--muted); font-size: 13px; }

/* Cuerpo enriquecido (entradas y descripción de fichas): imágenes, galerías, videos */
.post-body img{max-width:100%;height:auto;border-radius:var(--radius);display:block;margin:16px 0}
.post-body .post-embed{position:relative;aspect-ratio:16/9;margin:16px 0}
.post-body .post-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:var(--radius)}
.post-body h2,.post-body h3,.post-body h4{margin:1.4em 0 .5em;color:var(--fg)}
.post-body blockquote{margin:1.2em 0;padding:0 0 0 1.1em;color:var(--muted);font-style:italic}
.business-desc{line-height:1.7;margin:12px 0}
.business-desc>:first-child{margin-top:0}

/* Índice de la entrada y serie (v0.97) */
.post-toc, .post-series { margin: 1.5rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius, 8px); background: var(--soft, var(--bg)); }
.post-toc-title, .post-series-title { margin: 0 0 .5rem; font-weight: 600; }
.post-toc ol, .post-series ol { margin: 0; padding-left: 1.25rem; }
.post-toc li { margin: .15rem 0; }
.post-toc li.lvl-3 { margin-left: 1rem; list-style: circle; }
.post-toc a, .post-series a { text-underline-offset: .18em; }
.post-series [aria-current="page"] { font-weight: 600; }
.post-body h2[id], .post-body h3[id] { scroll-margin-top: 4.5rem; }
.suggest-box { margin: 0 0 1rem; }

/* Promociones y reportes de fichas (v0.97) */
.chip-promo { background: var(--accent2, #C2410C); color: var(--accent2-fg, #fff); font-size: 10px; vertical-align: middle; }
.promo-banner { margin: 12px 0; padding: 10px 14px; border-radius: var(--radius, 8px); background: var(--soft, #FFF4E5); border: 1px solid var(--border); border-left: 4px solid var(--accent2, #C2410C); }
.report-box { margin-top: 16px; font-size: .9rem; }
.report-box summary { cursor: pointer; color: var(--muted); min-height: 2.75rem; display: flex; align-items: center; }
.report-box form { margin-top: 8px; max-width: 420px; }
.suggest-box summary { color: inherit; font-weight: 600; }
/* v2.9: fotos actuales de la ficha para pedir que se quite alguna, y «+ Agregar más fotos» */
.sug-current-photos { border: 0; padding: 0; margin: 0; min-width: 0; }
.sug-current-photos legend { padding: 0; margin-bottom: .35rem; font-weight: 600; }
.sug-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.sug-photo-pick { display: flex; flex-direction: column; gap: 4px; margin: 0; cursor: pointer; font-weight: 400; }
.sug-photo-pick img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: var(--radius, 8px); border: 2px solid var(--border); }
.sug-photo-pick span { display: flex; align-items: center; gap: 6px; min-height: 2rem; }
.sug-photo-pick:has(input:checked) img { border-color: var(--red, #B91C1C); opacity: .55; }
.sug-photo-pick:has(input:focus-visible) img { outline: 3px solid var(--accent, #0F766E); outline-offset: 2px; }
[data-file-list] input[type=file] + input[type=file] { margin-top: 6px; }
.sug-add-photo { justify-self: start; margin-top: 6px; min-height: 2.25rem; }

/* Galerías de clientes (v0.97) */
.cg-gallery figure { position: relative; }
.cg-pick { position: absolute; top: 8px; right: 8px; width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.4rem; cursor: pointer; z-index: 3; }
.cg-pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.cg-pick:has(input:checked) { background: var(--accent2, #C2410C); }
.cg-pick:has(input:focus-visible) { outline: 3px solid #fff; outline-offset: 2px; }
.cg-dl { position: absolute; left: 8px; top: 8px; z-index: 3; min-height: 2.25rem; padding: 0 .75rem; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font: inherit; font-size: .8rem; cursor: pointer; }
/* v1.54: «Cerca de mí» en los listados de fichas (includes/near_search.php; js/icms-ui.js lo muestra si hay ubicación). */
.near-search { margin: 0 0 16px; }
.near-search .near-status { margin: 8px 0 0; }
.near-results:not(:empty) { margin-top: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.near-item { display: flex; flex-direction: column; }
.near-dist { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
/* v1.53: tamaño de impresión y copias de una foto marcada (solo si la galería ofrece impresiones; se oculta mientras la
 * foto no esté marcada — sin :has() se ve siempre y funciona igual). */
.cg-print { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.cg-print select { flex: 1 1 auto; min-width: 0; }
.cg-print input[type=number] { width: 4.5rem; flex: none; }
.cg-gallery figure:not(:has(.cg-pick input:checked)) .cg-print { display: none; }
.cg-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: center; padding: 10px 12px; margin-top: 16px; background: var(--bg); border-top: 1px solid var(--border); }
.alert-box summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; }

/* Bloques de página: el h2 general mide 16px; en el banner (texto 1.25em) quedaba más chico que el párrafo, y los
   bloques de módulos (v1.09) usan h2 como título de sección. */
.page-block-banner .page-block-content h2 { font-size: 1.6em; line-height: 1.2; margin: 0 0 .4em; }
.page-block-ultimas_entradas .page-block-content > h2,
.page-block-fichas .page-block-content > h2,
.page-block-buscador_fichas .page-block-content > h2 { font-size: 1.4rem; margin: 0 0 14px; }

/* Formularios avanzados (v1.42, includes/forms.php + js/icms-forms.js): opciones, pasos y campos condicionales. */
.custom-form .form-choices { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.custom-form .form-choices legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.custom-form .form-choice { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
.custom-form .form-step { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; min-width: 0; display: grid; gap: 14px; }
.custom-form .form-step > legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; }
.custom-form .form-step-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.custom-form .form-step-status { margin: 0; color: var(--muted); font-size: .9rem; }
.custom-form [hidden] { display: none !important; }

/* Bloques de diseño (v1.43, includes/page_blocks_design.php) y opciones de todo bloque: espacio, pantallas y ancla. */
.page-block.block-space-compacto { padding-top: 12px; padding-bottom: 12px; margin-top: 12px; margin-bottom: 12px; }
.page-block.block-space-amplio { padding-top: 56px; padding-bottom: 56px; margin-top: 40px; margin-bottom: 40px; }
.page-block.block-space-sin { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; }
@media (max-width: 720px) { .hide-on-mobile { display: none !important; } }
@media (min-width: 721px) { .hide-on-desktop { display: none !important; } }
.page-block[id] { scroll-margin-top: 80px; }
.page-block-content > .block-title { font-size: 1.4rem; margin: 0 0 14px; }
.block-cta { display: grid; gap: 14px; }
.block-cta.block-align-centro { text-align: center; justify-items: center; }
.block-cta > .block-title { margin: 0; }
.block-cta > p { margin: 0; max-width: 62ch; }
.page-block-banner .block-cta > .block-title { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; }
.block-cta-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.block-align-centro .block-cta-buttons { justify-content: center; }
.page-block-boton.has-bg-image > .page-block-content { flex: 1 1 auto; min-width: 0; }
.page-block-boton.page-block-banner.has-bg-image { min-height: 420px; }
.has-bg-image .block-cta .btn { text-shadow: none; }
.has-bg-image .block-cta .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .85); }
.block-cols { display: grid; gap: 24px; grid-template-columns: repeat(var(--block-cols, 3), minmax(0, 1fr)); }
.block-cols-2 { --block-cols: 2; }
.block-cols-3 { --block-cols: 3; }
.block-cols-4 { --block-cols: 4; }
@media (max-width: 900px) { .block-cols-4 { --block-cols: 2; } }
@media (max-width: 720px) { .block-cols { --block-cols: 1; } }
.block-col > :first-child { margin-top: 0; }
.block-col > :last-child { margin-bottom: 0; }
.block-col img { max-width: 100%; height: auto; border-radius: var(--radius); }
.block-col h3, .block-col h4 { margin: 0 0 6px; }
.block-col :is(h3, h4) + p { margin-top: 0; }
.block-faq { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); text-shadow: none; }
.faq-item > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; font-weight: 600; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; flex: none; font-weight: 400; font-size: 1.3em; line-height: 1; color: var(--muted); }
.faq-item[open] > summary::after { content: "\2013"; }
.faq-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.faq-answer { padding: 0 16px 14px; }
.faq-answer p { margin: 0 0 .6em; }
.faq-answer p:last-child { margin-bottom: 0; }
.block-testimonials { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.testimonial { margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); text-shadow: none; }
.testimonial blockquote { margin: 0; font-style: italic; }
.testimonial blockquote::before { content: "\201C"; display: block; height: .45em; font-family: Georgia, "Times New Roman", serif; font-size: 2.8em; line-height: 1; font-style: normal; color: var(--accent); }
.testimonial blockquote p { margin: 0 0 .5em; }
.testimonial blockquote p:last-child { margin-bottom: 0; }
.testimonial figcaption { margin-top: auto; display: flex; flex-direction: column; font-size: .95em; }
.testimonial figcaption span { color: var(--muted); font-size: .9em; }
.block-pricing { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: stretch; padding-top: 10px; }
.pricing-plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); text-shadow: none; }
.pricing-plan.is-featured { border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.page-block-content .pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 2px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pricing-plan h3 { margin: 0; font-size: 1.15rem; }
.pricing-price { margin: 0; }
.pricing-price strong { font-size: 2rem; line-height: 1.1; }
.pricing-price span { color: var(--muted); }
.pricing-features { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pricing-features li { position: relative; padding-left: 1.5em; }
.pricing-features li::before { content: "\2713"; position: absolute; left: 0; font-weight: 700; color: var(--green, var(--accent)); }
.page-block-content .pricing-cta { margin: auto 0 0; padding-top: 6px; }
.pricing-cta .btn { display: block; text-align: center; }
.block-map iframe { display: block; width: 100%; border: 0; border-radius: var(--radius); }
.block-map-bajo iframe { height: 260px; }
.block-map-medio iframe { height: 380px; }
.block-map-alto iframe { height: 520px; }
.page-block-content .block-map-link { margin: 8px 0 0; font-size: .9em; }
.page-block.page-block-espaciador { padding: 0; margin-top: 0; margin-bottom: 0; }
.block-spacer { display: flex; align-items: center; }
.block-spacer-s { height: 16px; }
.block-spacer-m { height: 40px; }
.block-spacer-l { height: 72px; }
.block-spacer-xl { height: 120px; }
.block-spacer hr { flex: 1; margin: 0; border: 0; border-top: 1px solid var(--border); }

/* Contenido del editor visual (v1.44; saneador en includes/posts.php): alineación, tablas y enlaces con forma de botón. */
.text-center { text-align: center; }
.text-right { text-align: right; }
.post-table { overflow-x: auto; margin: 0 0 1em; }
:where(.post-body, .page-block-content, .block-col, .faq-answer) table { width: 100%; border-collapse: collapse; }
:where(.post-body, .page-block-content, .block-col, .faq-answer) :is(th, td) { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
:where(.post-body, .page-block-content, .block-col, .faq-answer) th { background: color-mix(in srgb, var(--fg) 5%, var(--bg)); font-weight: 600; }
:where(.post-body, .page-block-content, .block-col, .faq-answer) caption { caption-side: bottom; padding-top: 6px; color: var(--muted); font-size: .9em; }
.post-body a.btn, .page-block-content a.btn { text-decoration: none; }
.post-body a.btn-primary, .page-block-content a.btn-primary { color: var(--accent-fg); }
.post-body a.btn-outline, .page-block-content a.btn-outline { color: var(--fg); }

/* Vista previa de un tema (v2.3, Temas → «Vista previa»): barra fija con colores propios, legible con cualquier tema. */
.theme-preview-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9999;
  display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100% - 24px); padding: 10px 14px; border-radius: 12px;
  background: #111; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font: 14px/1.4 system-ui, sans-serif;
}
.theme-preview-bar form { margin: 0; }
.theme-preview-bar button { font: inherit; border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer; border: 1px solid #fff; }
.theme-preview-bar .tpb-use { background: #fff; color: #111; }
.theme-preview-bar .tpb-exit { background: transparent; color: #fff; }

/* «Sugerir un negocio» al pie de la ficha y su formulario (v2.12) */
.suggest-business-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 16px 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--soft, var(--bg)); }
.suggest-business-cta .suggest-business-text { line-height: 1.4; }
.suggest-business-form fieldset { margin: 0; padding: 12px 14px 4px; border: 1px solid var(--border); border-radius: var(--radius); }
.suggest-business-form legend { padding: 0 6px; font-weight: 600; }

/* «Sugerir un cambio»: zona, categorías, mapa y horario (v2.13, js/icms-suggest.js) */
.sug-sub { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; }
.sug-sub > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.sug-sub[open] { padding-bottom: 12px; }
.sug-map { height: 240px; border-radius: var(--radius); background: var(--soft, rgba(127,127,127,.12)); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; }
.sug-map.leaflet-container { display: block; padding: 0; }
.sug-map-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.sug-checks { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0; }
.sug-checks legend { padding: 0 6px; font-weight: 600; }
.sug-check { display: flex; align-items: center; gap: 8px; min-height: 32px; font-weight: normal; }
.sug-checks .sug-check { display: inline-flex; margin-right: 14px; }
.sug-cats { max-height: 220px; overflow-y: auto; }
.sug-cats .sug-check { display: flex; margin-right: 0; }
.sug-hours { display: grid; gap: 6px; margin-top: 8px; }
.sug-hours-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sug-hours-day { width: 6.5rem; font-weight: 600; }
.sug-hours-row input[type="time"] { width: 7.4rem; min-width: 0; padding-inline: 8px; }
@media (max-width: 520px) { .sug-hours-day, .sug-hours-row .sug-check { flex: 0 0 100%; } .sug-hours-row { gap: 4px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); } }

/* Galería de la ficha en cuadrícula (v2.15, Ajustes → Opciones de las fichas) */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.gallery-grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--soft, rgba(127,127,127,.12)); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; transition: transform .4s ease; }
.gallery-grid a:hover img, .gallery-grid a:focus-visible img { transform: scale(1.05); }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Orden y fichas por página del directorio (v2.15) */
.dir-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; }
.dir-controls .dir-count { margin: 0 auto 0 0; color: var(--muted); font-size: 14px; }
.dir-controls label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.dir-controls select { width: auto; min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .gallery-grid img { transition: none; } }
/* Mapa del directorio: destacados con marca propia y lista plegada (v2.15) */
.map-pin-wrap { background: none; border: 0; }
.map-pin-featured { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #F3A712; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.map-pin-featured > span { transform: rotate(45deg); color: #fff; font-size: 16px; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.map-pin-legend { width: 22px; height: 22px; border-width: 2px; vertical-align: middle; margin-right: 4px; }
.map-pin-legend > span { font-size: 11px; }
.map-legend { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; font-size: 14px; color: var(--muted); }
.map-featured-tag { color: #B45309; font-weight: 700; font-size: 12px; margin: 2px 0; }
.map-list { margin: 8px 0 0; }
.map-list > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--muted); }
/* Búsqueda en vivo (v2.15, js/icms-live-search.js) */
.live-results { position: absolute; z-index: 1000; max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); box-shadow: 0 14px 34px rgba(0, 0, 0, .16); text-align: left; }
.live-result { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.live-result:hover, .live-result[aria-selected="true"] { background: var(--soft, rgba(127,127,127,.12)); }
.live-result img, .live-result-ph { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; margin: 0; }
.live-result-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-fg, #fff); font-weight: 700; }
.live-result-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.live-result-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.live-result-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-result.is-featured .live-result-text small { color: #B45309; }
.live-results-msg { margin: 0; padding: 10px; color: var(--muted); font-size: 14px; }
.live-results-more { display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--border); font-weight: 600; font-size: 14px; text-decoration: none; color: var(--accent); }
/* Mapa del directorio: filtros por categoría y «Cerca de mí» (v2.16, js/icms-map-filters.js) */
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 0; }
.map-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0; flex: 1 1 100%; scrollbar-width: thin; }
.map-filter { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
.map-filter:hover { border-color: var(--accent); }
.map-filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff); }
.map-filter-ico { display: inline-flex; font-size: 16px; line-height: 1; }
.map-filter-ico svg { width: 18px; height: 18px; }
.map-filter-n { font-size: 12px; opacity: .75; }
.map-near { min-height: 40px; }
.map-status { margin: 0; min-height: 1.4em; }
.map-near-list { flex: 1 1 100%; margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.map-near-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-near-item { display: inline-flex; gap: 8px; align-items: baseline; min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--fg); font: inherit; cursor: pointer; text-align: left; }
.map-near-item span { color: var(--muted); font-size: 14px; }
/* Fotos de visitantes en la ficha (v2.16) */
.visitor-photos { margin: 28px 0; }
.visitor-photo { margin: 0; }
.visitor-photo figcaption { font-size: 13px; margin-top: 4px; }
/* Bloque «Línea del tiempo» (v2.16, includes/page_blocks_design.php) */
.block-timeline { list-style: none; margin: 16px 0 0; padding: 0 0 0 28px; border-left: 3px solid var(--accent); display: grid; gap: 22px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -37px; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline-year { margin: 0 0 2px; font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.timeline-body h3 { margin: 0 0 4px; font-size: 18px; }
.timeline-body p { margin: 0 0 8px; }
