/* Estilos comunes de las calculadoras (herramientas) de Sabiduria Natural */
.calc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 44px rgba(46, 113, 59, 0.08);
}
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}
.calc-campo label, .calc-campo .calc-etiqueta {
    display: block;
    font-weight: 700;
    color: var(--primary-strong);
    margin-bottom: 8px;
}
.calc-campo input, .calc-campo select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1.05rem;
    font-family: inherit;
}
.calc-campo input:focus, .calc-campo select:focus {
    outline: 2px solid var(--accent);
    border-color: var(--primary);
}
.calc-fila { display: flex; gap: 8px; }
.calc-fila[hidden] { display: none; }
.calc-fila input { flex: 1; min-width: 0; }
.calc-fila select { width: auto; flex: 0 0 auto; }
.calc-ancho { grid-column: 1 / -1; }
.calc-opciones { display: flex; gap: 8px; }
.calc-opciones label { flex: 1; margin: 0; position: relative; cursor: pointer; }
.calc-opciones input { position: absolute; opacity: 0; pointer-events: none; }
.calc-opciones span {
    display: block;
    text-align: center;
    padding: 11px 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 600;
}
.calc-opciones input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.calc-opciones input:focus-visible + span { outline: 2px solid var(--accent); }
.calc-boton {
    margin-top: 22px;
    width: 100%;
    padding: 15px 28px;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    font-family: inherit;
}
.calc-boton:hover { background: var(--primary-strong); }
.calc-error {
    display: none;
    margin: 16px 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: #fdecea;
    color: #8a2a1f;
    font-weight: 600;
}
.calc-privacidad { margin: 14px 0 0; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

.resultado { display: none; margin-top: 28px; }
.resultado.visible { display: grid; gap: 20px; }
.res-caja {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px 28px;
    box-shadow: 0 14px 30px rgba(34, 65, 38, 0.08);
}
.res-caja h3 { margin: 0 0 6px; color: var(--primary-strong); }
.res-cifra {
    font-family: var(--fuente-titulos);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}
.res-cifra small { font-family: var(--fuente-texto); font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.res-categoria {
    display: inline-block;
    margin: 8px 0 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
}
.cat-bajo { background: #e3f0fb; color: #1d5b8f; }
.cat-normal { background: #e2f3e0; color: var(--primary-strong); }
.cat-sobre { background: #fdf1d8; color: #8a5a00; }
.cat-obes { background: #fde4de; color: #9a2e1c; }

.barra-imc { position: relative; margin: 8px 0 30px; }
.barra-imc-tramos { display: flex; height: 14px; border-radius: 999px; overflow: hidden; }
.barra-imc-tramos span:nth-child(1) { flex: 3.5; background: #8cc0e8; }
.barra-imc-tramos span:nth-child(2) { flex: 6.5; background: #86c98a; }
.barra-imc-tramos span:nth-child(3) { flex: 5; background: #f2c86b; }
.barra-imc-tramos span:nth-child(4) { flex: 10; background: #ee9a86; }
.barra-imc-marca {
    position: absolute;
    top: -5px;
    width: 6px;
    height: 24px;
    margin-left: -3px;
    border-radius: 3px;
    background: var(--text);
    box-shadow: 0 0 0 2px #fff;
    transition: left 0.4s ease;
}
.barra-imc-numeros { position: relative; height: 18px; font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.barra-imc-numeros span { position: absolute; transform: translateX(-50%); }

.res-calorias { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.res-cal {
    background: var(--surface-soft);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
}
.res-cal.destacada { background: var(--primary); border-color: var(--primary); color: #fff; }
.res-cal-titulo { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.res-cal-cifra { font-family: var(--fuente-titulos); font-size: 1.9rem; font-weight: 700; line-height: 1.2; margin: 6px 0 2px; }
.res-cal-nota { font-size: 0.82rem; opacity: 0.85; line-height: 1.4; }
.res-aviso {
    margin: 16px 0 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent);
    background: var(--surface-soft);
    border-radius: 10px;
    font-size: 0.93rem;
}

.explicacion h2 { color: var(--primary-strong); margin-top: 36px; }
.explicacion table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; background: var(--surface); border-radius: 14px; overflow: hidden; }
.explicacion th, .explicacion td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.explicacion th { background: var(--surface-soft); color: var(--primary-strong); }
.fuentes li { margin-bottom: 8px; font-size: 0.93rem; }

/* En el móvil la calculadora va primero, no la barra lateral */
@media (max-width: 900px) {
    .barra-lateral { order: 0; }
}
@media (max-width: 640px) {
    .calc { padding: 20px; }
    .calc-grid { grid-template-columns: 1fr; }
    .res-calorias { grid-template-columns: 1fr; }
    .res-cifra { font-size: 2.5rem; }
}

/* Buscador de las listas largas (sitio/estaticos/buscador.js) */
.buscador { position: relative; width: 100%; }
.buscador-campo {
    width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--surface-soft); color: var(--text); font-size: 1rem; font-family: inherit;
}
.buscador-campo:focus { outline: 3px solid rgba(47, 127, 57, 0.25); border-color: var(--primary); background: var(--surface); }
.buscador-lista {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px;
    list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 16px 36px rgba(34, 65, 38, 0.16); max-height: 320px; overflow-y: auto;
}
.buscador-lista li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer; line-height: 1.35;
}
.buscador-lista li small { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; }
.buscador-lista li[aria-selected="true"], .buscador-lista li:hover { background: var(--surface-soft); color: var(--primary-strong); }
.buscador-lista .buscador-nada { color: var(--text-muted); cursor: default; }
.anadir-fila .buscador-campo {
    border: 1px dashed var(--primary); background: var(--surface); color: var(--primary-strong); font-weight: 600;
}
.anadir-fila .buscador-campo::placeholder { color: var(--primary-strong); opacity: 0.85; }
