/* ==========================================================
   static/styles.css  — Calculadora Residencial (rediseño)
   Globales: tokens, tipografía, header, footer, contenedores
   ========================================================== */

:root {
  --main-accent-color: #367b22;
  --accent-deep:       #2a6019;
  --accent-soft:       #eaf3e4;
  --secondary-red:     #F25041;
  --secondary-red-deep:#d63b2d;
  --surface:           #ffffff;
  --surface-cream:     #EDEBE1;
  --surface-muted:     #f6f4ec;
  --border-soft:       #dcd9cc;
  --text:              #1f2328;
  --text-muted:        #5a6066;
  --text-dim:          #7a7f86;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-card:  0 1px 2px rgba(20,25,30,.04), 0 4px 18px rgba(20,25,30,.06);
  --shadow-hover: 0 2px 4px rgba(20,25,30,.06), 0 10px 28px rgba(20,25,30,.09);
  --transition: 180ms cubic-bezier(.2,.7,.2,1);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: "Roboto Condensed", system-ui, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--surface-cream);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: "Roboto Condensed", sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-weight: 700; font-size: clamp(28px,3.2vw,40px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-weight: 500; font-size: clamp(18px,1.8vw,22px); line-height: 1.25; color: var(--text-muted); margin: 0 0 14px; }
h3 { font-weight: 600; font-size: clamp(17px,1.6vw,20px); line-height: 1.35; margin: 0 0 12px; }
h4 { font-weight: 600; font-size: 16px; line-height: 1.4; margin: 0 0 8px; }
p  { margin: 0 0 10px; }
a  { color: var(--main-accent-color); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-deep); }

/* --- Page content wrapper ------------------------------- */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px 48px;
}
@media (max-width: 991px) { .page-content { padding: 0 24px 32px; } }
@media (max-width: 575px)  { .page-content { padding: 0 16px 24px; } }

/* --- Header / Nav --------------------------------------- */
.header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 48px !important;
  min-height: auto !important;
  margin: 0 0 28px !important;
  max-width: 100% !important;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text);
}

/* Logo Ministerio */
.header-logo { flex-shrink: 0; }
.header-logo img {
  height: 60px;
  width: auto;
  display: block;
}

/* Nav links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.header .menu-item {
  border-right: none !important;
  padding: 10px 12px !important;
  position: relative;
}
.header .menu-item a {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  font-size: 12.5px !important;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: color var(--transition);
  white-space: nowrap;
}
.header .menu-item a:hover { color: var(--main-accent-color) !important; }
.header .menu-item.active a { color: var(--main-accent-color) !important; font-weight: 600 !important; }
.header .menu-item.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px; background: var(--main-accent-color); border-radius: 2px;
}

/* --- Breadcrumb "estás en" (calculadoras) --------------- */
.calc-breadcrumb {
  margin-top: 6px;
  margin-bottom: 10px;
  padding-left: 0;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}
.calc-breadcrumb-sep { margin: 0 6px; color: var(--text-dim); }
.calc-breadcrumb-current { color: var(--main-accent-color); font-weight: 600; }

/* --- Containers ----------------------------------------- */
.container:not(.container:has(.row_title)):not(.calc-breadcrumb) {
  background: var(--surface) !important;
  border: 1px solid var(--border-soft) !important;
  border-left: 4px solid var(--main-accent-color) !important;
  border-radius: var(--radius) !important;
  padding: 28px 32px !important;
  box-shadow: var(--shadow-card) !important;
  margin-bottom: 18px !important;
  transition: box-shadow var(--transition);
}
.container:not(.container:has(.row_title)):not(.calc-breadcrumb):hover { box-shadow: var(--shadow-hover) !important; }

.container:has(h1) {
  border-left: 1px solid var(--border-soft) !important;
  padding: 32px 36px 24px !important;
}
.container:has(h1) h1 { margin-top: 0 !important; }
.container:has(h1) h2 { margin-bottom: 0 !important; }
.container:has(h1) h3 { color: var(--text-muted); font-weight: 400; font-size: 16px; }

/* --- Footer logos --------------------------------------- */
#logos_footer {
  display: flex;
  gap: 36px;
  align-items: center;
  flex-wrap: wrap;
  padding: 28px 0 12px;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
}
#logos_footer img {
  height: 56px; width: auto;
  opacity: 0.85;
  transition: opacity var(--transition);
}
#logos_footer a:hover img { opacity: 1; }

/* --- KPI Result Cards (resultados) ---------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--main-accent-color);
}
.kpi-card.kpi-neutral::before { background: #c4b87a; }
.kpi-card.kpi-warning::before { background: var(--secondary-red); }
.kpi-card:hover { box-shadow: var(--shadow-hover); }
.kpi-label {
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}
.kpi-value {
  font-size: 30px; font-weight: 700; line-height: 1.05;
  color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.kpi-sub { font-size: 13px; color: var(--text-muted); }
.kpi-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--main-accent-color); margin-top: 4px;
}
.kpi-trend.down { color: var(--secondary-red); }

/* --- Home — imagen decorativa --------------------------- */
#container_home .col-lg-7 img,
#container_home .col-md-5 img {
  max-height: 320px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  opacity: 0.9;
}

/* --- Site footer ---------------------------------------- */
.site-footer {
  margin-top: 48px;
  background: var(--surface);
  border-top: 3px solid var(--main-accent-color);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 48px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 24px;
}
.footer-brand img { height: 90px; width: auto; }
.footer-brand .footer-address {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-brand .footer-address b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.footer-brand .footer-address p { margin: 0; }
.footer-partners {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-partners img {
  height: 100px;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.footer-partners a:hover img { opacity: 1; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 991px) {
  .container:not(.container:has(.row_title)):not(.calc-breadcrumb) {
    padding: 22px 20px !important;
  }
  .header {
    padding: 14px 24px !important;
    gap: 16px;
    flex-wrap: wrap;
  }
  .header-nav { gap: 2px; }
  .header .menu-item { padding: 8px 10px !important; }
  .footer-inner { padding: 32px 24px 24px; flex-direction: column; align-items: flex-start; }
  .footer-partners { justify-content: flex-start; }
  h1 { font-size: 26px; }
  h2 { font-size: 17px; }
  h3 { font-size: 16px; }
  .kpi-value { font-size: 26px; }
}

@media (max-width: 575px) {
  body { font-size: 15px; }
  .header { padding: 12px 16px !important; }
  .header-logo img { height: 48px; }
  .container:not(.container:has(.row_title)):not(.calc-breadcrumb) { padding: 18px 16px !important; }
  .kpi-card { padding: 16px 18px; }
  .kpi-value { font-size: 24px; }
  .footer-inner { padding: 24px 16px 20px; }
  .footer-brand { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-brand img { height: 64px; }
  .footer-partners img { height: 72px; }
  #logos_footer { gap: 18px; padding: 18px 0; }
  #logos_footer img { height: 36px; }
}
