/* Paleta: azul marino y celeste de la insignia de Dibujo Técnico + naranjo fuerte como acento.
   --navy = color de títulos/íconos · --primario = fondo de botones y elementos sólidos. */
:root {
  color-scheme: light;
  --navy: #2F486D;
  --navy-900: #1E3150;
  --primario: #2F486D;
  --primario-hover: #1E3150;
  --celeste: #569BD3;
  --celeste-200: #BFDCF2;
  --celeste-100: #E9F2F9;
  --naranjo: #FF6600;     /* acento naranjo fuerte */
  --casco: #FF6600;
  --casco-700: #B34700;   /* naranjo para texto sobre fondo claro */
  --naranjo-100: #FFEDE0;
  --naranjo-200: #FFC299;
  --aviso-texto: #7A2E00;
  --verde: #1F8A5B;
  --verde-texto: #1F8A5B;
  --verde-100: #E3F4EC;
  --rojo: #C2410C;
  --texto: #1B2A41;
  --texto-2: #51637D;
  --fondo: #FFFFFF;
  --card: #FFFFFF;
  --borde: #DCE7F2;
  --foto-bg: #E9F2F9;
  --topbar: rgba(233, 242, 249, .92);
  --sombra: 0 6px 20px rgba(47, 72, 109, .10);
  --radio: 18px;
  --tabbar: 68px;
}
/* Modo oscuro: automático según el celular, o forzado con el botón (data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #CFE2F5; --navy-900: #0A1422; --primario: #3D6FA8; --primario-hover: #4A7FBA;
    --celeste: #7DB6E6; --celeste-200: #2A4C74; --celeste-100: #1B3150;
    --casco-700: #FF9A57; --naranjo-100: #3A1F0B; --naranjo-200: #8A3E0B; --aviso-texto: #FFD3B3;
    --verde: #24935F; --verde-texto: #5FD3A0; --verde-100: #12362A; --rojo: #FF8A65;
    --texto: #E8EEF6; --texto-2: #A8B9CE; --fondo: #0E1A2B; --card: #16263C; --borde: #27405F;
    --topbar: rgba(14, 26, 43, .92); --sombra: 0 6px 20px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #CFE2F5; --navy-900: #0A1422; --primario: #3D6FA8; --primario-hover: #4A7FBA;
  --celeste: #7DB6E6; --celeste-200: #2A4C74; --celeste-100: #1B3150;
  --casco-700: #FF9A57; --naranjo-100: #3A1F0B; --naranjo-200: #8A3E0B; --aviso-texto: #FFD3B3;
  --verde: #24935F; --verde-texto: #5FD3A0; --verde-100: #12362A; --rojo: #FF8A65;
  --texto: #E8EEF6; --texto-2: #A8B9CE; --fondo: #0E1A2B; --card: #16263C; --borde: #27405F;
  --topbar: rgba(14, 26, 43, .92); --sombra: 0 6px 20px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 560px) {
  body { background: var(--celeste-100); }
  .app { box-shadow: 0 20px 60px rgba(30, 49, 80, .18); }
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app {
  max-width: 480px; min-height: 100dvh; margin: 0 auto; position: relative;
  background: var(--fondo);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
.logo-btn { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: var(--sombra); overflow: hidden; }
.logo-btn img { width: 36px; height: 36px; object-fit: contain; }
.topbar[data-inicio] .logo-btn { visibility: hidden; }

/* Botón flotante del asistente (boceto: burbuja "asistente virt." abajo a la derecha) */
.fab {
  position: fixed; z-index: 15; text-decoration: none;
  right: max(16px, calc(50% - 240px + 16px)); bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
}
.fab img { width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 3px solid var(--celeste); box-shadow: var(--sombra); object-fit: contain; }
.fab-burbuja { background: var(--primario); color: #fff; font-weight: 800; font-size: .78rem; padding: 7px 12px; border-radius: 14px 14px 4px 14px; box-shadow: var(--sombra); }
.fab[hidden] { display: none; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: var(--topbar); backdrop-filter: blur(8px);
}
.topbar[data-inicio] { background: transparent; backdrop-filter: none; position: absolute; left: 0; right: 0; }
.topbar-title { flex: 1; margin: 0; text-align: center; font-size: 1.15rem; font-weight: 900; color: var(--navy); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--card);
  display: grid; place-items: center; color: var(--navy); cursor: pointer; box-shadow: var(--sombra);
}
.icon-btn[hidden] { display: grid; visibility: hidden; }

.vista { padding: 4px 16px 96px; outline: none; }
.vista > * { animation: entrar .22s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Aviso referencial ---------- */
.ref {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  color: var(--casco-700); background: var(--naranjo-100); border: 1px solid var(--naranjo-200); border-radius: 999px; padding: 2px 8px;
}
.aviso {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--naranjo-100); border: 1px solid var(--naranjo-200); color: var(--aviso-texto);
  border-radius: 14px; padding: 10px 12px; font-size: .82rem; margin: 10px 0 14px;
}
.aviso svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Inicio ---------- */
.hero { text-align: center; padding: 56px 0 6px; }
.hero img { width: 132px; height: 132px; object-fit: contain; mix-blend-mode: multiply; }
.marca { font-size: 2.2rem; font-weight: 900; margin: 2px 0 0; letter-spacing: -.02em; color: var(--navy); line-height: 1.05; }
.marca span { color: var(--celeste); }
.lema { margin: 4px 0 0; font-weight: 800; color: var(--texto-2); }

.buscador {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 2px solid var(--borde); border-radius: 999px; padding: 6px 6px 6px 16px; margin: 18px 0 14px;
  box-shadow: var(--sombra);
}
.buscador:focus-within { border-color: var(--celeste); }
.buscador svg { color: var(--navy); flex: none; }
.buscador input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; min-width: 0; padding: 8px 0; }
.buscador button { border: 0; background: var(--primario); color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 800; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  border: 1px solid var(--borde); background: var(--card); border-radius: 999px; padding: 7px 12px;
  font-size: .85rem; font-weight: 700; color: var(--navy); cursor: pointer;
}
.chip:hover { border-color: var(--celeste); }

.seccion-titulo { font-size: 1rem; font-weight: 900; color: var(--navy); margin: 18px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tiendas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tienda-pill {
  background: var(--card); border: 1px solid var(--borde); border-radius: 16px; padding: 14px 6px; text-align: center;
  font-weight: 900; color: var(--navy); font-size: .9rem; box-shadow: var(--sombra); line-height: 1.15;
}
.tienda-pill small { display: block; font-weight: 700; color: var(--texto-2); font-size: .7rem; margin-top: 4px; }
.tienda-pill.local { background: linear-gradient(180deg, var(--card), var(--naranjo-100)); border-color: var(--naranjo-200); }

.accion {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 14px 16px; margin-top: 12px; box-shadow: var(--sombra); color: var(--texto); text-decoration: none;
}
.accion .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--celeste-100); color: var(--navy); flex: none; }
.accion b { display: block; font-size: 1rem; color: var(--navy); }
.accion small { color: var(--texto-2); font-weight: 600; }
.accion .flecha { margin-left: auto; color: var(--navy); }
.accion.primaria { background: var(--primario); border-color: var(--primario); color: #fff; }
.accion.primaria b, .accion.primaria .flecha, .accion.primaria small { color: #fff; }
.accion.primaria .ico { background: var(--naranjo); color: #fff; }
.accion.asistente { background: linear-gradient(120deg, var(--celeste-100), var(--card)); }
.accion.asistente .ico { background: var(--card); padding: 2px; overflow: hidden; }
.accion.asistente .ico img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }

.pie { text-align: center; color: var(--texto-2); font-size: .75rem; margin: 22px 0 4px; }
.pie button { background: none; border: 0; color: var(--celeste); font-weight: 800; cursor: pointer; text-decoration: underline; font-size: .75rem; }

/* ---------- Resultados ---------- */
.res-cab { margin: 6px 0 4px; }
.res-cab h2 { margin: 0; font-size: 1.15rem; color: var(--navy); font-weight: 900; }
.res-cab p { margin: 2px 0 0; color: var(--texto-2); font-size: .85rem; font-weight: 600; }
.material-grupo { margin: 16px 0 6px; }
.material-grupo > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.material-grupo > header h3 { margin: 0; font-size: 1rem; color: var(--navy); }
.link-btn { background: none; border: 0; color: var(--celeste); font-weight: 800; cursor: pointer; padding: 4px 0; font-size: .85rem; white-space: nowrap; }

.ficha {
  background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 14px; margin-bottom: 12px; position: relative;
}
.ficha.destacada { border: 2px solid var(--verde); }
.ficha-top { display: flex; gap: 12px; }
.ficha-img { width: 76px; height: 76px; border-radius: 14px; background: var(--foto-bg); display: grid; place-items: center; flex: none; }
.ficha-img svg { width: 56px; height: 56px; stroke-width: 1.4; }
.ficha-cuerpo { flex: 1; min-width: 0; }
.ficha-tienda { font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--celeste); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ficha-tienda .local-tag { background: var(--naranjo-100); color: var(--casco-700); border-radius: 6px; padding: 1px 6px; font-size: .65rem; }
.ficha h4 { margin: 2px 0 4px; font-size: .98rem; line-height: 1.2; color: var(--texto); }
.estrellas { font-size: .8rem; color: var(--texto-2); font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.estrellas .e { color: var(--casco); letter-spacing: -1px; font-size: .9rem; }
.precio-fila { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.precio { font-size: 1.45rem; font-weight: 900; color: var(--navy); }
.precio small { font-size: .78rem; color: var(--texto-2); font-weight: 700; }
.por-m2 { font-size: .8rem; color: var(--texto-2); font-weight: 700; }
.ficha-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: var(--celeste-100); color: var(--navy); }
.tag.verde { background: var(--verde-100); color: var(--verde-texto); }
.tag.casco { background: var(--naranjo-100); color: var(--casco-700); }
.ficha-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn {
  border: 0; border-radius: 12px; padding: 11px 12px; font-weight: 800; cursor: pointer; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; text-align: center;
}
.btn svg { width: 18px; height: 18px; }
.btn-primario { background: var(--primario); color: #fff; }
.btn-primario:hover { background: var(--primario-hover); }
.btn-sec { background: var(--celeste-100); color: var(--navy); }
.btn-sec:hover { background: var(--celeste-200); }
.btn-casco { background: var(--naranjo); color: #fff; }
.btn-bloque { width: 100%; padding: 14px; font-size: 1rem; border-radius: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

details.mas { margin-top: 10px; border-top: 1px dashed var(--borde); padding-top: 8px; }
details.mas summary { cursor: pointer; font-weight: 800; color: var(--navy); font-size: .85rem; list-style: none; }
details.mas summary::-webkit-details-marker { display: none; }
details.mas summary::after { content: " ▾"; }
details.mas[open] summary::after { content: " ▴"; }
.tabla-ficha { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 6px; }
.tabla-ficha th { text-align: left; color: var(--texto-2); font-weight: 700; padding: 4px 8px 4px 0; width: 42%; vertical-align: top; }
.tabla-ficha td { padding: 4px 0; font-weight: 700; }
.resena { background: var(--fondo); border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: .82rem; }
.resena b { color: var(--navy); }

.vacio { text-align: center; padding: 30px 10px; color: var(--texto-2); }
.vacio img { width: 110px; mix-blend-mode: multiply; opacity: .9; }
.vacio h3 { color: var(--navy); margin: 6px 0; }

/* ---------- Comparar ---------- */
.selector { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--borde); background: var(--card); font-weight: 800; color: var(--navy); }
.cmp-cab { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radio); padding: 14px; box-shadow: var(--sombra); margin: 12px 0; border: 1px solid var(--borde); }
.cmp-cab h2 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.cmp-cab p { margin: 2px 0 0; font-size: .82rem; color: var(--texto-2); font-weight: 600; }
.ganadores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ganador { border-radius: var(--radio); padding: 12px; color: #fff; background: var(--primario); box-shadow: var(--sombra); }
.ganador.pc { background: var(--verde); }
.ganador small { display: block; font-weight: 800; opacity: .9; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.ganador b { display: block; font-size: 1.05rem; margin-top: 4px; }
.ganador .precio-g { font-size: 1.3rem; font-weight: 900; }
.ganador em { font-style: normal; font-size: .75rem; opacity: .9; display: block; margin-top: 2px; }

.tabla-cmp { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .85rem; }
.tabla-cmp th { text-align: left; font-size: .7rem; text-transform: uppercase; color: var(--texto-2); font-weight: 800; padding: 0 6px; }
.tabla-cmp td { background: var(--card); padding: 10px 6px; font-weight: 700; border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); }
.tabla-cmp td:first-child { border-left: 1px solid var(--borde); border-radius: 12px 0 0 12px; padding-left: 10px; }
.tabla-cmp td:last-child { border-right: 1px solid var(--borde); border-radius: 0 12px 12px 0; }
.tabla-cmp tr.mejor-p td { background: var(--celeste-100); }
.tabla-cmp tr.mejor-pc td { background: var(--verde-100); }
.tabla-cmp .num { text-align: right; white-space: nowrap; }
.barra { height: 6px; border-radius: 99px; background: var(--celeste-100); margin-top: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); border-radius: 99px; }

.panel { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; box-shadow: var(--sombra); margin-top: 14px; }
.panel h3 { margin: 0 0 4px; color: var(--navy); font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel p { margin: 4px 0; font-size: .85rem; color: var(--texto-2); }
.grafico svg { width: 100%; height: auto; stroke-width: 2.5; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .75rem; font-weight: 700; color: var(--texto-2); margin-top: 6px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.leccion { background: var(--primario); color: #fff; border-radius: var(--radio); padding: 14px; margin-top: 14px; font-size: .9rem; }
.leccion b { color: #FFB27A; }

/* ---------- Cotización ---------- */
.item { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--borde); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.item .ficha-img { width: 54px; height: 54px; }
.item .ficha-img svg { width: 38px; height: 38px; }
.item-info { flex: 1; min-width: 0; }
.item-info b { display: block; font-size: .9rem; line-height: 1.2; }
.item-info small { color: var(--texto-2); font-weight: 700; font-size: .75rem; }
.item-info .sub { color: var(--navy); font-weight: 900; margin-top: 2px; }
.cantidad { display: flex; align-items: center; gap: 4px; }
.cantidad button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--borde); background: var(--fondo); cursor: pointer; font-weight: 900; color: var(--navy); }
.cantidad input { width: 40px; text-align: center; border: 0; font-weight: 900; background: transparent; }
.quitar { border: 0; background: none; color: var(--texto-2); cursor: pointer; padding: 4px; }
.quitar:hover { color: var(--rojo); }
.total-box { background: var(--celeste-100); border-radius: var(--radio); padding: 14px 16px; margin: 6px 0 12px; }
.total-box .fila { display: flex; justify-content: space-between; font-weight: 700; color: var(--texto-2); font-size: .9rem; margin: 3px 0; }
.total-box .fila.total { color: var(--navy); font-size: 1.3rem; font-weight: 900; margin-top: 8px; }
.por-tienda { font-size: .8rem; }
.botones { display: grid; gap: 10px; }
.guardadas li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--borde); font-size: .85rem; }
.guardadas ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Calculadora ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campo label { display: block; font-size: .78rem; font-weight: 800; color: var(--texto-2); margin-bottom: 4px; }
.campo input, .campo select { width: 100%; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--borde); background: var(--card); font-weight: 800; }
.campo input:focus, .campo select:focus { outline: 0; border-color: var(--celeste); }
.campo.full { grid-column: 1 / -1; }
.resultado-calc { display: grid; gap: 8px; margin-top: 10px; }
.res-linea { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--fondo); border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
.res-linea b { color: var(--navy); font-size: 1.05rem; white-space: nowrap; }
.res-linea small { display: block; color: var(--texto-2); font-weight: 600; }
.formula { font-size: .78rem; color: var(--texto-2); background: var(--fondo); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }

/* ---------- Asistente ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 76px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: .92rem; line-height: 1.4; }
.msg.bot { background: var(--card); border: 1px solid var(--borde); border-top-left-radius: 6px; align-self: flex-start; }
.msg.yo { background: var(--primario); color: #fff; border-top-right-radius: 6px; align-self: flex-end; }
.msg.bot .ref { margin-top: 6px; }
.bot-fila { display: flex; gap: 8px; align-items: flex-start; }
.bot-fila img { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--borde); object-fit: cover; flex: none; }
.sugerencias { display: grid; gap: 8px; margin-left: 46px; }
.sugerencias button { text-align: left; background: var(--card); border: 2px solid var(--celeste-200); color: var(--navy); border-radius: 14px; padding: 10px 12px; font-weight: 800; cursor: pointer; }
.sugerencias button:hover { border-color: var(--celeste); }
.chat-input {
  position: fixed; left: 50%; transform: translateX(-50%); width: min(480px, 100%);
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 10px 16px; background: linear-gradient(0deg, var(--fondo) 70%, transparent);
  display: flex; gap: 8px; z-index: 5;
}
.chat-input input { flex: 1; border-radius: 999px; border: 2px solid var(--borde); padding: 12px 16px; background: var(--card); outline: 0; min-width: 0; }
.chat-input input:focus { border-color: var(--celeste); }
.chat-input button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--primario); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }

/* ---------- Subir lista ---------- */
textarea.lista { width: 100%; min-height: 150px; border-radius: 14px; border: 2px solid var(--borde); padding: 12px; background: var(--card); resize: vertical; }
textarea.lista:focus { outline: 0; border-color: var(--celeste); }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--borde);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(47,72,109,.08);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; text-align: center;
  color: var(--texto-2); font-size: .66rem; font-weight: 800; line-height: 1.1; padding: 4px 0; position: relative;
}
.tab-ico { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--borde); display: grid; place-items: center; color: var(--navy); transition: .15s; }
.tab-ico svg { width: 20px; height: 20px; }
.tabbar a.activo { color: var(--navy); }
.tabbar a.activo .tab-ico { background: var(--primario); border-color: var(--primario); color: #fff; }
.badge { position: absolute; top: 0; right: calc(50% - 26px); background: var(--naranjo); color: #fff; font-size: .65rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- Tarjeta de producto (boceto: foto, descripción, $, Reseñas, Ir al producto) ---------- */
.foto { width: 96px; height: 96px; border-radius: 14px; background: var(--foto-bg); display: grid; place-items: center; flex: none; position: relative; overflow: hidden; }
.foto svg { width: 74px; height: 74px; stroke-width: 1.4; }
.foto figcaption { position: absolute; bottom: 0; left: 0; right: 0; font-size: .55rem; font-weight: 800; text-align: center; color: #51637D; background: rgba(255,255,255,.85); padding: 1px 0; }
.desc { font-size: .82rem; color: var(--texto-2); font-weight: 600; margin: 2px 0 4px; line-height: 1.3; }
.ficha-acciones.tres { grid-template-columns: 1fr 1fr; }
.ficha-acciones.tres .btn-primario { grid-column: 1 / -1; }

/* ---------- Hoja de reseñas ---------- */
.hoja-fondo { position: fixed; inset: 0; background: rgba(30,49,80,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--card); width: min(480px, 100%); max-height: 80dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: subir .2s ease-out; }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.hoja h3 { margin: 0 0 2px; color: var(--navy); }
.hoja .cerrar { float: right; border: 0; background: var(--celeste-100); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; color: var(--navy); font-weight: 900; }
.dist { display: grid; grid-template-columns: 34px 1fr 30px; gap: 6px; align-items: center; font-size: .78rem; font-weight: 700; color: var(--texto-2); margin: 3px 0; }
.dist .barra i { background: var(--naranjo); }

/* ---------- Mano de obra ---------- */
.mo-fila { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--borde); font-size: .86rem; }
.mo-fila:last-child { border-bottom: 0; }
.mo-fila input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primario); }
.mo-fila b { display: block; font-size: .88rem; }
.mo-fila small { color: var(--texto-2); font-weight: 700; }
.mo-fila .mo-cant { width: 58px; padding: 6px; border-radius: 8px; border: 1px solid var(--borde); text-align: center; font-weight: 800; }
.mo-fila .mo-sub { text-align: right; font-weight: 900; color: var(--navy); min-width: 82px; }
.mo-fila.off { opacity: .45; }
.subtitulo-seccion { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; font-weight: 900; color: var(--navy); }
.subtitulo-seccion span:last-child { font-size: .9rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px); transform: translate(-50%, 20px);
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: .88rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.ver { opacity: 1; transform: translate(-50%, 0); }

.solo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.badge[hidden] { display: none; }

/* ---------- Modo oscuro: logos con fondo propio ---------- */
:root[data-theme="dark"] .hero img, :root[data-theme="dark"] .vacio img, :root[data-theme="dark"] .accion.asistente .ico img {
  mix-blend-mode: normal; background: #fff; border-radius: 50%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero img, :root:not([data-theme="light"]) .vacio img, :root:not([data-theme="light"]) .accion.asistente .ico img {
    mix-blend-mode: normal; background: #fff; border-radius: 50%;
  }
}
.topbar-acciones { display: flex; gap: 8px; }
.tema-btn .sol { display: none; }
:root[data-theme="dark"] .tema-btn .sol { display: block; }
:root[data-theme="dark"] .tema-btn .luna { display: none; }

/* ---------- Pie de página con logos ---------- */
.pie-logos { margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--borde); text-align: center; color: var(--texto-2); font-size: .75rem; font-weight: 700; }
.pie-logos .logos { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 8px; }
.pie-logos img { height: 64px; width: auto; }
.pie-logos b { color: var(--navy); }
.topbar-acciones .icon-btn[hidden] { display: none; }
.video-proyecto { width: 100%; border-radius: var(--radio); background: #000; box-shadow: var(--sombra); display: block; aspect-ratio: 16 / 9; }
