/* MaxiTiendas.es — estilo base, sin dependencias. Móvil primero.
   Identidad de marca (MARCA.md, 1-nov-2026): el sistema de la familia Maxi con los mismos nombres de variables que maxiservicios.es;
   solo cambian el principal (azul petróleo #297895) y el profundo (cuero #54412d, desde el 1-nov-2026 por la tarde; antes, pizarra).
   Tema oscuro con [data-theme="dark"], que pone el
   guion del <head> (preferencia guardada o la del sistema), y con la del sistema si no hay JavaScript. */
:root {
  color-scheme: light;
  --accent: #e8a455; --bg-body: #fdf8f2; --bg-dark: #2b241c; --bg-dark-soft: #54412d;
  --bg-sticky-bar: rgba(255, 253, 250, 0.96); --bg-surface: #fffdfa; --border: #eadccb; --border-strong: #dcc7b1;
  --brand-badge-bg: linear-gradient(135deg, #5aa8c4, #297895); --brand-deep: #54412d;
  --breadcrumbs-link: #3d3028; --breadcrumbs-text: #8a7b6e; --card-hover-border: #a3d2e3;
  --danger: #b42318; --danger-bg: #fbe9e4; --emerald: #2e6b4f; --emerald-bg: #e3efe7;
  --header-bg: #fffdfa; --header-border: #eadccb; --header-brand: #2b241c;
  --header-search-bg: #f6eee4; --header-search-border: #eadccb; --header-search-placeholder: #8a7b6e; --header-search-text: #2b241c;
  --hero-bg: radial-gradient(circle at 85% 20%, rgba(90, 168, 196, 0.10) 0%, transparent 45%), linear-gradient(180deg, #fffdfa 0%, #f8efe4 100%);
  --hero-border: #eadccb; --hero-box-bg: rgba(255, 253, 250, 0.92); --hero-box-border: #eadccb;
  --hero-box-shadow: 0 12px 30px -6px rgba(61, 48, 40, 0.10); --hero-lead: #5e5047;
  --hero-pill-bg: #fffdfa; --hero-pill-border: #eadccb; --hero-pill-text: #3d3028; --hero-text: #2b241c;
  --max-w: 1240px; --on-urgent: #ffffff;
  --primary: #297895; --primary-hover: #206078; --primary-rgb: 41 120 149; --primary-solid: #297895; --primary-solid-hover: #206078;
  --radius-lg: 14px; --radius-md: 10px;
  --shadow-md: 0 10px 25px -5px rgba(61, 48, 40, 0.10); --shadow-sm: 0 1px 3px rgba(61, 48, 40, 0.07);
  --spec-bg: #f4f1ee; --spec-border: #dcd3c9; --spec-text: #54412d;
  --text-light: #776a5e; --text-main: #2b241c; --text-muted: #5e5047; --urgent: #b42318; --urgent-bg: #fbe9e4;
  --marca-maxi: #2C2C2A;   /* «maxi» del logotipo */
}
[data-theme="dark"] {
  color-scheme: dark;
  --accent: #e8a455; --bg-body: #262629; --bg-dark: #1c1c1e; --bg-dark-soft: #3a3a3d;
  --bg-sticky-bar: rgba(48, 48, 51, 0.96); --bg-surface: #303033; --border: #444447; --border-strong: #55524f;
  --brand-badge-bg: linear-gradient(135deg, #5aa8c4, #297895); --brand-deep: #65503c;
  --breadcrumbs-link: #d3cabf; --breadcrumbs-text: #9a9187; --card-hover-border: #43778a;
  --danger: #f19383; --danger-bg: rgba(180, 35, 24, 0.24); --emerald: #8fc4a0; --emerald-bg: rgba(122, 170, 139, 0.2);
  --header-bg: #1c1c1e; --header-border: #444447; --header-brand: #f4ede4;
  --header-search-bg: #303033; --header-search-border: #4a4a4d; --header-search-placeholder: #9a9187; --header-search-text: #f4ede4;
  --hero-bg: radial-gradient(circle at 85% 20%, rgba(90, 168, 196, 0.16) 0%, transparent 45%), linear-gradient(135deg, #1c1c1e 0%, #2b2b2e 100%);
  --hero-border: rgba(255, 255, 255, 0.08); --hero-box-bg: rgba(255, 255, 255, 0.06); --hero-box-border: rgba(255, 255, 255, 0.12);
  --hero-box-shadow: none; --hero-lead: #d3cabf; --hero-pill-bg: rgba(255, 255, 255, 0.08); --hero-pill-border: rgba(255, 255, 255, 0.14);
  --hero-pill-text: #f4ede4; --hero-text: #f4ede4; --on-urgent: #2b1a0a;
  --primary: #64bfe0; --primary-hover: #84d0eb; --primary-rgb: 100 191 224; --primary-solid: #277795; --primary-solid-hover: #1f647d;
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --spec-bg: rgba(170, 147, 122, 0.16); --spec-border: rgba(170, 147, 122, 0.32); --spec-text: #cdbca9;
  --text-light: #a89f95; --text-main: #f4ede4; --text-muted: #bdb3a8; --urgent: #f0a266; --urgent-bg: rgba(232, 164, 85, 0.14);
  --marca-maxi: #f4ede4;
}
/* Sin JavaScript: el modo del sistema (los mismos valores que [data-theme="dark"]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #e8a455; --bg-body: #262629; --bg-dark: #1c1c1e; --bg-dark-soft: #3a3a3d;
    --bg-sticky-bar: rgba(48, 48, 51, 0.96); --bg-surface: #303033; --border: #444447; --border-strong: #55524f;
    --brand-badge-bg: linear-gradient(135deg, #5aa8c4, #297895); --brand-deep: #65503c;
    --breadcrumbs-link: #d3cabf; --breadcrumbs-text: #9a9187; --card-hover-border: #43778a;
    --danger: #f19383; --danger-bg: rgba(180, 35, 24, 0.24); --emerald: #8fc4a0; --emerald-bg: rgba(122, 170, 139, 0.2);
    --header-bg: #1c1c1e; --header-border: #444447; --header-brand: #f4ede4;
    --header-search-bg: #303033; --header-search-border: #4a4a4d; --header-search-placeholder: #9a9187; --header-search-text: #f4ede4;
    --hero-bg: radial-gradient(circle at 85% 20%, rgba(90, 168, 196, 0.16) 0%, transparent 45%), linear-gradient(135deg, #1c1c1e 0%, #2b2b2e 100%);
    --hero-border: rgba(255, 255, 255, 0.08); --hero-box-bg: rgba(255, 255, 255, 0.06); --hero-box-border: rgba(255, 255, 255, 0.12);
    --hero-box-shadow: none; --hero-lead: #d3cabf; --hero-pill-bg: rgba(255, 255, 255, 0.08); --hero-pill-border: rgba(255, 255, 255, 0.14);
    --hero-pill-text: #f4ede4; --hero-text: #f4ede4; --on-urgent: #2b1a0a;
    --primary: #64bfe0; --primary-hover: #84d0eb; --primary-rgb: 100 191 224; --primary-solid: #277795; --primary-solid-hover: #1f647d;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --spec-bg: rgba(170, 147, 122, 0.16); --spec-border: rgba(170, 147, 122, 0.32); --spec-text: #cdbca9;
    --text-light: #a89f95; --text-main: #f4ede4; --text-muted: #bdb3a8; --urgent: #f0a266; --urgent-bg: rgba(232, 164, 85, 0.14);
    --marca-maxi: #f4ede4;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text-main); background: var(--bg-body);
  -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
.ancho { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }

/* Cabecera: logotipo de la guía de marca v1.1 (SVG con el texto en Figtree pasado a trazados; maestros en maxizona.es/marca):
   la lupa y «tiendas» toman currentColor (el principal) y «maxi», --logo-maxi. Y botón de modo claro u oscuro */
.cabecera { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.cabecera .ancho { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.marca { display: inline-flex; align-items: center; color: var(--primary); --logo-maxi: var(--marca-maxi); }
.marca:hover { text-decoration: none; color: var(--primary); }
.logotipo { display: block; height: 46px; width: auto; aspect-ratio: 262.03 / 60; flex-shrink: 0; }
.marca:hover .logotipo { opacity: .85; }
.tema { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex-shrink: 0; cursor: pointer;
  color: var(--header-brand); background: var(--header-search-bg); border: 1px solid var(--header-search-border); border-radius: 999px; }
.tema:hover { border-color: var(--primary); }
.tema svg { width: 18px; height: 18px; }
.tema .sol { display: none; }
[data-theme="dark"] .tema .sol { display: block; }
[data-theme="dark"] .tema .luna { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tema .sol { display: block; }
  :root:not([data-theme="light"]) .tema .luna { display: none; }
}

.migas { font-size: .875rem; color: var(--breadcrumbs-text); padding-top: 12px; }
.migas a { color: var(--breadcrumbs-link); }
main { padding-top: 8px; padding-bottom: 32px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 16px 0 4px; color: var(--text-main); }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.entrada { color: var(--text-muted); margin: 0 0 16px; }
.cuenta { color: var(--text-light); font-size: .85em; }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.bloque { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.lista-enlaces { list-style: none; margin: 0; padding: 0; }
.lista-enlaces li { padding: 3px 0; }
.columnas { columns: 1; column-gap: 24px; }
@media (min-width: 600px) { .columnas { columns: 2; } }
@media (min-width: 900px) { .columnas { columns: 3; } }
.listado { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tarjeta { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; display: flex;
  flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.tarjeta:hover { border-color: var(--card-hover-border); }
.tarjeta-nombre { font-weight: 700; font-size: 1.05rem; }
.tarjeta-cat, .tarjeta-dir, .tarjeta-nota { font-size: .9rem; color: var(--text-muted); }
.aviso { color: var(--urgent); font-weight: 600; font-size: .9rem; }
.paginacion { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 20px 0; }
.ficha { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 4px 20px 20px; box-shadow: var(--shadow-sm); }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.datos dt { color: var(--text-muted); }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.horario { border-collapse: collapse; }
.horario th { text-align: left; font-weight: 500; padding: 3px 16px 3px 0; color: var(--text-muted); }
.horario td { padding: 3px 0; }
.abierto { color: var(--emerald); font-weight: 600; margin: 0; }
.cerrado { color: var(--danger); font-weight: 600; margin: 0; }
.etiquetas { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.etiquetas li { background: var(--spec-bg); border: 1px solid var(--spec-border); color: var(--spec-text); border-radius: 999px; padding: 2px 10px; font-size: .875rem; }
.titular { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .875rem; color: var(--text-muted); }
.pie { border-top: 1px solid var(--header-border); background: var(--header-bg); font-size: .875rem; color: var(--text-muted); padding: 12px 0; }
.legal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 4px 20px 20px; max-width: 820px; }
.legal li { margin: 4px 0; }
.tabla-scroll { overflow-x: auto; }
.tabla-scroll table { border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.tabla-scroll th, .tabla-scroll td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.alerta { padding: 10px 12px; border-radius: 8px; }
.alerta.bien { background: var(--emerald-bg); color: var(--emerald); }
.alerta.mal { background: var(--danger-bg); color: var(--danger); }
.opcion { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 14px; margin: 12px 0; }
.opcion summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.formulario { display: grid; gap: 10px; max-width: 460px; margin: 8px 0; }
.formulario label { display: grid; gap: 4px; font-weight: 600; }
.formulario input, .formulario textarea { font: inherit; padding: 8px; color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: 6px; }
.formulario input:focus, .formulario textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.15); }
.formulario button { font: inherit; font-weight: 700; padding: 10px 14px; border: 0; border-radius: 8px; background: var(--primary-solid); color: #fff;
  cursor: pointer; justify-self: start; }
.formulario button:hover { background: var(--primary-solid-hover); }
.cebo { position: absolute; left: -9999px; }
.nota { font-size: .85rem; color: var(--text-light); }
.ver-tel { font: inherit; font-weight: 600; color: var(--primary); background: var(--bg-surface); border: 1px solid var(--primary); border-radius: 8px;
  padding: 3px 10px; cursor: pointer; }
.ver-tel:hover { background: rgb(var(--primary-rgb) / 0.08); }
.ver-tel small { font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.tel-visible { font-weight: 600; }
.tarjeta .ver-tel, .tarjeta .tel-visible { align-self: flex-start; margin-top: 6px; font-size: .9rem; }

/* Buscador (partes/buscador.php y assets/buscar.js): grande en la portada y en /buscar, pequeño en la cabecera */
.buscador { position: relative; display: flex; align-items: center; gap: 6px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 999px; }
.buscador:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.15); }
.buscador > svg { flex: none; width: 18px; height: 18px; margin-left: 14px; color: var(--text-light); }
.buscador input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--text-main); padding: 8px 2px; outline: none; }
.buscador input::placeholder { color: var(--header-search-placeholder); }
.buscador button { flex: none; margin: 4px; border: 0; border-radius: 999px; background: var(--primary-solid); color: #fff; font: inherit; font-weight: 700;
  padding: 8px 16px; cursor: pointer; }
.buscador button:hover { background: var(--primary-solid-hover); }
.h-search { max-width: 40rem; box-shadow: var(--shadow-md); }
.h-search input { font-size: 1.05rem; padding: 12px 4px; }
.h-search button { padding: 12px 22px; }
.buscador-cabecera { flex: 1; max-width: 460px; background: var(--header-search-bg); border-color: var(--header-search-border); }
.buscador-cabecera input { color: var(--header-search-text); padding: 9px 2px; font-size: .95rem; }
.buscador-cabecera button { display: none; }
.sugerencias { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; list-style: none; margin: 0; padding: 6px 0; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); max-height: 70vh; overflow-y: auto; text-align: left; }
.sugerencias [role="option"] { display: flex; flex-direction: column; gap: 1px; padding: 8px 16px; cursor: pointer; }
.sugerencias [role="option"].activa, .sugerencias [role="option"]:hover { background: rgb(var(--primary-rgb) / 0.08); }
.sugerencias .s-t { color: var(--text-main); font-weight: 600; }
.sugerencias .s-c { font-size: .82rem; color: var(--text-muted); }
.sugerencias .s-grupo { padding: 8px 16px 2px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-light); }
.sugerencias .s-vacio { padding: 8px 16px; font-size: .9rem; color: var(--text-muted); }
@media (max-width: 640px) {
  .cabecera .ancho { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .buscador-cabecera { order: 3; flex-basis: 100%; max-width: none; }
}

/* Portada (paginas/inicio.php), como la de maxiservicios. Fotos de R2 (App\Domain\Imagenes): fondo del héroe y tarjetas de sector */
main.portada { padding: 0; }
.h-sector-foto { display: block; margin: -18px -20px 14px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.h-sector-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.h-sector-foto:hover img { transform: scale(1.03); }
/* Cabecera de las landings de familia y categoría (paginas/landing.php) */
.cabecera-foto { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); margin: 4px 0 8px; }
.cabecera-landing.con-foto { display: flex; flex-direction: column-reverse; }
.cabecera-landing .intro { color: var(--text-muted); max-width: 46rem; margin: 10px 0 18px; line-height: 1.6; }
@media (min-width: 720px) {
  .cabecera-landing.con-foto { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: center; }
  .cabecera-foto { margin: 16px 0 0; box-shadow: var(--shadow-md); }
}
.h-hero { background: var(--hero-bg); border-bottom: 1px solid var(--hero-border); padding: clamp(2rem, 5vw, 4rem) 0 clamp(2rem, 5vw, 3.5rem); }
.h-hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; color: var(--hero-text); margin: 0 0 16px; max-width: 24ch; }
.h-lead { font-size: 1.08rem; line-height: 1.6; color: var(--hero-lead); max-width: 38rem; margin: 0 0 24px; }
.h-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 18px; }
.h-chips-label { font-size: .85rem; color: var(--text-light); margin-right: 3px; }
.h-chip { font-size: .86rem; color: var(--hero-pill-text); padding: 5px 13px; border: 1px solid var(--hero-pill-border); border-radius: 999px; background: var(--hero-pill-bg); }
.h-chip:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
/* Héroe con foto a todo el ancho bajo un velo oscuro, más denso donde va el texto (como maxizona): texto claro en los dos temas */
.h-hero.con-foto { position: relative; isolation: isolate; overflow: hidden; background: var(--bg-dark); border-bottom: 0;
  padding: clamp(3rem, 9vw, 7rem) 0 clamp(3rem, 8vw, 6.5rem); }
.h-hero-fondo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.h-hero.con-foto::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(28, 22, 16, .86) 0%, rgba(28, 22, 16, .72) 50%, rgba(28, 22, 16, .25) 100%); }
.h-hero.con-foto h1 { color: #fffaf3; text-shadow: 0 1px 14px rgba(0, 0, 0, .3); }
.h-hero.con-foto .h-lead, .h-hero.con-foto .h-chips-label { color: #f4ede4; }
.h-hero.con-foto .h-chip { color: #fffaf3; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .32); }
.h-hero.con-foto .h-chip:hover { color: #fffaf3; background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .6); }
.h-hero.con-foto :focus-visible { outline-color: #fffaf3; }
@media (max-width: 720px) {
  .h-hero.con-foto::before { background: rgba(28, 22, 16, .72); }
}
.h-section { padding-top: clamp(2rem, 5vw, 3.5rem); }
.h-head { margin-bottom: 20px; }
.h-head h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -0.02em; font-weight: 800; margin: 0 0 6px; }
.h-head p { color: var(--text-muted); margin: 0; max-width: 40rem; }
.h-sectores { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.h-sector { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.h-sector:hover { border-color: var(--card-hover-border); box-shadow: var(--shadow-md); }
.h-sector h3 { font-size: 1.12rem; margin: 0 0 2px; }
.h-sector h3 a { color: var(--text-main); }
.h-sector h3 a:hover { color: var(--primary); text-decoration: none; }
.h-sector-n { font-size: .85rem; color: var(--text-light); margin: 0 0 12px; }
.h-sector ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; }
.h-sector li a { display: inline-block; font-size: .85rem; color: var(--text-main); background: var(--bg-body); border: 1px solid var(--border); padding: 4px 11px; border-radius: 999px; }
.h-sector li a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.h-more { margin-top: auto; font-size: .9rem; font-weight: 600; }
.h-ciudades { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.h-ciudad { display: block; padding: 14px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: box-shadow .2s, border-color .2s; }
.h-ciudad:hover { border-color: var(--card-hover-border); box-shadow: var(--shadow-md); text-decoration: none; }
.h-ciudad strong { display: block; color: var(--text-main); font-size: 1.02rem; }
.h-ciudad span { font-size: .85rem; color: var(--text-muted); }
.h-prov { background: var(--bg-dark-soft); color: #fff; padding: clamp(2rem, 5vw, 3.5rem) 0; margin-top: clamp(2rem, 5vw, 3.5rem); }
.h-prov .h-head h2 { color: #fff; }
.h-prov .h-head p { color: rgba(255, 255, 255, .75); }
.h-prov a { color: #fff; }
.h-prov .cuenta { color: rgba(255, 255, 255, .6); }
.busqueda .h-search { margin: 8px 0 20px; }
