/* =============================================================
   CALCULADORAS — Calculadora de IMC y Calculadora Cintura-Altura.
   Fuente única compartida entre page-calculadora.php y
   page-calculadora-cintura-altura.php (antes duplicado 1:1 como
   <style> inline en cada plantilla). Enqueue condicional por
   plantilla en functions.php (senda_theme_enqueue_assets()).
   ============================================================= */
.calculadora-main {
    grid-column: 1 / -1;
    background-color: var(--wp--preset--color--neutral-50, #fcfbf9);
    /* El padding-top que pedía dar aire respecto al nav fijo nunca llegaba a
       aplicarse: header.css fija padding-top:76px/78px con !important en
       .page-interior main, que gana siempre sobre este shorthand. El título
       quedaba a -3px del nav (ligeramente tapado). El aire real se añade
       como margin-top en .calculadora-header, más abajo. */
    padding: 0 24px 80px 24px;
    font-family: "Saans", "Saans", sans-serif;
    color: #1f2937;
}

.calculadora-container {
    max-width: 1100px;
    margin: 0 auto;
}

.calculadora-header {
    text-align: center;
    max-width: 700px;
    margin: 32px auto 56px auto;
}

.calculadora-header .antetitulo {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2A2822;
    margin-bottom: 12px;
}

.calculadora-header h1 {
    font-size: 40px;
    font-weight: 400;
    color: #1D1B16;
    line-height: 1.2;
    margin: 0 0 16px 0;
}

.calculadora-header h1 strong {
    font-weight: 800;
}

.calculadora-header p {
    font-size: 18px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* Calculator Grid — banda full-width con fondo #F5F3EF que engloba la
   calculadora + "Introduce tus datos", diferenciándola del hero y del bloque
   siguiente. Full-bleed a viewport, contenido centrado a 1100px. */
.calculadora-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 80px;
    background: #F5F3EF;
    margin-inline: calc(50% - 50vw);
    padding-inline: max(24px, calc(50vw - 50%));
    padding-block: 56px;
}

@media (max-width: 900px) {
    .calculadora-grid {
        grid-template-columns: 1fr;
        padding-block: 40px;
    }
}

/* Input Form Card */
.calc-card-input {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.calc-input-group {
    margin-bottom: 28px;
}

.calc-input-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

/* Styled Gender Selector */
.gender-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gender-btn {
    background: #FAF6F0;
    border: 2px solid transparent;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
    transition: all 0.2s ease;
}

.gender-btn:hover {
    background: #f3ece3;
}

.gender-btn.active {
    background: #ffffff;
    border-color: #334DCF;
    color: #334DCF;
    box-shadow: 0 4px 12px rgba(51, 77, 207, 0.1);
}

/* Range Sliders */
.range-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.range-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #334DCF;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(51, 77, 207, 0.3);
    transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-value-input {
    width: 80px;
    padding: 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #111827;
}

.range-value-input:focus {
    border-color: #334DCF;
    outline: none;
}

.btn-calc-submit {
    width: 100%;
    padding: 16px;
    background-color: #334DCF;
    border: none;
    border-radius: 100px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(51, 77, 207, 0.3);
}

.btn-calc-submit:hover {
    background-color: #0E0E90;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217, 101, 38, 0.45);
}

/* Result Card */
.calc-card-result {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-placeholder {
    color: #8a8a93;
}

.result-placeholder .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.result-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

.result-number {
    font-size: 64px;
    font-weight: 800;
    color: #0E0E90;
    font-family: "Saans", sans-serif;
    line-height: 1;
    margin-bottom: 8px;
}

.result-classification {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

/* Meter Scale (IMC por defecto; ICA se sobreescribe abajo) */
.bmi-meter-container {
    width: 100%;
    margin-bottom: 32px;
}

.bmi-meter-bar {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #93C5FD 0%, #34D399 25%, #FBBF24 50%, #F87171 75%, #EF4444 100%);
    position: relative;
}

.bmi-meter-pointer {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #0e0e90;
    position: absolute;
    top: -3px;
    left: 0;
    transform: translateX(-50%);
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.bmi-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;        /* legibilidad (antes 11px) */
    color: #595959;         /* contraste AA (antes #8a8a93 ~3.4:1) */
    margin-top: 6px;
    font-weight: 600;
}

/* Conversion Card inside Result */
.conversion-box {
    margin-top: 24px;
    padding: 24px;
    border-radius: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversion-box.eligible {
    background-color: rgba(51, 77, 207, 0.08);
    border: 1px solid rgba(51, 77, 207, 0.2);
}

.conversion-box.not-eligible {
    background-color: rgba(14, 14, 144, 0.05);
    border: 1px solid rgba(14, 14, 144, 0.1);
}

.conversion-title {
    font-size: 16px;
    font-weight: 700;
    color: #1D1B16; /* titular en negro, no azul */
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversion-text {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
    margin: 0;
}

.conversion-btn {
    text-align: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.conversion-btn.primary {
    background-color: #334DCF;
    color: #ffffff;
}

.conversion-btn.primary:hover {
    background-color: #0E0E90;
    transform: translateY(-1px);
}

.conversion-btn.secondary {
    background-color: transparent;
    border: 2px solid #0E0E90;
    color: #0E0E90;
}

.conversion-btn.secondary:hover {
    background-color: rgba(14, 14, 144, 0.05);
}

/* Information Sections */
.info-section {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.info-section h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1D1B16; /* titular en negro, no azul */
    margin: 0 0 20px 0;
    font-family: "Saans", sans-serif;
}

.info-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 20px 0;
}

.info-section p:last-child {
    margin-bottom: 0;
}

/* Formula Highlight Box */
.formula-box {
    background-color: #FAF6F0;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #0E0E90;
    margin: 24px 0;
    font-family: "Saans", sans-serif;
    border-left: 4px solid #334DCF;
}

.formula-box span {
    font-size: 22px;
    display: block;
    margin-top: 8px;
    color: #334DCF;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.class-item {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.class-item.under { border-top: 4px solid #93C5FD; }
.class-item.normal { border-top: 4px solid #34D399; }
.class-item.over { border-top: 4px solid #FBBF24; }
.class-item.obese { border-top: 4px solid #EF4444; }

.class-item h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: #8a8a93;
    text-transform: uppercase;
}

.class-item p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FAQ Accordion Styles */
.faq-section {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.faq-section h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1D1B16;
    margin: 0 0 8px 0;
    font-family: "Saans", sans-serif;
}

.faq-section .faq-intro {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 32px;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item:first-child {
    padding-top: 0;
}

.faq-question-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    color: #1D1B16;
    outline: none;
}

.faq-question-btn h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #1D1B16;
    padding-right: 24px;
}

.faq-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    background-color: #334DCF;
    transition: transform 0.3s ease;
}

.faq-icon::before {
    top: 11px;
    left: 4px;
    width: 16px;
    height: 2px;
}

.faq-icon::after {
    top: 4px;
    left: 11px;
    width: 2px;
    height: 16px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-item.active .faq-icon::after {
    transform: scaleY(0);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 8px;
}

.faq-answer p {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* La calculadora Cintura-Altura usa una escala de riesgo distinta
   (5 tramos con transiciones abruptas) frente al degradado continuo
   de 5 puntos de la calculadora de IMC. */
.page-template-page-calculadora-cintura-altura .bmi-meter-bar {
    background: linear-gradient(to right, #93C5FD 0%, #34D399 20%, #34D399 40%, #FBBF24 40%, #FBBF24 60%, #EF4444 60%, #EF4444 100%);
}

/* ─────────────────────────────────────────────────────────────
   Índice de calculadoras (/calculadoras/) — grid de tarjetas
   ───────────────────────────────────────────────────────────── */
.calc-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 8px 0 48px;
}
.calc-hub-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px;
    background: #ffffff;
    border: 1.5px solid #E2DED4;
    border-radius: 18px;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.calc-hub-card:hover {
    transform: translateY(-3px);
    border-color: #4F62D2;
    box-shadow: 0 10px 30px rgba(51, 77, 207, 0.08);
}
/* Icono: usa el contenedor global .paso-icono (mismo tamaño/color/fondo que el
   resto del sitio). Aquí solo replicamos el hover global al pasar por la tarjeta. */
.calc-hub-card .paso-icono {
    margin-bottom: 4px;
}
.calc-hub-card:hover .paso-icono {
    background-color: #334DCF !important;
}
.calc-hub-card:hover .paso-icono svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}
.calc-hub-title {
    font-size: 19px;
    font-weight: 600;
    color: #1D1B16;
    margin: 0;
}
.calc-hub-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #6B6659;
    margin: 0;
    flex: 1 1 auto;
}
.calc-hub-cta {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #4F62D2;
}

/* ─────────────────────────────────────────────────────────────
   Referencias científicas (E-E-A-T) al pie de cada calculadora
   ───────────────────────────────────────────────────────────── */
.calc-references-note {
    font-size: 13.5px;
    color: #6B6659;
    font-style: italic;
    margin: 0 0 16px;
}
.calc-references-list {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.calc-references-list li {
    font-size: 13.5px;
    line-height: 1.5;
    color: #4a4a52;
}
.calc-references-list li a {
    color: #4F62D2;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.calc-references-list li a:hover { color: #334DCF; }
