/* RUAF header (Claude design 02) */
/* ---------- Variables y base encapsulada ---------- */
.ruaf-header{
  --ruaf-teal:#087F8C;
  --ruaf-teal-dark:#066772;
  --ruaf-navy:#123B50;
  --ruaf-teal-light:#E7F5F3;
  --ruaf-bg:#F4F8FA;
  --ruaf-amber:#F2B544;
  --ruaf-white:#FFFFFF;
  --ruaf-h:68px;
  position:relative;
  width:100%;
  background:var(--ruaf-white);
  border-bottom:1px solid var(--ruaf-teal-light);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  line-height:1.4;
  -webkit-text-size-adjust:100%;
}
.ruaf-header *,
.ruaf-header *::before,
.ruaf-header *::after{box-sizing:border-box}

.ruaf-header ul{list-style:none;margin:0;padding:0}
.ruaf-header li{margin:0;padding:0}

.ruaf-header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  max-width:1240px;
  min-height:var(--ruaf-h);
  margin:0 auto;
  padding:0 clamp(16px,3vw,32px);
}

/* ---------- Logotipo + nombre ---------- */
.ruaf-header .ruaf-header__brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
  padding:6px 4px;
  border-radius:8px;
  text-decoration:none;
  color:var(--ruaf-navy);
}
.ruaf-header .ruaf-header__brand:hover{color:var(--ruaf-navy)}
.ruaf-header .ruaf-header__logo{display:block;width:40px;height:36px;flex:0 0 auto}
.ruaf-header .ruaf-header__name{
  font-family:'Poppins',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  font-weight:700;
  font-size:19px;
  line-height:1.1;
  letter-spacing:-.01em;
  color:var(--ruaf-navy);
  white-space:nowrap;
}

/* ---------- Navegación ---------- */
.ruaf-header .ruaf-header__link{
  display:block;
  padding:10px 11px;
  border-radius:8px;
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  font-size:15px;
  font-weight:500;
  line-height:1.2;
  color:var(--ruaf-navy);
  text-decoration:none;
  transition:color .15s ease,background-color .15s ease;
}
.ruaf-header .ruaf-header__link:hover{
  color:var(--ruaf-teal);
  background-color:var(--ruaf-bg);
}
.ruaf-header .ruaf-header__link[aria-current="page"]{
  color:var(--ruaf-teal);
  text-decoration:underline;
  text-decoration-color:var(--ruaf-amber);
  text-decoration-thickness:2px;
  text-underline-offset:8px;
}

/* ---------- Botón CTA ---------- */
.ruaf-header .ruaf-header__cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex:0 0 auto;
  padding:11px 18px;
  border-radius:10px;
  background-color:var(--ruaf-teal);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  font-size:15px;
  font-weight:600;
  line-height:1.2;
  color:var(--ruaf-white);
  text-decoration:none;
  white-space:nowrap;
  transition:background-color .15s ease;
}
.ruaf-header .ruaf-header__cta:hover,
.ruaf-header .ruaf-header__cta:focus-visible{
  background-color:var(--ruaf-teal-dark);
  color:var(--ruaf-white);
}
.ruaf-header .ruaf-header__ext{display:block;width:15px;height:15px;flex:0 0 auto}

/* ---------- Foco visible ---------- */
.ruaf-header a:focus-visible,
.ruaf-header .ruaf-header__toggle:focus-visible{
  outline:2px solid var(--ruaf-teal);
  outline-offset:2px;
}
.ruaf-header .ruaf-header__cta:focus-visible{outline-color:var(--ruaf-navy)}

/* ---------- Botón hamburguesa ---------- */
.ruaf-header .ruaf-header__toggle{
  display:none;
  appearance:none;
  -webkit-appearance:none;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:44px;
  height:44px;
  margin:0 -8px 0 0;
  padding:0;
  border:0;
  border-radius:10px;
  background:transparent;
  box-shadow:none;
  color:var(--ruaf-navy);
  cursor:pointer;
}
.ruaf-header .ruaf-header__toggle:hover{background:var(--ruaf-bg);color:var(--ruaf-navy)}
.ruaf-header .ruaf-header__bars{position:relative;display:block;width:22px;height:16px}
.ruaf-header .ruaf-header__bars span{
  position:absolute;left:0;width:100%;height:2px;border-radius:2px;
  background:currentColor;
  transition:transform .2s ease,opacity .15s ease,top .2s ease;
}
.ruaf-header .ruaf-header__bars span:nth-child(1){top:0}
.ruaf-header .ruaf-header__bars span:nth-child(2){top:7px}
.ruaf-header .ruaf-header__bars span:nth-child(3){top:14px}
.ruaf-header .ruaf-header__toggle[aria-expanded="true"] .ruaf-header__bars span:nth-child(1){top:7px;transform:rotate(45deg)}
.ruaf-header .ruaf-header__toggle[aria-expanded="true"] .ruaf-header__bars span:nth-child(2){opacity:0}
.ruaf-header .ruaf-header__toggle[aria-expanded="true"] .ruaf-header__bars span:nth-child(3){top:7px;transform:rotate(-45deg)}

/* ---------- Escritorio (≥ 1025 px, mismo punto de corte que Kadence) ---------- */
@media (min-width:1025px){
  .ruaf-header .ruaf-header__panel{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex:1 1 auto;
    gap:18px;
  }
  .ruaf-header .ruaf-header__nav ul{display:flex;align-items:center;gap:2px}
}
@media (min-width:1025px) and (max-width:1180px){
  .ruaf-header .ruaf-header__link{padding:10px 8px;font-size:14.5px}
  .ruaf-header .ruaf-header__cta{padding:10px 15px;font-size:14.5px}
  .ruaf-header .ruaf-header__panel{gap:12px}
}

/* ---------- Tablet y móvil (≤ 1024 px) ---------- */
@media (max-width:1024px){
  .ruaf-header{--ruaf-h:64px}
  .ruaf-header .ruaf-header__name{font-size:18px}

  /* Sin JS el menú queda visible apilado; con JS se convierte en desplegable */
  .ruaf-header .ruaf-header__panel{
    padding:8px clamp(16px,3vw,32px) 20px;
    background:var(--ruaf-white);
  }
  .ruaf-header.is-ready .ruaf-header__toggle{display:inline-flex}
  .ruaf-header.is-ready .ruaf-header__panel{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    right:0;
    max-height:calc(100vh - var(--ruaf-h) - 16px);
    overflow-y:auto;
    border-bottom:1px solid var(--ruaf-teal-light);
    box-shadow:0 10px 18px -14px rgba(18,59,80,.25);
  }
  .ruaf-header.is-ready .ruaf-header__panel.is-open{display:block}

  .ruaf-header .ruaf-header__nav ul{display:block}
  .ruaf-header .ruaf-header__nav li{border-bottom:1px solid var(--ruaf-teal-light)}
  .ruaf-header .ruaf-header__link{
    min-height:48px;
    padding:14px 8px;
    border-radius:0;
    font-size:16px;
    display:flex;
    align-items:center;
  }
  .ruaf-header .ruaf-header__link:hover{background-color:transparent}
  .ruaf-header .ruaf-header__link[aria-current="page"]{text-underline-offset:6px}
  .ruaf-header .ruaf-header__cta{
    display:flex;
    width:100%;
    min-height:48px;
    margin-top:16px;
    font-size:16px;
  }
}

@media (max-width:359px){
  .ruaf-header .ruaf-header__logo{width:34px;height:31px}
  .ruaf-header .ruaf-header__name{font-size:16.5px}
  .ruaf-header .ruaf-header__brand{gap:8px}
}

@media (prefers-reduced-motion:reduce){
  .ruaf-header *{transition:none !important}
}

/* ---------- Integración con Kadence (solo actúa si existe .ruaf-header) ---------- */
/* Sticky: se aplica al contenedor del header de Kadence */
#masthead:has(.ruaf-header){
  position:sticky;
  top:0;
  z-index:1000;
  background:#FFFFFF;
}
body.admin-bar #masthead:has(.ruaf-header){top:32px}
@media (max-width:782px){
  body.admin-bar #masthead:has(.ruaf-header){top:46px}
}
/* Quita relleno y alturas mínimas de las filas de Kadence para que no haya saltos ni doble espacio */
#masthead:has(.ruaf-header) .site-header-row-container-inner,
#masthead:has(.ruaf-header) .site-main-header-inner-wrap,
#masthead:has(.ruaf-header) .site-header-row-container-inner > .site-container{
  min-height:0;
  padding-top:0;
  padding-bottom:0;
}
#masthead:has(.ruaf-header) .site-header-row-container-inner > .site-container{
  max-width:none;
  padding-left:0;
  padding-right:0;
}
#masthead:has(.ruaf-header) .site-header-section,
#masthead:has(.ruaf-header) .site-header-item,
#masthead:has(.ruaf-header) .header-html{
  flex:1 1 100%;
  width:100%;
  max-width:100%;
  margin:0;
}

/* Evita que el header sticky tape el título al ir a #como-consultar */
#como-consultar{scroll-margin-top:90px}

/* RUAF footer (Claude design 03) */
.ruaf-footer{
  --rf-bg:#123B50;
  --rf-teal:#087F8C;
  --rf-teal-soft:#E7F5F3;
  --rf-light:#F4F8FA;
  --rf-amber:#F2B544;
  --rf-text:#FFFFFF;
  --rf-text-2:#D5E2E8;
  --rf-line:rgba(255,255,255,.15);
  --rf-font-title:"Poppins",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --rf-font-body:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  box-sizing:border-box;
  width:100%;
  background:var(--rf-bg);
  color:var(--rf-text-2);
  font-family:var(--rf-font-body);
  font-size:15px;
  line-height:1.6;
  -webkit-text-size-adjust:100%;
}
.ruaf-footer *,.ruaf-footer *::before,.ruaf-footer *::after{box-sizing:border-box}
.ruaf-footer__inner{max-width:1200px;margin:0 auto;padding:56px 24px 0}
.ruaf-footer__grid{display:grid;grid-template-columns:1fr;gap:36px 32px}
.ruaf-footer__brand{min-width:0}
.ruaf-footer__logo{display:inline-flex;align-items:center;gap:12px;text-decoration:none}
.ruaf-footer .ruaf-footer__logo,.ruaf-footer .ruaf-footer__logo:hover{color:var(--rf-text);text-decoration:none}
.ruaf-footer__logo svg{flex:none;width:44px;height:44px;display:block}
.ruaf-footer__name{font-family:var(--rf-font-title);font-weight:700;font-size:22px;line-height:1.2;color:var(--rf-text)}
.ruaf-footer__desc{max-width:36ch;margin:18px 0 18px;color:var(--rf-text-2);font-size:15px;line-height:1.65}
.ruaf-footer__tag{display:inline-flex;align-items:center;gap:8px;padding:5px 12px;border-radius:999px;background:var(--rf-teal-soft);color:var(--rf-bg);font-size:13px;font-weight:600;line-height:1.4}
.ruaf-footer__tag::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--rf-teal)}
.ruaf-footer .ruaf-footer__title{margin:0 0 18px;padding:0 0 12px;position:relative;font-family:var(--rf-font-title);font-weight:600;font-size:17px;line-height:1.3;letter-spacing:0;text-transform:none;color:var(--rf-text)}
.ruaf-footer .ruaf-footer__title::after{content:"";position:absolute;left:0;bottom:0;width:32px;height:3px;border-radius:2px;background:var(--rf-amber)}
.ruaf-footer__list{list-style:none;margin:0;padding:0}
.ruaf-footer__list li{margin:0;padding:0}
.ruaf-footer .ruaf-footer__link{display:inline-block;padding:6px 0;color:var(--rf-text-2);font-size:15px;line-height:1.45;text-decoration:none;border-radius:3px;transition:color .15s ease}
.ruaf-footer .ruaf-footer__link:hover{color:var(--rf-teal-soft);text-decoration:underline;text-decoration-color:var(--rf-teal-soft);text-underline-offset:4px}
.ruaf-footer .ruaf-footer__link:focus-visible,
.ruaf-footer .ruaf-footer__logo:focus-visible{outline:2px solid var(--rf-amber);outline-offset:3px;color:var(--rf-text)}
.ruaf-footer__bar{margin-top:48px;padding:22px 0 26px;border-top:1px solid var(--rf-line);display:flex;flex-direction:column;gap:16px}
.ruaf-footer__copy{margin:0;font-size:14px;line-height:1.5;color:var(--rf-text-2)}
.ruaf-footer__notice{margin:0;display:flex;align-items:flex-start;justify-content:center;gap:10px;padding:10px 14px;border:1px solid var(--rf-line);border-left:3px solid var(--rf-amber);border-radius:6px;font-size:14px;line-height:1.5;font-weight:500;text-align:center;color:var(--rf-text)}
.ruaf-footer__notice svg{flex:none;width:18px;height:18px;margin-top:2px;display:block}
@media (min-width:480px){
  .ruaf-footer__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ruaf-footer__brand{grid-column:1 / -1}
}
@media (min-width:768px){
  .ruaf-footer__inner{padding:64px 32px 0}
  .ruaf-footer__brand{grid-column:auto}
  .ruaf-footer__grid{gap:44px 48px}
}
@media (min-width:1024px){
  .ruaf-footer__grid{grid-template-columns:1.5fr 1fr 1fr 1fr;gap:40px 48px}
  .ruaf-footer__bar{flex-direction:row;align-items:center;justify-content:space-between;gap:24px}
  .ruaf-footer__notice{justify-content:flex-start;padding:0 0 0 12px;border:0;border-left:3px solid var(--rf-amber);border-radius:0;text-align:left}
}
@media (prefers-reduced-motion:reduce){
  .ruaf-footer .ruaf-footer__link{transition:none}
}

/* ---------- RUAF Site Frame integration (plugin) ---------- */
/* Hide the Kadence theme header/footer: this plugin replaces both. */
#masthead{display:none !important}
.site-footer,#colophon{display:none !important}
/* The custom header itself is sticky (it no longer lives inside #masthead). */
.ruaf-header{position:sticky;top:0;z-index:1000}
body.admin-bar .ruaf-header{top:32px}
@media (max-width:782px){body.admin-bar .ruaf-header{top:46px}}
