/* ============================================================
   calculadora.css — CSS compartido de las calculadoras
   Usado por: calculadora-tdee, -imc, -proteinas, -hidratacion,
   -grasa-corporal, -peso-ideal, -macros, -objetivo y calculadoras.html
   Lo especifico de cada pagina vive en su <style> residual,
   que se carga DESPUES de este archivo y por tanto lo sobreescribe.
   ============================================================ */

/* ---------- Base comun (todas las paginas) ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #F5F7FA;
    min-height: 100vh;
    color: #1A202C;
    -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid #FFCC00; outline-offset: 2px; }
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); display: flex; justify-content: center; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.06); }
.navbar-logo-link { display: flex; align-items: center; text-decoration: none; }
.navbar img, .navbar-logo { width: 36px; height: 36px; border-radius: 8px; }
.main-container { max-width: 800px; margin: 0 auto; padding: 20px 16px; }
.container { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
h1 { color: #1A202C; font-size: 1.6em; margin-bottom: 8px; font-weight: 800; }
.subtitle { color: #6B6560; font-size: 0.85em; line-height: 1.5; }

/* ---------- Formularios y resultados (calculadoras grandes:
              tdee, imc, proteinas, hidratacion) ---------- */
.unit-toggle { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.unit-btn { padding: 10px 24px; border: 2px solid #6C63FF; background: white; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 0.85em; color: #1A202C; transition: all 0.3s; }
.unit-btn.active { background: linear-gradient(135deg, #6C63FF 0%, #EDE9FF 100%); }
.unit-btn:active { transform: scale(0.95); }
.calculator-section { background: #F5F7FA; padding: 20px; border-radius: 14px; margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.form-group { position: relative; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; color: #1A202C; font-size: 0.85em; }
.form-group input, .form-group select { width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 16px; font-family: inherit; transition: all 0.3s; color: #1A202C; background: white; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #6C63FF; box-shadow: 0 0 10px rgba(108,99,255,0.3); }
.input-unit { position: relative; }
.input-unit input { padding-right: 45px; }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #888; font-weight: 600; font-size: 0.85em; }
.gender-toggle { display: flex; gap: 10px; }
.gender-btn { flex: 1; padding: 12px; border: 2px solid #e0e0e0; background: white; border-radius: 10px; cursor: pointer; font-size: 1.3em; transition: all 0.3s; text-align: center; }
.gender-btn.active { border-color: #6C63FF; background: linear-gradient(135deg, #6C63FF 0%, #EDE9FF 100%); }
.gender-btn:active { transform: scale(0.95); }
.calculate-btn { width: 100%; padding: 16px; background: linear-gradient(135deg, #6C63FF 0%, #6C63FF 100%); color: white; border: none; border-radius: 12px; font-size: 1em; font-weight: 700; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 15px rgba(108,99,255,0.3); }
.calculate-btn:active { transform: scale(0.98); }
.results-section { display: none; animation: fadeIn 0.5s ease-out; }
.results-section.show { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.results-header { padding: 24px; border-radius: 14px; text-align: center; margin-bottom: 20px; }
.results-header h2 { font-size: 1em; color: #1A202C; margin-bottom: 8px; font-weight: 700; }
.main-result { font-size: 2.8em; font-weight: 800; line-height: 1; }
.result-label { font-size: 0.85em; color: #6B6560; margin-top: 4px; }
.result-category { font-size: 1.1em; font-weight: 700; margin-top: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.info-card { background: #F5F7FA; padding: 16px; border-radius: 12px; text-align: center; }
.info-card h3 { font-size: 0.8em; color: #6B6560; margin-bottom: 6px; font-weight: 600; }
.info-value { font-size: 1.5em; font-weight: 800; color: #1A202C; }
.info-desc { font-size: 0.7em; color: #888; margin-top: 6px; line-height: 1.4; }
.categories-section { background: #F5F7FA; padding: 20px; border-radius: 14px; margin-bottom: 20px; }
.categories-section h3 { font-size: 0.95em; color: #1A202C; margin-bottom: 14px; text-align: center; font-weight: 700; }
.category-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: white; border-radius: 10px; margin-bottom: 8px; }
.category-item:last-child { margin-bottom: 0; }
.category-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.category-info { flex: 1; }
.category-name { font-weight: 700; font-size: 0.85em; color: #1A202C; }
.category-range { font-size: 0.75em; color: #6B6560; }
.category-item.active { border: 2px solid #6C63FF; background: linear-gradient(135deg, rgba(108,99,255,0.1) 0%, rgba(232,213,168,0.2) 100%); }
.education-section { background: #F5F7FA; padding: 20px; border-radius: 14px; }
.education-section h3 { font-size: 0.95em; color: #1A202C; margin-bottom: 14px; font-weight: 700; }
.education-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.edu-card { background: white; padding: 14px; border-radius: 10px; border-left: 3px solid #6C63FF; }
.edu-card h4 { font-size: 0.85em; color: #1A202C; margin-bottom: 6px; font-weight: 700; }
.edu-card p { font-size: 0.75em; color: #6B6560; line-height: 1.5; }
@media (min-width: 481px) { .main-container { padding: 24px 20px; } .container { padding: 28px; } h1 { font-size: 1.7em; } .main-result { font-size: 3.2em; } }
@media (min-width: 769px) { .main-container { max-width: 900px; padding: 30px 24px; } .container { padding: 32px; border-radius: 24px; } h1 { font-size: 1.9em; } .calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,99,255,0.4); } }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } .info-grid { grid-template-columns: 1fr; } .education-grid { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .navbar { padding: 10px 12px; }
.main-container { padding: 12px 10px; } .container { padding: 16px 12px; border-radius: 16px; } h1 { font-size: 1.2em; } .subtitle { font-size: 0.8em; } .calculator-section { padding: 14px; } .form-group label { font-size: 0.8em; } .form-group input, .form-group select { padding: 10px; } .calculate-btn { padding: 14px; font-size: 0.9em; } .results-header { padding: 18px; } .main-result { font-size: 2.2em; } }

/* ========== BOTTOM NAV (calculadoras grandes e indice) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #1A1A2E;
    margin: 0 16px 12px;
    margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 28px;
    padding: 8px 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    border-radius: 20px;
}
.bottom-nav-item.active { color: #fff; background: rgba(255, 255, 255, 0.12); }
.bottom-nav-item:hover { color: rgba(255, 255, 255, 0.7); }

/* ---------- Calculadoras simples (peso-ideal, grasa-corporal,
              macros, objetivo): base compartida ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: #6C63FF; text-decoration: none; font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.form-section { background: #F8FAFC; padding: 18px; border-radius: 14px; margin-bottom: 18px; }
.calc-btn { width: 100%; padding: 14px; color: white; border: none; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; }
.calc-btn:active { transform: scale(0.98); }
.results { display: none; margin-top: 20px; }
.results.show { display: block; animation: fadeIn 0.4s ease-out; }
.info-box { margin-top: 16px; padding: 14px; background: #EDF2F7; border-radius: 10px; font-size: 12.5px; color: #4A5568; line-height: 1.5; }
