/* ==========================================================================
   VigiaSeguro — Sistema de diseno global (es-MX)
   Vigilancia, tipos de camaras de seguridad e instalacion profesional.
   Paleta: azul marino profundo + ambar (accion) + cian (tecnologia).
   Sin frameworks, sin CDNs, sin publicidad de terceros.
   Orden de secciones estable: los generadores de HTML dependen de el.
   ========================================================================== */

:root {
  /* Azul marino — marca principal */
  --navy-50: #f1f5fb;
  --navy-100: #e2e8f0;
  --navy-200: #cbd5e1;
  --navy-300: #94a3b8;
  --navy-400: #64748b;
  --navy-500: #475569;
  --navy-600: #334155;
  --navy-700: #1e293b;
  --navy-800: #0f172a;
  --navy-900: #0b1220;
  --navy-950: #070d17;

  /* Ambar — acento de accion (CTAs, precios, badges) */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;

  /* Cian — secundario tecnologico (enlaces, iconos, detalles) */
  --cyan-50: #ecfeff;
  --cyan-100: #cffafe;
  --cyan-200: #a5f3fc;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --cyan-700: #0e7490;
  --cyan-800: #155e75;

  /* Semantica */
  --text: var(--navy-700);
  --text-muted: var(--navy-400);
  --heading: var(--navy-800);
  --border: var(--navy-100);
  --bg: #ffffff;
  --bg-soft: var(--navy-50);
  --card: #ffffff;
  --accent: var(--amber-500);
  --accent-hover: var(--amber-600);
  --accent-soft: var(--amber-50);
  --accent-ink: var(--navy-800);
  --link: var(--cyan-700);
  --link-hover: var(--cyan-800);
  --success: #059669;
  --danger: #dc2626;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06);
  --shadow: 0 4px 16px rgba(11, 18, 32, 0.08);
  --shadow-lg: 0 12px 32px rgba(11, 18, 32, 0.14);
  --shadow-amber: 0 8px 22px rgba(245, 158, 11, 0.28);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --container: 1140px;
  --header-h: 68px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 {
  /* El mínimo de 1.9rem desbordaba a 390-420 px: se baja y se permite partir. */
  font-size: clamp(1.45rem, 4vw + 0.6rem, 2.6rem);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

:focus-visible {
  outline: 3px solid var(--cyan-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow {
  max-width: 820px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--navy-800);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.2s;
}

.site-header.is-stuck {
  box-shadow: 0 6px 24px rgba(11, 18, 32, 0.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand:hover {
  text-decoration: none;
  color: var(--heading);
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--amber-400);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand__mark svg {
  width: 24px;
  height: 24px;
}

.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-size: 1.2rem;
}

.brand__name strong {
  color: var(--amber-600);
}

.brand__tag {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Separación garantizada entre la marca y el menú: sin esto el primer enlace
   del nav puede montarse sobre el subtítulo del logo en anchos intermedios. */
.site-header__inner {
  column-gap: 28px;
}

.brand {
  max-width: 46%;
}

.brand__text {
  min-width: 0;
}

@media (max-width: 1400px) {
  .brand {
    max-width: 34%;
  }

  .brand__tag {
    display: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  color: var(--navy-500);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav__link:hover {
  background: var(--navy-50);
  color: var(--heading);
  text-decoration: none;
}

.nav__link.is-active,
.nav__link[aria-current="page"] {
  color: var(--navy-800);
  background: var(--amber-50);
  box-shadow: inset 0 -2px 0 var(--amber-500);
}

.nav__cta {
  margin-left: 8px;
}

/* El botón de acción de la cabecera sale del flujo del menú para que nunca se
   encime sobre un enlace de navegación en anchos intermedios. */
.header-cta {
  flex: 0 0 auto;
  margin-left: 8px;
  white-space: nowrap;
}

.nav {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.nav__link {
  white-space: nowrap;
}

/* Por debajo de 1400 px el menú + botón no caben con holgura: se oculta el botón
   y se deja respirar al menú. Por debajo de 1100 px entra el menú hamburguesa. */
@media (max-width: 1400px) {
  .header-cta {
    display: none;
  }

  .nav__link {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 1160px) {
  .nav__link {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 0.92rem;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--navy-600);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .nav.is-open {
    display: flex;
  }

  .nav__link {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav__cta {
    margin: 8px 0 0;
  }

  .brand__tag {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s,
    transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn--primary {
  background: var(--amber-500);
  color: var(--navy-900);
  box-shadow: var(--shadow-amber);
}

.btn--primary:hover {
  background: var(--amber-400);
  color: var(--navy-900);
  text-decoration: none;
}

.btn--secondary {
  background: #fff;
  color: var(--navy-800);
  border-color: var(--navy-200);
}

.btn--secondary:hover {
  border-color: var(--navy-800);
  color: var(--navy-900);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--navy-500);
  border-color: var(--navy-200);
}

.btn--ghost:hover {
  background: var(--navy-50);
  color: var(--navy-800);
  text-decoration: none;
}

.btn--dark {
  background: var(--navy-800);
  color: #fff;
}

.btn--dark:hover {
  background: var(--navy-900);
  color: #fff;
  text-decoration: none;
}

.btn--cta {
  background: var(--amber-500);
  color: var(--navy-900);
  padding: 14px 26px;
  font-size: 1.02rem;
  box-shadow: var(--shadow-amber);
}

.btn--cta:hover {
  background: var(--amber-400);
  color: var(--navy-900);
  text-decoration: none;
}

.btn--sm {
  font-size: 0.88rem;
  padding: 9px 16px;
}

.btn--lg {
  font-size: 1.08rem;
  padding: 16px 30px;
}

.btn--block {
  width: 100%;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-group--center {
  justify-content: center;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card--pad {
  padding: 24px;
}

.card--flush {
  overflow: hidden;
}

.card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--heading);
}

.card__body {
  padding: 20px;
}

.card--dark {
  background: var(--navy-900);
  border-color: var(--navy-700);
  color: var(--navy-200);
}

.card--dark h2,
.card--dark h3,
.card--dark h4 {
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
  color: var(--navy-200);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      60% 50% at 82% 18%,
      rgba(245, 158, 11, 0.18),
      transparent 70%
    ),
    radial-gradient(50% 50% at 8% 90%, rgba(6, 182, 212, 0.16), transparent 70%);
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: #fff;
}

.hero h2,
.hero h3 {
  color: #fff;
}

.hero a {
  color: var(--amber-300);
}

/* Buttons inside a hero keep their own foreground colour. Without this, the
   generic `.hero a` rule above wins on specificity and paints amber text on the
   amber CTA (black-on-black in the dark hero, amber-on-amber in a light one). */
.hero a.btn,
.hero--light a.btn {
  color: inherit;
}

.hero a.btn--primary,
.hero a.btn--cta {
  color: #0b1220;
}

.hero a.btn--secondary {
  color: var(--navy-800);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-300);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero__lead {
  color: var(--navy-200);
  font-size: 1.1rem;
  max-width: 54ch;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 26px;
}

.hero__stat {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-200);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero__stat strong {
  color: #fff;
}

.hero__stat svg {
  width: 20px;
  height: 20px;
  color: var(--amber-400);
  flex: 0 0 auto;
}

.hero__figure {
  max-width: 900px;
  margin: 32px auto 0;
}

.hero__figure img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: block;
}

.hero__figure figcaption {
  color: var(--navy-300);
  font-size: 0.82rem;
  margin-top: 10px;
  text-align: center;
}

.hero__media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
  display: block;
}

.hero__head {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero__head .hero__lead {
  margin: 0 auto;
}

.hero__head .hero__stats {
  justify-content: center;
}

.hero--light {
  background: linear-gradient(180deg, var(--amber-50) 0%, var(--bg) 100%);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.hero--light h1,
.hero--light h2,
.hero--light h3 {
  color: var(--heading);
}

.hero--light .hero__lead {
  color: var(--text-muted);
}

.hero--light .hero__stat {
  color: var(--navy-500);
}

.hero--light .hero__eyebrow {
  background: var(--amber-100);
  border-color: var(--amber-200);
  color: var(--amber-800);
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 18px;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy-600);
  margin-bottom: 6px;
}

.field__hint {
  font-weight: 500;
  color: var(--navy-400);
  font-size: 0.8rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group__prefix,
.input-group__suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy-400);
  font-weight: 600;
  font-size: 0.95rem;
  pointer-events: none;
}

.input-group__prefix {
  left: 14px;
}

.input-group__suffix {
  right: 14px;
}

.input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  background: #fff;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.input-group__prefix ~ .input {
  padding-left: 32px;
}

.input-group__suffix ~ .input {
  padding-right: 46px;
}

.input:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px var(--amber-100);
}

.input--error {
  border-color: var(--danger);
}

select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.input {
  font-weight: 500;
  line-height: 1.6;
  min-height: 120px;
  resize: vertical;
}

.field__error {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 1.2em;
}

.field--inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="range"].input {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--amber-500);
}

.seg-toggle {
  display: inline-flex;
  background: var(--navy-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-toggle label {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy-400);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.seg-toggle input:checked + label {
  background: #fff;
  color: var(--navy-800);
  box-shadow: var(--shadow-sm), inset 0 -2px 0 var(--amber-500);
}

.seg-toggle input:focus-visible + label {
  outline: 2px solid var(--cyan-500);
  outline-offset: 1px;
}

/* ---------- Results panel ---------- */
.results {
  background: linear-gradient(150deg, var(--navy-900), var(--navy-800) 70%, var(--navy-700));
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.results::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
  pointer-events: none;
}

.results__label {
  color: var(--navy-300);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results__amount {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--amber-400);
  line-height: 1.1;
  margin: 6px 0 6px;
}

.results__note {
  color: var(--navy-300);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.results--light {
  background: var(--navy-50);
  border: 1px solid var(--border);
  color: var(--text);
}

.results--light .results__label {
  color: var(--navy-400);
}

.results--light .results__amount {
  color: var(--navy-900);
}

.results--light .results__note {
  color: var(--navy-400);
}

.breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.breakdown__item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.breakdown__label {
  color: var(--navy-300);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.breakdown__value {
  color: #fff;
  font-size: 1.12rem;
  font-weight: 700;
  margin-top: 2px;
}

.breakdown__value--accent {
  color: var(--amber-400);
}

/* ---------- Donut chart ---------- */
.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.donut {
  position: relative;
  width: 190px;
  height: 190px;
  flex: 0 0 auto;
}

.donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut__center-value {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--heading);
}

.donut__center-label {
  color: var(--navy-400);
  font-size: 0.8rem;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  min-width: 200px;
}

.donut-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.donut-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.donut-legend__label {
  color: var(--navy-500);
  font-weight: 600;
}

.donut-legend__value {
  margin-left: auto;
  font-weight: 700;
  color: var(--heading);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

th,
td {
  text-align: right;
  padding: 11px 14px;
  border-bottom: 1px solid var(--navy-100);
  vertical-align: top;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: var(--navy-50);
  color: var(--navy-500);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(245, 158, 11, 0.05);
}

tfoot td {
  background: var(--navy-50);
  font-weight: 700;
  color: var(--heading);
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Utilidades de anuncios (sin uso; compatibilidad) ---------- */
.ad-slot {
  display: none;
}

/* ---------- Layout helpers ---------- */
.section {
  padding: 56px 0;
}

.section--tight {
  padding: 40px 0;
}

.section--soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section--dark {
  background: var(--navy-900);
  color: var(--navy-200);
}

.section--dark h2,
.section--dark h3 {
  color: #fff;
}

.section--flush {
  padding: 0;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.section-head--left {
  text-align: left;
  margin-left: 0;
}

.section-head__kicker {
  color: var(--amber-700);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.section--dark .section-head__kicker {
  color: var(--amber-400);
}

.section-head p {
  color: var(--text-muted);
}

.section--dark .section-head p {
  color: var(--navy-300);
}

.section__foot {
  margin-top: 36px;
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.two-col--even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.two-col--left {
  grid-template-columns: 320px minmax(0, 1fr);
}

/* ---------- Tarjetas de articulos (blog) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}

.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.post-card__thumb {
  height: 168px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  display: grid;
  place-items: center;
  color: var(--amber-400);
  overflow: hidden;
}

.post-card__thumb svg {
  width: 44px;
  height: 44px;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__meta {
  font-size: 0.76rem;
  color: var(--navy-400);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-card__title {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.post-card__title a {
  color: var(--heading);
  text-decoration: none;
}

.post-card__title a:hover {
  color: var(--cyan-700);
}

.post-card__excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.post-card__more {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan-700);
}

/* ---------- Article (entrada) ---------- */
.article {
  max-width: 740px;
  margin: 0 auto;
}

.article--wide {
  max-width: 860px;
}

.article__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.article__author {
  font-weight: 700;
  color: var(--heading);
}

.article__date {
  color: var(--navy-400);
  font-size: 0.85rem;
}

.article__read {
  color: var(--navy-400);
  font-size: 0.85rem;
}

.article h2 {
  margin-top: 1.7em;
}

.article h3 {
  margin-top: 1.3em;
}

.article p,
.article li {
  color: var(--navy-600);
}

.article ul,
.article ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

.article li {
  margin-bottom: 0.4em;
}

.article blockquote {
  border-left: 4px solid var(--amber-500);
  background: var(--amber-50);
  margin: 1.5em 0;
  padding: 14px 20px;
  border-radius: 0 10px 10px 0;
  color: var(--navy-600);
}

.article blockquote p {
  margin: 0;
}

.article__figure {
  margin: 28px 0;
}

.article__figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
}

.article__figure figcaption {
  font-size: 0.85rem;
  color: var(--navy-400);
  margin-top: 8px;
  text-align: center;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--amber-400);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex: 0 0 auto;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.avatar--sm {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.avatar--lg {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
}

.avatar--photo {
  overflow: hidden;
  text-decoration: none;
}

.avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ---------- Perfil de autora ---------- */
.author-profile {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  background: var(--navy-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.author-profile__photo {
  margin: 0;
}

.author-profile__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  display: block;
}

.author-profile__body p {
  margin: 10px 0 0;
  color: var(--navy-600);
}

.author-profile__name {
  font-size: 1.15rem;
  margin: 0;
}

.author-profile__role {
  color: var(--amber-700);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.author-profile__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 620px) {
  .author-profile {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .author-profile__photo {
    max-width: 160px;
    margin: 0 auto;
  }

  .author-profile__links {
    justify-content: center;
  }
}

.author-bio {
  background: var(--navy-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 32px;
}

.author-bio__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.author-bio__name {
  font-weight: 700;
  color: var(--heading);
}

.author-bio p {
  color: var(--navy-500);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--navy-400);
  padding: 18px 0 0;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs a {
  color: var(--navy-400);
}

.breadcrumbs a:hover {
  color: var(--cyan-700);
}

.breadcrumbs span[aria-hidden="true"] {
  color: var(--navy-200);
}

.breadcrumbs li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy-200);
}

.breadcrumbs [aria-current="page"] {
  color: var(--navy-600);
  font-weight: 600;
}

/* ---------- Callout / notice ---------- */
.callout {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  border-left: 4px solid var(--amber-500);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--navy-600);
  font-size: 0.92rem;
  margin: 20px 0;
}

.callout strong {
  color: var(--amber-800);
}

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

.callout__title {
  display: block;
  font-weight: 800;
  color: var(--amber-800);
  margin-bottom: 4px;
}

.callout--amber {
  background: var(--amber-50);
  border-color: var(--amber-200);
}

.callout--info {
  background: var(--cyan-50);
  border-color: var(--cyan-200);
  border-left-color: var(--cyan-500);
}

.callout--info strong,
.callout--info .callout__title {
  color: var(--cyan-800);
}

.callout--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  border-left-color: var(--amber-400);
  color: var(--navy-200);
}

.callout--dark strong,
.callout--dark .callout__title {
  color: var(--amber-300);
}

.notice--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: #78350f;
  font-size: 0.9rem;
  font-weight: 500;
  margin: 20px 0;
}

.notice--warn strong {
  color: #92400e;
}

.notice--warn::before {
  content: "\26A0  ";
  font-weight: 800;
  color: #b45309;
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.feature__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--amber-50);
  color: var(--amber-600);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.feature__icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: var(--navy-400);
  margin-top: 0;
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0 32px;
}

.site-footer__brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.site-footer__brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
}

.site-footer__brand-name strong {
  color: var(--amber-400);
}

.site-footer__about {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.site-footer h4 {
  color: #fff;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 9px;
}

.site-footer a {
  color: var(--navy-400);
  font-size: 0.9rem;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--amber-400);
  text-decoration: underline;
}

.site-footer__social {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.site-footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  color: var(--navy-300);
}

.site-footer__social a:hover {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-400);
}

.site-footer__social svg {
  width: 18px;
  height: 18px;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-footer__bottom .disclaimer {
  margin-bottom: 12px;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}

.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

@media (max-width: 900px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .site-footer__top {
    grid-template-columns: 1fr;
  }
}

/* ---------- Calculator layout ---------- */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
  margin-top: 36px;
}

.results-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.calc-tabs__link {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy-400);
  border-bottom: 3px solid transparent;
  text-decoration: none;
}

.calc-tabs__link:hover {
  color: var(--navy-700);
  text-decoration: none;
}

.calc-tabs__link.is-active {
  color: var(--navy-900);
  border-bottom-color: var(--amber-500);
}

@media (max-width: 900px) {
  .calc-layout,
  .two-col,
  .two-col--even,
  .two-col--left,
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .breakdown {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   COMPONENTES NUEVOS DE Vigiaseguro
   (catalogo de camaras, filtros, casos, proceso, estadisticas, CTA)
   ========================================================================== */

/* ---------- Grid de tipos de camara ---------- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

a.type-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--amber-300);
  text-decoration: none;
}

.type-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--amber-400);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.type-card__icon svg {
  width: 26px;
  height: 26px;
}

.type-card__icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.type-card h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.type-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.type-card__link {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan-700);
}

/* ---------- Badges / etiquetas ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--navy-100);
  color: var(--navy-600);
  white-space: nowrap;
  vertical-align: middle;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge--amber {
  background: var(--amber-500);
  color: var(--navy-900);
}

.badge--amber-soft {
  background: var(--amber-100);
  color: var(--amber-800);
}

.badge--cyan {
  background: var(--cyan-100);
  color: var(--cyan-800);
}

.badge--navy {
  background: var(--navy-800);
  color: #fff;
}

.badge--success {
  background: #d1fae5;
  color: #065f46;
}

.badge--new {
  background: var(--cyan-500);
  color: var(--navy-950);
}

.badge--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--navy-400);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Fichas de camara (catalogo) ---------- */
.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.cam-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.2s;
}

.cam-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.cam-card.is-hidden,
.cam-card[hidden],
.is-hidden {
  display: none !important;
}

.cam-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
  overflow: hidden;
}

.cam-card__thumb img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.cam-card:hover .cam-card__thumb img {
  transform: scale(1.04);
}

.cam-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.cam-card__price {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(11, 18, 32, 0.9);
  color: var(--amber-400);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

.cam-card__price small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--navy-300);
  margin-left: 4px;
}

.cam-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.cam-card__title {
  font-size: 1.06rem;
  margin-bottom: 4px;
}

.cam-card__title a {
  color: var(--heading);
  text-decoration: none;
}

.cam-card__title a:hover {
  color: var(--cyan-700);
}

.cam-card__sub {
  font-size: 0.8rem;
  color: var(--navy-400);
  font-weight: 600;
  margin-bottom: 12px;
}

.cam-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.cam-card__specs {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
}

.cam-card__specs li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}

.cam-card__specs span {
  color: var(--navy-400);
  font-weight: 600;
}

.cam-card__specs strong {
  color: var(--heading);
  font-weight: 700;
  text-align: right;
}

.cam-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cam-card__cta {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--cyan-700);
}

/* ---------- Tabla de especificaciones ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.spec-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--heading);
  padding: 10px 0;
  font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--navy-100);
  min-width: 0;
}

.spec-table th[scope="row"] {
  width: 42%;
  color: var(--navy-500);
  font-weight: 600;
  background: var(--navy-50);
  white-space: normal;
}

.spec-table td {
  color: var(--heading);
  font-weight: 600;
}

.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td {
  border-bottom: none;
}

.spec-table tbody tr:hover th,
.spec-table tbody tr:hover td {
  background: rgba(245, 158, 11, 0.06);
}

/* ---------- Valoracion con estrellas ---------- */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--navy-400);
  font-weight: 600;
}

.rating__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--amber-400);
  line-height: 1;
}

.rating__stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.rating__stars .is-empty {
  color: var(--navy-200);
}

.rating__value {
  font-weight: 800;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.rating--lg .rating__stars svg {
  width: 22px;
  height: 22px;
}

.rating--lg .rating__value {
  font-size: 1.1rem;
}

/* ---------- Testimonios ---------- */
.testimonial {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber-500);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.testimonial__quote {
  color: var(--navy-600);
  font-size: 0.96rem;
  margin: 0;
  line-height: 1.65;
}

.testimonial__quote::before {
  content: "\201C";
  display: block;
  font-size: 2.6rem;
  line-height: 0.6;
  color: var(--amber-400);
  font-weight: 800;
  margin-bottom: 6px;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.testimonial__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
  color: var(--amber-400);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
  overflow: hidden;
}

.testimonial__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial__name {
  font-weight: 700;
  color: var(--heading);
  font-size: 0.92rem;
  line-height: 1.3;
}

.testimonial__role {
  font-size: 0.8rem;
  color: var(--navy-400);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

/* ---------- Casos de instalacion ---------- */
.case-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.case-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.case-card__img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--navy-900);
}

.case-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.case-card__kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan-700);
  margin-bottom: 6px;
}

.case-card h3 {
  font-size: 1.04rem;
  margin-bottom: 8px;
}

.case-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.case-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--navy-400);
  font-weight: 600;
}

.case-card__meta strong {
  color: var(--heading);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ---------- Tabla de contenidos (indice del articulo) ---------- */
.toc {
  background: var(--navy-50);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan-500);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 0.92rem;
}

.toc__title {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--navy-600);
  margin: 0 0 10px;
}

.toc ol,
.toc ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}

.toc li {
  color: var(--navy-500);
}

.toc a {
  color: var(--navy-600);
  font-weight: 600;
}

.toc a:hover {
  color: var(--cyan-700);
}

.toc--sticky {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.toc a.is-current {
  color: var(--navy-900);
  font-weight: 800;
}

/* ---------- FAQ (details / summary) ---------- */
.faq {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.faq details,
.faq__item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.faq details[open] {
  border-color: var(--amber-300);
  box-shadow: var(--shadow-sm);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--heading);
  font-size: 0.97rem;
  padding: 16px 34px 16px 0;
  position: relative;
  margin: 0;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--amber-50);
  color: var(--amber-700);
  font-weight: 800;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: transform 0.2s, background 0.2s;
}

.faq details[open] summary::after {
  content: "\2013";
  transform: translateY(-50%) rotate(180deg);
  background: var(--amber-500);
  color: var(--navy-900);
}

.faq summary:hover {
  color: var(--amber-700);
}

.faq__body {
  color: var(--navy-500);
  font-size: 0.92rem;
  padding: 0 0 16px;
}

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

/* ---------- Pasos numerados (proceso) ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: step;
}

.steps > li {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 20px 68px;
  box-shadow: var(--shadow-sm);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--amber-400);
  font-weight: 800;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
}

.steps h3,
.steps strong.steps__title,
.steps__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 4px;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.steps--horizontal {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.steps--horizontal > li {
  padding: 58px 20px 20px;
}

.steps--horizontal > li::before {
  left: 20px;
  top: 16px;
}

/* ---------- Estadisticas ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
}

.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat__value {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat__value span {
  color: var(--amber-500);
}

.stat__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 8px;
}

.stat-grid--dark .stat {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-grid--dark .stat__value {
  color: #fff;
}

.stat-grid--dark .stat__value span {
  color: var(--amber-400);
}

.stat-grid--dark .stat__label {
  color: var(--navy-300);
}

/* ---------- Banda CTA a ancho completo ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
  color: var(--navy-200);
  padding: 52px 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 70% at 85% 30%, rgba(245, 158, 11, 0.2), transparent 70%);
  pointer-events: none;
}

.cta-band__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 8px;
}

.cta-band p {
  color: var(--navy-300);
  margin: 0;
  max-width: 56ch;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-band__note {
  width: 100%;
  font-size: 0.78rem;
  color: var(--navy-400);
  margin-top: 4px;
}

/* ---------- Pros y contras ---------- */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}

.proscons__col {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.proscons__col h3,
.proscons__title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proscons__col--pros {
  border-top: 3px solid var(--success);
}

.proscons__col--pros h3,
.proscons__col--pros .proscons__title {
  color: #047857;
}

.proscons__col--cons {
  border-top: 3px solid var(--danger);
}

.proscons__col--cons h3,
.proscons__col--cons .proscons__title {
  color: #b91c1c;
}

.proscons ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.proscons li {
  position: relative;
  padding-left: 24px;
  font-size: 0.9rem;
  color: var(--navy-600);
  margin: 0;
}

.proscons__col--pros li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 800;
}

.proscons__col--cons li::before {
  content: "\2715";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 640px) {
  .proscons {
    grid-template-columns: 1fr;
  }
}

/* ---------- Filtros laterales + chips ---------- */
.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.filters__title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--navy-400);
  margin: 0 0 12px;
}

.filters__group {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.filters__group:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.filters__label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--navy-600);
  margin-bottom: 8px;
}

.filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters__count {
  font-size: 0.82rem;
  color: var(--navy-400);
  font-weight: 600;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--navy-200);
  background: #fff;
  color: var(--navy-500);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.chip:hover {
  border-color: var(--navy-400);
  color: var(--navy-800);
  text-decoration: none;
}

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.chip.is-active:hover,
.chip[aria-pressed="true"]:hover {
  background: var(--navy-900);
  color: #fff;
}

.chip--amber.is-active,
.chip--amber[aria-pressed="true"] {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: var(--navy-900);
}

.chip--sm {
  font-size: 0.75rem;
  padding: 6px 10px;
}

.chip__x {
  font-weight: 800;
  opacity: 0.6;
}

.filters__reset {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .filters {
    position: static;
  }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--navy-900);
  color: var(--amber-400);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--navy-800);
}

.to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 12px 16px;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  max-width: var(--container);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.cookie-banner__inner p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--navy-500);
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 560px) {
  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .btn {
    flex: 1;
  }
}

/* ==========================================================================
   ESPACIOS PUBLICITARIOS (Google AdSense)
   Reservan altura antes de cargarse: sin esto el anuncio empuja el contenido
   y el sitio penaliza con CLS alto (mala experiencia y peor ranking).
   Los estilos de anuncio previos estaban en display:none porque el sitio no
   tenía AdSense; ahora se activan.
   ========================================================================== */
.ad-slot {
  display: block;
  margin: 0 auto;
  max-width: 970px;
  padding: 0 20px;
  /* altura mínima reservada por formato */
  min-height: 100px;
  text-align: center;
  overflow: hidden;
}

.ad-slot--leaderboard {
  margin: 20px auto 0;
  min-height: 90px;
}

.ad-slot--rect {
  margin: 28px 0;
  min-height: 250px;
  padding: 0;
}

.ad-slot--footer {
  margin: 32px auto 12px;
  min-height: 90px;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  margin: 0 auto;
}

/* Las páginas puente y el 404 no llevan anuncios */
.no-ads .ad-slot {
  display: none !important;
}

@media (max-width: 600px) {
  .ad-slot {
    padding: 0 12px;
    min-height: 100px;
  }

  .ad-slot--rect {
    min-height: 280px;
  }
}

/* ---------- Utilidades ---------- */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-muted {
  color: var(--text-muted);
}

.text-amber {
  color: var(--amber-600);
}

.text-cyan {
  color: var(--cyan-700);
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mt-4 {
  margin-top: 32px;
}

.mt-5 {
  margin-top: 48px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 32px 0;
}

.stack-sm > * + * {
  margin-top: 8px;
}

.stack > * + * {
  margin-top: 16px;
}

/* ---------- Responsive fino (hasta 360 px) ---------- */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 44px;
  }

  .section {
    padding: 40px 0;
  }

  .section--tight {
    padding: 30px 0;
  }

  .breakdown {
    grid-template-columns: 1fr;
  }

  .results {
    padding: 22px;
  }

  .donut {
    width: 160px;
    height: 160px;
  }

  .article {
    max-width: 100%;
  }

  .btn {
    width: 100%;
  }

  .btn-group .btn,
  .cta-band__actions .btn,
  .cookie-banner__actions .btn,
  .nav__cta {
    width: auto;
  }

  .nav__cta {
    width: 100%;
  }

  .field--inline {
    grid-template-columns: 1fr;
  }

  .steps > li {
    padding: 18px 18px 18px 60px;
  }

  .steps > li::before {
    left: 14px;
    top: 16px;
  }

  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-band__actions {
    width: 100%;
  }

  .cta-band__actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 15px;
  }

  .brand__name {
    font-size: 1.05rem;
  }

  .cam-grid,
  .post-grid,
  .type-grid,
  .case-grid,
  .testimonial-grid,
  .feature-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    padding: 16px;
  }

  .to-top {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Impresion ---------- */
@media print {
  .site-header,
  .site-footer,
  .nav,
  .nav-toggle,
  .to-top,
  .cta-band,
  .filters,
  .cookie-banner {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}


/* ==========================================================================
   AJUSTES RESPONSIVOS FINALES (alta prioridad en cascada)
   Se declaran al final para que ninguna regla anterior los anule.
   ========================================================================== */
@media (max-width: 900px) {
  .site-header__inner {
    column-gap: 12px;
    flex-wrap: nowrap;
  }

  .brand {
    max-width: 58%;
    min-width: 0;
  }

  .brand__name {
    font-size: 1.05rem;
  }

  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .header-cta {
    display: none !important;
  }

  .site-header .nav {
    display: none !important;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: #fff;
    padding: 8px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    z-index: 60;
  }

  .site-header .nav.is-open {
    display: flex !important;
  }

  .site-header .nav__link {
    padding: 12px 10px;
    font-size: 1rem;
    justify-content: flex-start;
  }

  /* Tipografía y contenedores: evita desbordes horizontales en móvil */
  h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .hero__lead,
  .article p,
  .article li {
    max-width: 100%;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .btn {
    white-space: normal;
    text-align: center;
  }

  .hero__stats {
    gap: 12px;
  }

  .hero__figure {
    margin-top: 20px;
  }

  .two-col,
  .calc-layout {
    grid-template-columns: 1fr;
  }

  .breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap,
  table {
    min-width: 0;
  }

  table {
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 8px 10px;
  }

  .article__figure img,
  .cam-card__thumb img,
  .case-card__img {
    height: auto;
  }
}

@media (max-width: 420px) {
  .page,
  body {
    overflow-x: hidden;
  }

  .badge-list {
    gap: 6px;
  }

  .btn {
    width: 100%;
  }

  .cta-band__actions {
    flex-direction: column;
  }
}


/* ---- Móvil: contención de ancho (evita desbordes horizontales) ---- */
@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .hero,
  .hero__head,
  .container,
  .site-header__inner {
    max-width: 100%;
  }

  .hero__head h1,
  .hero h1 {
    font-size: clamp(1.35rem, 6.2vw, 1.85rem);
    line-height: 1.25;
    text-align: left;
  }

  .hero__stats {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero__head {
    text-align: left;
    margin: 0;
  }

  .btn {
    max-width: 100%;
  }
}


/* Tablas en móvil: se permite el desplazamiento dentro del contenedor en lugar
   de forzar la tabla al ancho de la pantalla (evita desbordes horizontales). */
@media (max-width: 900px) {
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .table-wrap table,
  table.spec-table {
    min-width: 480px;
  }

  .spec-table th,
  .spec-table td {
    padding: 9px 12px;
    font-size: 0.84rem;
    overflow-wrap: break-word;
  }

  .spec-table caption {
    font-size: 0.85rem;
  }
}


/* ---- Móvil: el layout de dos columnas pasa a una sola de forma explícita.
   Sin esto el aside de 320 px seguía sumando ancho y desbordaba la página. ---- */
@media (max-width: 900px) {
  .two-col,
  .two-col--even,
  .two-col--left,
  .two-col--right {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px;
  }

  .two-col > aside,
  .two-col > .filters,
  .two-col > .results-col {
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    top: auto !important;
  }

  .article,
  .article--wide {
    max-width: 100%;
    min-width: 0;
  }

  .article__figure img,
  .article figure img {
    width: 100%;
    height: auto;
  }
}


/* ==========================================================================
   CABECERA — LAYOUT DEFINITIVO
   Se usa grid con tres columnas fijas (marca | menú | acción) en lugar de
   flex con space-between. Con flex, el menú podía crecer y montarse sobre el
   logo cuando la marca era ancha. Con grid, la marca y el menú nunca comparten
   espacio: si el menú no cabe, se colapsa a hamburguesa.
   ========================================================================== */
.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  height: var(--header-h);
}

.site-header .brand {
  grid-column: 1;
  flex: 0 0 auto;
  max-width: none;
  min-width: 0;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.site-header .brand__text {
  min-width: 0;
  overflow: hidden;
}

.site-header .brand__name {
  white-space: nowrap;
}

.site-header .nav {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  flex-wrap: nowrap;
  position: relative;
  z-index: 1;
}

.site-header .nav__link {
  white-space: nowrap;
  flex: 0 0 auto;
}

.site-header .header-cta {
  grid-column: 3;
  flex: 0 0 auto;
}

/* Puntos de corte por ancho disponible real del menú, no por capricho:
   9 enlaces + marca con subtítulo necesitan ~1180 px de contenido. */
@media (max-width: 1320px) {
  .site-header .brand__tag {
    display: none;
  }
}

@media (max-width: 1120px) {
  .site-header .header-cta {
    display: none;
  }

  .site-header .nav__link {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 0.92rem;
  }
}

@media (max-width: 900px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
  }

  .site-header .brand {
    grid-column: 1;
    max-width: 100%;
  }

  .site-header .nav-toggle {
    grid-column: 2;
    justify-self: end;
    display: inline-flex !important;
  }

  .site-header .nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: none !important;
  }

  .site-header .nav.is-open {
    display: flex !important;
  }
}


/* La marca nunca debe crecer sobre el menú: se limita a su contenido real y se
   recorta el subtítulo si hiciera falta. Esto elimina el solapamiento que
   aparecía por encima de 1400 px, donde el grid repartía espacio de sobra. */
@media (min-width: 901px) {
  .site-header__inner {
    grid-template-columns: min-content minmax(0, 1fr) min-content;
    column-gap: 32px;
  }

  .site-header .brand {
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
  }

  .site-header .nav {
    justify-self: end;
    width: max-content;
    max-width: 100%;
  }

  .site-header .header-cta {
    justify-self: end;
  }
}

/* El menú se oculta con antelación suficiente para que nunca haga falta
   comprimirlo hasta cruzar la marca. */
@media (min-width: 901px) and (max-width: 1180px) {
  .site-header .nav__link {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 0.88rem;
  }
}

@media (max-width: 1180px) {
  .site-header .header-cta {
    display: none;
  }
}


/* DIAGNÓSTICO Y CORRECCIÓN FINAL DEL SOLAPAMIENTO
   El grid repartía columnas correctamente, pero el menú tenía `position: relative`
   y anchos heredados que lo desplazaban sobre la marca. Se fuerza flujo normal y
   alineación estricta a la derecha dentro de su propia columna. */
@media (min-width: 901px) {
  .site-header .nav {
    position: static !important;
    transform: none !important;
    margin-left: 0 !important;
    width: auto !important;
    max-width: 100%;
    justify-self: end;
    align-self: center;
  }

  .site-header .brand {
    position: static !important;
    transform: none !important;
    grid-column: 1;
    align-self: center;
  }

  .site-header .nav__link {
    position: static !important;
  }

  .site-header .header-cta {
    position: static !important;
    align-self: center;
  }
}


/* El menú se expandía hacia la IZQUIERDA de su columna y se montaba sobre la
   marca. Se fija su contenido al borde derecho de su propia celda con un
   contexto de formato correcto, y se impide cualquier desborde hacia atrás. */
.site-header .nav {
  overflow: visible;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: flex-wrap;
}

.site-header .nav__link:first-child {
  margin-left: 0;
}

/* Refuerzo: la celda del menú comienza donde acaba la marca.
   Se usa una sola columna flexible que arranca tras el logo. */
@media (min-width: 901px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    column-gap: 40px;
  }

  .site-header .nav {
    min-width: 0;
    justify-self: stretch;
    display: flex;
    justify-content: flex-end;
  }

  .site-header .nav__link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* ==========================================================================
   CORRECCIÓN REAL DEL SOLAPAMIENTO >= 1400 px
   Causa: la columna de la marca usaba `auto`, que crece con el contenido, y el
   subtítulo del logo (min-width: auto en flex/grid) empujaba la celda más allá
   de lo visible, invadiendo la columna del menú. Aquí se fija el tamaño de la
   marca a su contenido real y se impide que el texto ensanche la celda.
   ========================================================================== */
.site-header__inner > .brand {
  width: fit-content;
  max-width: min(340px, 42vw);
  min-width: 0;
  overflow: hidden;
}

.site-header__inner > .brand > .brand__text {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.site-header__inner > .brand .brand__name,
.site-header__inner > .brand .brand__tag {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 901px) {
  .site-header__inner {
    /* la marca ocupa exactamente su contenido; el menú recibe todo el resto */
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    column-gap: 48px;
  }

  .site-header__inner > .nav {
    justify-self: end;
    width: auto;
    min-width: 0;
  }
}


/* ==========================================================================
   SOLUCIÓN DEFINITIVA DEL SOLAPAMIENTO
   El menú necesita ~750 px para sus 9 enlaces, pero su celda del grid solo
   recibía 595 px: el contenido se desbordaba 157 px hacia la izquierda y se
   montaba sobre el logo. Con `justify-content: flex-end` el desborde va hacia
   atrás, que es justo lo que se veía.
   Se elimina la causa: el menú NUNCA se le permite encogerse (flex-shrink hace
   que su contenido salga de la caja). Si no cabe, se colapsa a hamburguesa.
   ========================================================================== */
@media (min-width: 901px) {
  .site-header .nav {
    flex-shrink: 0;
    flex-grow: 0;
    width: max-content;
    max-width: none;
    overflow: visible;
  }

  .site-header__inner {
    /* el hueco entre marca y menú se reparte con el espacio libre, no con gap fijo */
    column-gap: clamp(16px, 2.5vw, 40px);
  }
}

/* El menú completo necesita ~800 px reales. Por debajo se usa hamburguesa para
   que jamás pueda desbordarse sobre la marca. */
@media (min-width: 901px) and (max-width: 1300px) {
  .site-header .nav-toggle {
    display: inline-flex !important;
    grid-column: 3;
    justify-self: end;
  }

  .site-header__inner {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
  }

  .site-header .nav {
    display: none !important;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: auto;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    padding: 8px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }

  .site-header .nav.is-open {
    display: flex !important;
  }

  .site-header .header-cta {
    display: none;
  }
}

@media (min-width: 1301px) {
  .site-header .nav-toggle {
    display: none !important;
  }
}


/* ==========================================================================
   REPARTO DEL GRID EN LA CABECERA (causa raíz)
   Medido a 1440 px: marca 300 + menú 752 + botón 109 = 1161 px de contenido,
   pero el inner sólo tenía 1140 px y el grid comprimía la celda del menú a 619.
   Con `justify-content: flex-end` la diferencia salía por la izquierda, encima
   del logo (97 px medidos).
   Solución: la celda del menú se dimensiona a `max-content` (nunca por debajo
   de su contenido) y se oculta con hamburguesa en cuanto no quepa de verdad.
   ========================================================================== */
@media (min-width: 901px) {
  .site-header__inner {
    grid-template-columns: max-content max-content max-content;
    justify-content: space-between;
    column-gap: clamp(16px, 2vw, 32px);
  }

  .site-header .nav {
    grid-column: 2;
    width: max-content;
    min-width: max-content;   /* el menú manda: nunca se comprime por debajo de su texto */
    justify-self: end;
  }
}

/* A partir de 1340 px de viewport el menú completo ya cabe: 300+752+109+gaps. */
@media (min-width: 901px) and (max-width: 1339px) {
  .site-header .nav-toggle {
    display: inline-flex !important;
  }

  .site-header .header-cta {
    display: none !important;
  }

  .site-header__inner {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
  }

  .site-header .nav {
    display: none !important;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    padding: 8px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }

  .site-header .nav.is-open {
    display: flex !important;
  }
}

@media (min-width: 1340px) {
  .site-header .nav-toggle {
    display: none !important;
  }
}


/* ==========================================================================
   TARJETA DE RESULTADOS EN CLARO (.results--light)
   El bloque .breakdown estaba diseñado solo para el fondo oscuro: su valor era
   blanco y sus celdas tenían blanco translúcido. Dentro de la tarjeta clara
   (recomendador de la portada) los números desaparecían. Aquí se define su
   versión sobre fondo claro.
   ========================================================================== */
.results--light .breakdown__item {
  background: #ffffff;
  border: 1px solid var(--border);
}

.results--light .breakdown__label {
  color: var(--slate-500);
}

.results--light .breakdown__value {
  color: var(--navy-900);
}

.results--light .breakdown__value--accent {
  color: var(--amber-700);
}

/* Típografía de los valores: permiten partirse sin solaparse en tarjetas estrechas */
.results--light .breakdown__value {
  font-size: clamp(0.95rem, 1.6vw, 1.12rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.results--light .breakdown__label {
  min-height: 2.2em;
  display: flex;
  align-items: flex-start;
}

.results--light .results__note a {
  color: var(--amber-700);
  font-weight: 700;
}

@media (max-width: 620px) {
  .results--light .breakdown {
    grid-template-columns: 1fr;
  }

  .results--light .breakdown__label {
    min-height: 0;
  }
}
