/* Alvernia · Gestor Headers 2.0 | Flatsome Classic + UX Blocks */
:root { --alv-gh-height:112px; --alv-gh-admin-top:0px; }
body.alv-gh-enabled #header { display:none !important; }

/* Un espaciador es suficiente; evita los 100/112px adicionales de los HTML anteriores. */
body.alv-gh-enabled #alv-gh-spacer {
  height:var(--alv-gh-height) !important;
  min-height:var(--alv-gh-height) !important;
  max-height:none !important;
  padding:0!important; margin:0!important; border:0!important;
  background:transparent!important; pointer-events:none;
}
body.alv-gh-enabled #alv-gh-root {
  position:fixed !important; inset:auto 0 auto 0 !important;
  top:var(--alv-gh-admin-top, 0px) !important;
  z-index:9500 !important; display:block !important;
  width:100% !important; max-width:100% !important;
  box-sizing:border-box; margin:0!important; padding:0!important;
  border-bottom:1px solid transparent;
  background:#fffdfb;
  box-shadow:0 4px 20px rgba(91,29,44,.045);
  transition:box-shadow .38s cubic-bezier(.2,.8,.2,1), background-color .38s, border-color .38s;
}
body.alv-gh-enabled #alv-gh-root .alv-gh-content {
  position:relative; width:100%; max-width:100%; padding:0!important; margin:0!important;
}
/* El header queda fijo por el gestor, nunca por el UX Block interno. */
body.alv-gh-enabled #alv-gh-root #alv-f-header,
body.alv-gh-enabled #alv-gh-root #alv-casa-header {
  position:relative!important; inset:auto!important; top:auto!important;
  left:auto!important; right:auto!important; bottom:auto!important;
  z-index:auto!important; width:100%!important;
  margin:0!important; padding:0!important; transform:none!important;
  box-shadow:none!important;
}
/* Espaciadores antiguos, presentes en los HTML 1.x: ahora son innecesarios. */
body.alv-gh-enabled #alv-gh-root #alv-f-header-spacer,
body.alv-gh-enabled #alv-gh-root #alv-casa-header-space {
  display:none!important; height:0!important; min-height:0!important;
  max-height:0!important; margin:0!important; padding:0!important;
}
/* Si quedan headers pegados manualmente en una landing, no duplicarlos. */
body.alv-gh-enabled #main #alv-f-header,
body.alv-gh-enabled #main #alv-f-header-spacer,
body.alv-gh-enabled #main #alv-casa-header,
body.alv-gh-enabled #main #alv-casa-header-space {
  display:none!important; height:0!important; min-height:0!important;
}

/* Transición suave y compactación con una sola altura de contenido constante. */
body.alv-gh-enabled #alv-gh-root .alv-f-topbar,
body.alv-gh-enabled #alv-gh-root .ca-head-top {
  overflow:hidden;
  transition:height .36s cubic-bezier(.22,1,.36,1),
    min-height .36s cubic-bezier(.22,1,.36,1),opacity .24s ease;
}
body.alv-gh-enabled #alv-gh-root .alv-f-main,
body.alv-gh-enabled #alv-gh-root .ca-head-main {
  transition:min-height .36s cubic-bezier(.22,1,.36,1),padding .36s cubic-bezier(.22,1,.36,1);
}
body.alv-gh-enabled #alv-gh-root .alv-f-logo,
body.alv-gh-enabled #alv-gh-root .ca-head-brand img {
  transition:width .36s cubic-bezier(.22,1,.36,1),height .36s cubic-bezier(.22,1,.36,1);
}
body.alv-gh-enabled #alv-gh-root.alv-gh-compact {
  box-shadow:0 9px 29px rgba(87,29,44,.14);
  background:rgba(255,253,252,.97);
  border-bottom-color:rgba(152,43,67,.13);
  -webkit-backdrop-filter:blur(13px); backdrop-filter:blur(13px);
}
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .alv-f-topbar,
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .ca-head-top {
  height:0!important; min-height:0!important; max-height:0!important;
  opacity:0!important; pointer-events:none;
}
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .alv-f-main { min-height:66px!important; }
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .alv-f-logo { width:148px!important; height:48px!important; }
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .ca-head-main { min-height:67px!important; }
body.alv-gh-enabled #alv-gh-root.alv-gh-compact .ca-head-brand img { width:62px!important; height:46px!important; }

/* Anclas del menú: nunca quedan escondidas por el sticky. */
html:has(body.alv-gh-enabled) {
  scroll-padding-top:calc(var(--alv-gh-compact-height, 72px) + var(--alv-gh-admin-top,0px) + 18px);
}
body.alv-gh-enabled [id^="alv-"] { scroll-margin-top:calc(var(--alv-gh-compact-height, 72px) + 18px); }

/* Respaldo cuando Wordpress reserva 46px para una barra de admin invisible. */
html.alv-gh-admin-hidden { margin-top:0!important; padding-top:0!important; }
html.alv-gh-admin-hidden body { margin-top:0!important; }

/* Menús desplegables: no recortar con el contenedor global. */
body.alv-gh-enabled #alv-gh-root,
body.alv-gh-enabled #alv-gh-root .alv-gh-content { overflow:visible!important; }
body.alv-gh-enabled #alv-gh-root .alv-f-mobile-nav,
body.alv-gh-enabled #alv-gh-root .ca-head-mobilemenu {
  max-height:calc(100dvh - var(--alv-gh-admin-top,0px) - 78px);
  overflow-y:auto;overscroll-behavior:contain;
}

@media (max-width:650px) {
  body.alv-gh-enabled #alv-gh-root.alv-gh-compact .alv-f-main { min-height:61px!important; }
  body.alv-gh-enabled #alv-gh-root.alv-gh-compact .alv-f-logo { width:140px!important; height:45px!important; }
  body.alv-gh-enabled #alv-gh-root.alv-gh-compact .ca-head-main { min-height:62px!important; }
  body.alv-gh-enabled #alv-gh-root.alv-gh-compact .ca-head-brand img { width:55px!important; height:42px!important; }
}
@media(prefers-reduced-motion:reduce) {
  body.alv-gh-enabled #alv-gh-root,
  body.alv-gh-enabled #alv-gh-root .alv-f-topbar,
  body.alv-gh-enabled #alv-gh-root .ca-head-top,
  body.alv-gh-enabled #alv-gh-root .alv-f-main,
  body.alv-gh-enabled #alv-gh-root .ca-head-main,
  body.alv-gh-enabled #alv-gh-root .alv-f-logo,
  body.alv-gh-enabled #alv-gh-root .ca-head-brand img { transition:none!important; }
}
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .alv-f-topbar,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .ca-head-top,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .alv-f-main,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .ca-head-main,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .alv-f-logo,
body.alv-gh-enabled #alv-gh-root.alv-gh-measuring .ca-head-brand img { transition:none!important; }
