/* Pidolisto - estilos de la pagina de inicio */

:root {
  --brand: #1f6f4a;
  --on-brand: #ffffff;
  --brand-deep: color-mix(in srgb, var(--brand) 68%, #000);
  --brand-tint: color-mix(in srgb, var(--brand) 10%, #fff);
  --bg: color-mix(in srgb, var(--brand) 5%, #f6f6f3);
  --paper: #ffffff;
  --ink: #15201a;
  --muted: #59665e;
  --line: #dde3de;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.45 var(--font); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Cabecera: menu a la izquierda, logo al centro, accion a la derecha ---------- */
.cab { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.cab-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1160px;
  height: 64px;
  margin: 0 auto;
  padding: 0 14px;
}
.nav { display: none; gap: 4px; }
.nav a, .menu-movil a { padding: 8px 12px; font-weight: 600; text-decoration: none; border-radius: 10px; }
.nav a:hover, .menu-movil a:hover { background: var(--brand-tint); }
.logo { display: flex; align-items: center; justify-content: center; min-width: 0; text-decoration: none; }
.logo-img { display: block; width: auto; max-width: 150px; height: 40px; object-fit: contain; }
.logo-txt { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.03em; color: var(--brand-deep); }
.cab-der { display: flex; justify-content: flex-end; }
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 999px;
}
.burger { position: relative; width: 44px; height: 44px; margin-left: -8px; background: none; border: 0; border-radius: 12px; }
.burger span, .burger span::before, .burger span::after {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  content: "";
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.18s, top 0.18s, opacity 0.18s;
}
.burger span { top: 21px; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
.menu-movil { display: grid; padding: 4px 14px 12px; border-top: 1px solid var(--line); }
.menu-movil a { padding: 12px; font-size: 1.0625rem; }

@media (min-width: 820px) {
  .cab-in { height: 76px; }
  .burger, .menu-movil { display: none !important; }
  .nav { display: flex; }
  .logo-img { height: 48px; max-width: 200px; }
  .logo-txt { font-size: 1.625rem; }
  .cta { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; }
}

/* ---------- Buscador ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 0 14px 56px; }
.busqueda { padding: 34px 0 10px; text-align: center; }
.busqueda h1 {
  max-width: 20ch;
  margin: 0 auto 18px;
  font-size: clamp(1.75rem, 6.2vw, 2.875rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.filtros { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 680px; margin: 12px auto 0; }
.filtros[hidden] { display: none; }
.filtro select { min-height: 42px; padding: 0 34px 0 14px; font: inherit; font-size: 0.9375rem; color: var(--ink); background-color: #fff; border: 2px solid transparent; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); max-width: 100%; }
.filtro select:focus { border-color: var(--brand); outline: none; }
.filtros .texto { min-height: 42px; padding: 0 10px; font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--brand-deep); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.buscar { max-width: 680px; margin: 0 auto; }
.buscar input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 22px;
  font-size: 1.0625rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(21, 32, 26, 0.06);
  -webkit-appearance: none;
  appearance: none;
}
.buscar input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- Bloques ---------- */
.bloque { margin-top: 34px; }
.bloque h2 { margin: 0 0 14px; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.bloque h3 { margin: 22px 0 10px; font-size: 1rem; color: var(--muted); font-weight: 700; }
.bloque-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bloque-cab h2 { min-width: 0; overflow-wrap: anywhere; }
.texto { flex: none; padding: 6px 0; font-weight: 600; color: var(--brand-deep); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.vacio { margin: 8px 0; color: var(--muted); }

/* ---------- Categorias: fotos grandes, el nombre sobre la imagen ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: var(--brand-tint);
  border: 0;
  border-radius: var(--radius);
  isolation: isolate;
}
.tile img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.tile:hover img { transform: scale(1.04); }
.tile::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(to top, rgba(8, 16, 12, 0.78), rgba(8, 16, 12, 0.05) 62%); }
.tile-ini { position: absolute; inset: 0; z-index: -2; display: grid; place-items: center; font-size: 4.5rem; font-weight: 800; color: color-mix(in srgb, var(--brand) 45%, #fff); background: var(--brand-tint); }
.tile-txt { position: absolute; right: 12px; bottom: 11px; left: 12px; display: grid; gap: 1px; }
.tile-txt strong { font-size: 1.125rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-txt span { font-size: 0.8125rem; opacity: 0.88; }
.tile.activo { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--brand); }
.tile.activo::before {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 26px;
  height: 26px;
  content: "✓";
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 50%;
}
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(4, 1fr); } .tile-txt strong { font-size: 1.25rem; } }

/* ---------- Tiendas ---------- */
.lista-tiendas { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lista-tiendas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .lista-tiendas { grid-template-columns: repeat(3, 1fr); } }
.tienda {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.tienda:hover { border-color: var(--brand); }
.tienda-marca { flex: none; display: grid; place-items: center; width: 52px; height: 52px; overflow: hidden; font-size: 1.375rem; font-weight: 800; color: var(--brand-deep); background: var(--brand-tint); border-radius: 12px; }
.tienda-marca img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tienda-dato { display: grid; min-width: 0; }
.tienda-dato strong { overflow-wrap: anywhere; line-height: 1.2; }
.tienda-dato span { font-size: 0.875rem; color: var(--muted); }

/* ---------- Productos encontrados ---------- */
.grid-prod { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid-prod { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .grid-prod { grid-template-columns: repeat(4, 1fr); } }
.prod { display: block; overflow: hidden; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.prod:hover { border-color: var(--brand); }
.prod-foto { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; font-size: 2.5rem; font-weight: 800; color: var(--brand-deep); background: var(--brand-tint); }
.prod-foto img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.prod-foto em { position: absolute; top: 8px; left: 8px; padding: 2px 9px; font-size: 0.75rem; font-style: normal; font-weight: 700; color: #fff; background: var(--ink); border-radius: 999px; }
.prod.agotado .prod-foto img { opacity: 0.55; }
.prod-dato { display: grid; gap: 2px; padding: 10px 12px 12px; }
.prod-dato strong { font-size: 0.9375rem; line-height: 1.25; overflow-wrap: anywhere; }
.precio { font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.de { font-size: 0.8125rem; color: var(--muted); }

/* ---------- Planes ---------- */
.planes { margin: 24px 0 0; padding: 48px 14px 52px; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.planes-in { max-width: 1160px; margin: 0 auto; }
.planes h2 { margin: 0; font-size: clamp(1.5rem, 4.4vw, 2.125rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.planes-sub { max-width: 56ch; margin: 8px 0 0; color: var(--muted); }
.planes-grid { display: grid; gap: 14px; margin-top: 26px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .planes-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.plan { display: flex; flex-direction: column; padding: 22px 20px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.plan h3 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-desc { margin: 4px 0 0; font-size: 0.9375rem; color: var(--muted); }
.plan-precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 16px 0 14px; }
.precio-monto { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.precio-per, .precio-consulta { color: var(--muted); font-weight: 600; }
.precio-consulta { font-size: 1.25rem; color: var(--ink); font-weight: 800; }
.plan ul { flex: 1; margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; align-content: start; }
.plan li { position: relative; padding-left: 26px; }
.plan li::before { position: absolute; top: 0.3em; left: 0; width: 14px; height: 8px; content: ""; border: solid var(--brand); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0.9); }
.plan.destacado { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.plan.destacado .plan-desc, .plan.destacado .precio-per { color: inherit; opacity: 0.85; }
.plan.destacado .precio-consulta { color: inherit; }
.plan.destacado li::before { border-color: currentColor; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; font-weight: 700; text-align: center; text-decoration: none; color: var(--on-brand); background: var(--brand); border-radius: 999px; }
.plan.destacado .btn { color: var(--brand-deep); background: #fff; }

/* ---------- Pie ---------- */
.pie { padding: 40px 14px 28px; color: #d8e0db; background: var(--ink); }
.pie-in { display: grid; gap: 22px; max-width: 1160px; margin: 0 auto; }
.pie-marca strong { font-size: 1.375rem; letter-spacing: -0.02em; color: #fff; }
.pie-logo { display: block; width: auto; max-width: 180px; height: 52px; padding: 6px 10px; object-fit: contain; background: #fff; border-radius: 12px; }
.pie-marca p { max-width: 44ch; margin: 8px 0 0; color: #aab6ae; }
.pie nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-content: start; }
.pie nav a { padding: 6px 0; text-decoration: none; }
.pie nav a:hover { text-decoration: underline; }
.pie-texto { max-width: 1160px; margin: 28px auto 0; padding-top: 18px; font-size: 0.875rem; color: #8d9a92; border-top: 1px solid rgba(255, 255, 255, 0.12); }
@media (min-width: 820px) { .pie-in { grid-template-columns: 1fr auto; align-items: start; } .pie nav { justify-content: flex-end; max-width: 520px; } }

/* ---------- Paginacion y ventana de categoria ---------- */
.pag { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 0.9375rem; color: var(--muted); }
.pag button {
  min-width: 112px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  color: var(--brand-deep);
  background: #fff;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
}
.pag button:disabled { color: var(--muted); border-color: var(--line, #dde3de); background: transparent; cursor: not-allowed; }
.pag span { font-variant-numeric: tabular-nums; text-align: center; }
body.modal { overflow: hidden; }
dialog.grupo { width: 100%; max-width: 680px; max-height: 92dvh; margin: auto 0 0; padding: 0; overflow: visible; color: inherit; background: transparent; border: 0; }
@media (min-width: 720px) { dialog.grupo { margin: auto; } }
dialog.grupo::backdrop { background: rgba(15, 25, 20, 0.55); }
dialog.grupo[open] { animation: g-sube 0.22s ease-out; }
@keyframes g-sube { from { transform: translateY(24px); opacity: 0; } }
.g-hoja { display: flex; flex-direction: column; max-height: 92dvh; overflow: hidden; background: #fff; border-radius: 20px 20px 0 0; }
@media (min-width: 720px) { .g-hoja { border-radius: 20px; } }
.g-cab { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid #e3e8e4; }
.g-cab h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.g-cab p { margin: 2px 0 0; font-size: 0.875rem; color: var(--muted); }
.g-cab > div:nth-child(2) { flex: 1; min-width: 0; }
.g-img { flex: none; display: grid; place-items: center; width: 64px; height: 48px; overflow: hidden; font-weight: 800; color: var(--brand-deep); background: var(--brand-tint); border-radius: 10px; }
.g-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-x { flex: none; width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; color: inherit; background: transparent; border: 1px solid #dde3de; border-radius: 50%; cursor: pointer; }
.g-cuerpo { flex: 1; padding: 14px 16px; overflow-y: auto; overscroll-behavior: contain; }
.lista-tiendas.una { grid-template-columns: 1fr; }
.g-pie { flex: none; padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #e3e8e4; }
.g-pie .pag { margin-top: 10px; }

/* ---------- Contenido editable (bloques de la portada y subpaginas) ---------- */
.zona { max-width: 1160px; margin: 0 auto; }
.zona:empty { display: none; }
.zona .contenido { margin-top: 28px; }
main.pagina { min-height: 55vh; padding-top: 28px; }
.contenido { overflow-wrap: anywhere; line-height: 1.6; }
.contenido > :first-child { margin-top: 0; }
.contenido h1 { margin: 0 0 14px; font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.contenido h2 { margin: 28px 0 10px; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
.contenido h3 { margin: 22px 0 8px; font-size: 1.1875rem; font-weight: 800; }
.contenido h4, .contenido h5, .contenido h6 { margin: 18px 0 6px; font-size: 1rem; }
.contenido p { margin: 0 0 14px; max-width: 70ch; }
.contenido ul, .contenido ol { margin: 0 0 14px; padding-left: 1.3em; max-width: 70ch; }
.contenido li { margin: 4px 0; }
.contenido a { color: var(--brand-deep); text-underline-offset: 2px; }
.contenido img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
.contenido figure { margin: 0 0 16px; }
.contenido figcaption { margin-top: 6px; font-size: 0.875rem; color: var(--muted); }
.contenido blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 4px solid var(--brand); color: var(--muted); }
.contenido hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.contenido table { width: 100%; margin: 0 0 16px; border-collapse: collapse; }
.contenido th, .contenido td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.contenido iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); }
.contenido pre { overflow-x: auto; padding: 12px; background: var(--brand-tint); border-radius: 10px; }
/* Clases listas para usar en tu HTML */
.contenido .centrado { text-align: center; }
.contenido .centrado p, .contenido .centrado ul { margin-left: auto; margin-right: auto; }
.contenido .boton { display: inline-block; padding: 12px 22px; font-weight: 800; color: var(--on-brand); text-decoration: none; background: var(--brand); border-radius: 999px; }
.contenido .boton:hover { filter: brightness(1.08); }
.contenido .boton.claro { color: var(--brand-deep); background: var(--brand-tint); }
.contenido .banda { padding: 28px 20px; background: var(--brand-tint); border-radius: var(--radius); }
.contenido .oscuro { padding: 28px 20px; color: #fff; background: var(--ink); border-radius: var(--radius); }
.contenido .oscuro a { color: #fff; }
.contenido .cols { display: grid; gap: 20px; align-items: center; }
.contenido .tarjetas { display: grid; gap: 14px; }
.contenido .tarjetas > * { padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.contenido .tarjetas > * > :last-child { margin-bottom: 0; }
@media (min-width: 720px) {
  .contenido .cols { grid-template-columns: 1fr 1fr; gap: 32px; }
  .contenido .tarjetas { grid-template-columns: repeat(3, 1fr); }
  .contenido .tarjetas.dos { grid-template-columns: repeat(2, 1fr); }
}
.zona .contenido .banda, .zona .contenido .oscuro { margin-left: 0; margin-right: 0; }
body.sub .pie { margin-top: 0; }
#z-abajo { padding: 0 14px 40px; }

/* formulario "Solicitar mi tienda" */
.sol-form { display: grid; gap: 12px; align-content: start; padding: 4px 18px 22px; }
.sol-form .cmp { display: grid; gap: 4px; font-weight: 700; font-size: 0.9375rem; }
.sol-form input, .sol-form select, .sol-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #c8d0ca; border-radius: 12px; }
.sol-form textarea { min-height: 84px; resize: vertical; }
.sol-form input:focus, .sol-form select:focus, .sol-form textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cmp-fila { display: grid; gap: 12px; }
@media (min-width: 520px) { .cmp-fila { grid-template-columns: 1fr 1fr; } }
.sol-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sol-error { margin: 0; min-height: 1.2em; color: #b3261e; font-weight: 600; }
.sol-wa { margin: 0; text-align: center; color: var(--muted); }
.sol-listo { display: grid; gap: 14px; padding: 8px 18px 24px; }
.plan .btn + .plan-wa { margin-top: 10px; text-align: center; }
button.btn { width: 100%; font: inherit; font-weight: 700; border: 0; cursor: pointer; }
button.btn:disabled { opacity: 0.6; cursor: default; }
.plan.destacado .plan-wa { color: inherit; }
