/* =====================================================================
   Chatell — Encabezado y pie para todo el sitio
   Todo está aislado bajo .chm para no afectar los estilos de Divi.
   ===================================================================== */

/* 1) Ocultar encabezado y pie del tema (Divi clásico y Theme Builder) */
body.chm-on #top-header,
body.chm-on #main-header,
body.chm-on #main-footer,
body.chm-on #footer-bottom,
body.chm-on .et-l--header,
body.chm-on .et-l--footer { display: none !important; }
body.chm-on #page-container { padding-top: 0 !important; margin-top: 0 !important; }
body.chm-on.et_fixed_nav #page-container,
body.chm-on.et_non_fixed_nav #page-container { padding-top: 0 !important; }

/* 2) Base aislada */
.chm {
  --chm-navy-900: #0A1628; --chm-navy-800: #0E1B2C; --chm-blue: #2B5FA8; --chm-blue-dark: #1C4580;
  --chm-on: #FFFFFF; --chm-on-2: #C9D3E0; --chm-on-3: #9FB1C8; --chm-ink: #0E1B2C;
  --chm-display: 'Unbounded', system-ui, sans-serif; --chm-text: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--chm-text); font-size: 15px; line-height: 1.5; color: var(--chm-on-2);
  -webkit-font-smoothing: antialiased; text-align: left; letter-spacing: normal;
}
.chm *, .chm *::before, .chm *::after { box-sizing: border-box; }
.chm p, .chm b { margin: 0; padding: 0; }
.chm a { text-decoration: none; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.chm img { display: block; max-width: none; border: 0; }
.chm svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chm button { font: inherit; cursor: pointer; }
.chm :focus-visible { outline: 3px solid #7FB0F0; outline-offset: 2px; border-radius: 6px; }
.chm-wrap { width: 100%; max-width: 1248px; margin: 0 auto; padding: 0 24px; }

/* 3) Barra superior */
.chm-top { background: var(--chm-navy-900); font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.06); }
.chm-top__in { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chm-top__group { display: flex; align-items: center; gap: 20px; }
.chm-top__item { display: flex; align-items: center; gap: 8px; color: var(--chm-on-2); }
.chm-top__item svg { width: 15px; height: 15px; stroke: #7F93AD; flex-shrink: 0; }
.chm .chm-top a { color: var(--chm-on); }
.chm .chm-top a:hover { color: var(--chm-on-2); }
.chm-sep { width: 1px; height: 16px; background: rgba(255,255,255,.16); }

/* 4) Menú */
.chm-header { display: contents; }
.chm-nav { position: sticky; top: 0; z-index: 9999; background: var(--chm-navy-800); border-bottom: 1px solid rgba(255,255,255,.08); }
.chm-nav__in { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.chm .chm-logo { display: inline-flex; flex-direction: column; align-items: stretch; gap: 6px; color: var(--chm-on); }
.chm .chm-logo:hover { color: var(--chm-on); }
.chm-logo__name { font-family: var(--chm-display); font-weight: 700; font-size: 28px; line-height: 1; letter-spacing: .16em; margin-right: -.16em; white-space: nowrap; }
.chm-logo__rule { height: 1px; background: rgba(255,255,255,.22); }
.chm-logo__sub { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 700; line-height: 1; color: var(--chm-on-3); }
.chm-logo__sub i { font-style: normal; }
.chm-logo__sub i.sp { width: 3px; }
.chm-links { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); font-size: 15px; font-weight: 500; }
.chm .chm-links > a { color: #E6ECF3; padding: 8px 0; }
.chm .chm-links > a:hover { color: var(--chm-on); }
.chm-links__extra { display: none; }
.chm-actions { display: flex; gap: 12px; }
.chm .chm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid transparent; white-space: nowrap; }
.chm .chm-btn img { width: 20px; height: 20px; flex-shrink: 0; }
.chm .chm-btn--accent { background: var(--chm-blue); color: #fff; }
.chm .chm-btn--accent:hover { background: var(--chm-blue-dark); color: #fff; }
.chm .chm-btn--ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.chm .chm-btn--ghost:hover { border-color: #fff; color: #fff; }
.chm .chm-btn--light { background: #fff; color: var(--chm-ink); }
.chm .chm-btn--light:hover { background: #EEF1F5; color: var(--chm-ink); }
.chm-burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; align-items: center; justify-content: center; padding: 0; }
.chm-burger svg { width: 22px; height: 22px; }
body.admin-bar .chm-nav { top: 32px; }

/* 5) Pie */
.chm-footer { background: var(--chm-navy-900); padding: 64px 0 40px; font-size: 14px; }
.chm-footer__top { display: flex; justify-content: space-between; gap: 48px; }
.chm-footer__top .chm-logo { align-self: flex-start; }
.chm-footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 48px; }
.chm-footer__cols div { display: flex; flex-direction: column; gap: 10px; }
.chm-footer__cols b { color: #fff; font-weight: 600; }
.chm .chm-footer__cols a { color: var(--chm-on-2); }
.chm .chm-footer__cols a:hover { color: #fff; }
.chm-footer__legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; line-height: 1.6; color: #8A9AB0; }

/* 6) Barra fija de WhatsApp en celular */
.chm-mbar { display: none; }

/* 7) Responsive */
@media (max-width: 1180px) {
  .chm-actions .chm-btn--ghost { display: none; }
  .chm-footer__top { flex-direction: column; }
  .chm-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
}
@media (max-width: 1024px) {
  .chm-hide-md { display: none !important; }
  .chm-nav__in { min-height: 76px; }
  .chm-actions { display: none; }
  .chm-burger { display: inline-flex; }
  .chm-links { position: fixed; left: 0; right: 0; top: var(--chm-menu-top, 76px); bottom: 0; background: var(--chm-navy-800); flex-direction: column; align-items: stretch; gap: 0; padding: 12px 24px 32px; overflow: auto; transform: translateX(100%); transition: transform .3s ease; visibility: hidden; }
  .chm-links.is-open { transform: none; visibility: visible; }
  .chm .chm-links > a { font-size: 20px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .chm-links__extra { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
  .chm-links__extra .chm-btn { min-height: 48px; font-size: 15px; }
}
@media (max-width: 782px) { body.admin-bar .chm-nav { top: 46px; } }
@media (max-width: 720px) {
  .chm-wrap { padding: 0 16px; }
  .chm-top__in { justify-content: center; min-height: 40px; font-size: 12px; }
  .chm-top__group:first-child { display: none; }
  .chm-logo__name { font-size: 22px; }
  .chm-logo__sub { font-size: 7px; }
  .chm-logo__sub i.sp { width: 2px; }
  .chm-footer__cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  body.chm-on { padding-bottom: 84px; }
  .chm-mbar { display: flex; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 9998; }
  .chm-mbar .chm-btn { flex: 1; min-height: 54px; font-size: 15px; box-shadow: 0 6px 20px rgba(10,22,40,.3); }
}
@media (prefers-reduced-motion: reduce) { .chm * { transition: none !important; } }
