:root {
  /* Tipografía */
  --utpl-font-base: "Red Hat Display", system-ui, -apple-system, "Segoe UI",
    Roboto, Arial, sans-serif;
  /* UI */
  --utpl-border: rgba(17, 17, 17, 0.15);
}

/* Ocultar header y footer SOLO en layout builder */
body.layout-builder header,
body.layout-builder #global-loader,
body.layout-builder footer {
  display: none !important;
}

html {
  box-sizing: border-box;
  font-size: 62.5%;
}


body:not(.path-admin) ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body:not(.path-admin) {
  font-size: 1.8rem;
  font-family: var(--utpl-font-base);
}



body {
  font-family: var(--utpl-font-base);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10000;
  background: #ffffff;
  color: #0a3361;
  border: 2px solid #0a3361;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 700;
}

.skip-link.visually-hidden.focusable:focus,
.skip-link:focus-visible {
  clip: auto;
  height: auto;
  width: auto;
  overflow: visible;
  position: absolute;
}

/*html {
  box-sizing: border-box;
  font-size: 62.5%;
}*/

*,
*:before,
*:after {
  box-sizing: inherit;
}
body:not(.layout-builder):not(.path-admin) {
  font-family: var(--utpl-font-base);
  font-size: 18px;
  line-height: 2;
}

body:not(.layout-builder):not(.path-admin) * {
  box-sizing: inherit;
}

body:not(.layout-builder):not(.path-admin) ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body:not(.layout-builder):not(.path-admin) p {
  margin: 0;
}


/*ul {
  margin: 0;
  padding: 0;
  list-style: none;
}*/

img {
  
  max-width: 100%;
  height: auto;
}

body {
  font-size: 18px;
  font-size: 1.8rem;
  line-height: 2;
}

/* TOPBAR */
#topabar-utpl {
  background-color: var(--utpl-gray-dark);
  font-size: 1rem;
}

#menu-superior .menu-superior-item {
  position: relative;
  padding-left: 0.75rem;
}

#menu-superior .menu-superior-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 1em;
  width: 1px;
  background-color: #fff;
  transform: translateY(-50%);
}

/* Quitar subrayado */
#menu-superior a {
  text-decoration: none;
  line-height: 1;
  color: white;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

#menu-superior a:hover {
  color: var(--utpl-yellow);
}

.social-link {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.social-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  display: block;
}

#topabar-utpl .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.75);
}

#topabar-utpl .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* HEADER */

#utpl-header .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.25);
}

#utpl-header .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#utpl-header.scrolled .navbar-toggler {
  border-color: rgba(10, 51, 97, 0.35);
}

#utpl-header.scrolled .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2810,51,97,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#menu-superior a:focus-visible,
.social-link:focus-visible,
#topabar-utpl .navbar-toggler:focus-visible,
#utpl-header .navbar-toggler:focus-visible {
  outline: 3px solid var(--utpl-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(10, 51, 97, 0.45);
}

.utpl-branding__logo {
  max-width: 90px;
  height: auto;
  border-right: var(--utpl-blue) 3px solid;
  padding-right: 1rem;
}

.utpl-branding__text {
  padding-left: 1rem;
}

.utpl-branding__name {
  text-transform: uppercase;
  text-decoration: none;
  color: #111;
  font-size: 1.5rem;
}


/* ===============================
   HEADER STICKY DINÁMICO
================================ */

#utpl-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: #0a3361; /* Azul institucional */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}


/* El contenedor branding es flex */
.utpl-branding {
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

/* Cuando el logo desaparece */
#utpl-header.scrolled .utpl-branding__logo {
  display: none;
}

/* Mover texto a la izquierda */
#utpl-header.scrolled .utpl-branding__text {
  padding-left: 0;
}

/* Estado cuando pasa el hero */
#utpl-header.scrolled {
  background-color: #ffffff;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Links en modo blanco */
#utpl-header.scrolled .navbar-nav .nav-link {
  color: #0a3361 !important;
  font-weight: 700;
}

#utpl-header.scrolled .navbar-brand {
  color: #0a3361 !important;
}





/* Hasta aqui funciona */
/* Links principales */
/* Opcional mínimo: que el split no se vea raro */
main {
  min-height: 50vh;
}

/* Link principal */
.nav-link-utpl {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0.1rem 1.8rem !important;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 1rem;
   color: inherit;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover */
.nav-link-utpl:hover {
  background-color: rgba(10, 51, 97, 0.08);
  color: var(--utpl-gray-dark);
}

/* Active real */
.nav-link-utpl.active {
  background-color: var(--utpl-blue);
  color: #fff !important;
  border-color: var(--utpl-blue);
}

/* Accesibilidad: foco visible con teclado */
.nav-link-utpl:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--utpl-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.25rem rgba(10, 51, 97, 0.18);
}

/* Dropdown menu */
.dropdown-menu {
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1rem;
  padding: 0;
  margin-top: 0.5rem;
}

.dropdown-item {
  border-radius: 0;
  padding: 0.55rem 0.8rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
  background-color: rgba(10, 51, 97, 0.08);
  color: var(--utpl-blue);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--utpl-blue);
  color: #fff;
}

/* ===============================
   ESTADO INICIAL (AZUL)
================================ */

#utpl-header .nav-link-utpl,
#utpl-header .utpl-branding__name {
  color: #ffffff !important;
}

/* ===============================
   ESTADO SCROLLED (BLANCO)
================================ */

#utpl-header.scrolled {
  background-color: #ffffff !important;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

#utpl-header.scrolled .nav-link-utpl,
#utpl-header.scrolled .utpl-branding__name {
  color: #0a3361 !important;
  font-weight: 700;
}

/* Hover en blanco */
#utpl-header.scrolled .nav-link-utpl:hover {
  color: #08305a !important;
}
/* ===============================
   ACTIVO EN HEADER BLANCO
================================ */

#utpl-header.scrolled .nav-link-utpl.active {
  background-color: #0a3361; /* azul institucional */
  color: #ffffff !important;
}

/* Opcional: hover del activo */
#utpl-header.scrolled .nav-link-utpl.active:hover {
  background-color: #08305a;
}
/* ===============================
   DROPDOWN POR HOVER (DESKTOP)
   El click del padre navega
   =============================== */
@media (min-width: 992px) {
  .navbar-nav .dropdown {
    position: relative;
  }

  .navbar-nav .dropdown-menu {
    display: none;
    margin-top: 0; /* evita el hueco */
  }

  .navbar-nav .dropdown:hover > .dropdown-menu,
  .navbar-nav .dropdown-menu:hover {
    display: block;
  }
}

/* ===============================
   MÓVIL: submenús visibles y jerárquicos
   =============================== */
@media (max-width: 991.98px) {
  .navbar-nav .dropdown {
    position: static;
  }

  .navbar-nav .dropdown-menu {
    display: block !important;
    position: static !important;
    float: none !important;
    transform: none !important;
    width: 100%;
    padding-left: 2rem;
    border: 0;
    box-shadow: none !important;
    background: transparent;
  }

  .navbar-nav .dropdown-item {
    position: relative;
    border-left: var(--utpl-gray-dark) 1px solid;
    display: block;
    padding: 0.4rem 1rem 0.4rem 1.5rem;
    white-space: normal;
  }
}

/* Auth forms (fallback in base theme for routes where child CSS is not attached) */
main[role="main"]:has(.user-login-form),
main[role="main"]:has(.user-pass),
main[role="main"]:has(.user-pass-reset-form) {
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
  padding: 1.5rem 0 3rem;
}

main[role="main"]:has(.user-login-form) > *,
main[role="main"]:has(.user-pass) > *,
main[role="main"]:has(.user-pass-reset-form) > * {
  width: min(100%, 760px);
  margin-inline: auto;
}

main[role="main"]:has(.user-login-form) .tabs,
main[role="main"]:has(.user-pass) .tabs,
main[role="main"]:has(.user-pass-reset-form) .tabs { margin: 0 0 1rem; }

main[role="main"]:has(.user-login-form) .tabs ul,
main[role="main"]:has(.user-pass) .tabs ul,
main[role="main"]:has(.user-pass-reset-form) .tabs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
main[role="main"]:has(.user-login-form) .tabs a,
main[role="main"]:has(.user-pass) .tabs a,
main[role="main"]:has(.user-pass-reset-form) .tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .65rem 1rem;
  border-radius: .6rem;
  background: #dfe7f0;
  color: var(--utpl-blue-dark);
  text-decoration: none;
  font-weight: 700;
}

/* Oculta la pestaña de restablecer contraseña en el login (solo UI). */
main[role="main"]:has(.user-login-form) .tabs a[href*="/user/password"],
main[role="main"]:has(.user-login-form) .tabs a[href$="/user/password"] {
  display: none !important;
}
main[role="main"]:has(.user-login-form) .tabs li.is-active a,
main[role="main"]:has(.user-login-form) .tabs a.is-active,
main[role="main"]:has(.user-login-form) .tabs a[aria-current="page"],
main[role="main"]:has(.user-pass) .tabs li.is-active a,
main[role="main"]:has(.user-pass) .tabs a.is-active,
main[role="main"]:has(.user-pass) .tabs a[aria-current="page"],
main[role="main"]:has(.user-pass-reset-form) .tabs li.is-active a,
main[role="main"]:has(.user-pass-reset-form) .tabs a.is-active,
main[role="main"]:has(.user-pass-reset-form) .tabs a[aria-current="page"] {
  background: var(--utpl-blue);
  color: #fff;
}

.user-login-form,
.user-pass,
.user-pass-reset-form {
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 14px 34px rgba(7, 40, 75, .07);
  max-width: 760px;
  margin-inline: auto;
}

.user-login-form .form-item,
.user-pass .form-item,
.user-pass-reset-form .form-item { margin: 0 0 1rem; }

.user-login-form .form-item label,
.user-pass .form-item label,
.user-pass-reset-form .form-item label {
  display: block;
  margin-bottom: .4rem;
  color: var(--utpl-blue-dark);
  font-weight: 700;
}

.user-login-form input[type="text"],
.user-login-form input[type="password"],
.user-login-form input[type="email"],
.user-pass input[type="text"],
.user-pass input[type="password"],
.user-pass input[type="email"],
.user-pass-reset-form input[type="text"],
.user-pass-reset-form input[type="password"],
.user-pass-reset-form input[type="email"] {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid #bfd0e3;
  border-radius: .65rem;
  padding: .65rem .8rem;
  background: #fff;
  box-sizing: border-box;
}

.user-login-form .form-actions input[type="submit"],
.user-login-form .form-actions .button,
.user-pass .form-actions input[type="submit"],
.user-pass .form-actions .button,
.user-pass-reset-form .form-actions input[type="submit"],
.user-pass-reset-form .form-actions .button {
  border: 1px solid #caa300;
  background: linear-gradient(180deg, var(--utpl-yellow), var(--utpl-yellow-dark));
  color: var(--utpl-blue-dark);
  font-weight: 800;
  border-radius: .7rem;
  min-height: 2.85rem;
  padding: .7rem 1.1rem;
  cursor: pointer;
}

@media (max-width: 767px) {
  main[role="main"]:has(.user-login-form),
  main[role="main"]:has(.user-pass),
  main[role="main"]:has(.user-pass-reset-form) { padding-inline: .85rem; }
  main[role="main"]:has(.user-login-form) .tabs a,
  main[role="main"]:has(.user-pass) .tabs a,
  main[role="main"]:has(.user-pass-reset-form) .tabs a { width: 100%; justify-content: center; }
}

footer {
  font-size: 1rem;
}

.utpl-footer__top {
  background-color: var(--utpl-blue);
}

.utpl-footer__icon {
  height: min-content;
}
.utpl-footer__top .text-center img{
   width: 50%;
}
.utpl-footer__social-item img{
    width:50%;
}
.utpl-footer__top h5 {
  margin-bottom: 1rem;
  color: var(--utpl-yellow);
  font-size: large;
}

.utpl-footer__bottom {
  background-color: var(--utpl-blue-dark);
}

.utpl-footer__contact-item {
  color: white;
  display: flex;
  flex-direction: row;
}

.utpl-footer__contact-text {
  line-height: 1.25;
  color: white;
  text-decoration: none;
}

.utpl-footer__contact-text a {
  color: white;
  text-decoration: none;
  transition: color 0.1s ease;
}
.utpl-footer__contact-text a:hover {
  color: var(--utpl-yellow);
}

.utpl-footer__links ul {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.utpl-footer__links a {
  color: white;
  text-decoration: none;
  transition: color 0.1s ease;
}

.utpl-footer__links a:hover {
  color: var(--utpl-yellow);
}

.utpl-footer__bottom a {
  color: white;
  text-decoration: none;
  transition: color 0.1s ease;
}
.utpl-footer__bottom a:hover {
  color: var(--utpl-yellow);
}

.utpl-footer__sep {
  color: white;
  margin-right: 10px;
  margin-left: 10px;
}


/* SPPINER */


#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85); /* efecto más premium */
  backdrop-filter: blur(6px); /* efecto glass moderno */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Spinner más moderno con degradado */
.loader-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #003366,
    #0055a5,
    #0072ce,
    #003366
  );
  -webkit-mask: radial-gradient(farthest-side, transparent 70%, black 72%);
  mask: radial-gradient(farthest-side, transparent 70%, black 72%);
  animation: spin 0.9s linear infinite;
  filter: drop-shadow(0 4px 10px rgba(0, 51, 102, 0.25));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Clase para ocultarlo elegantemente */
#global-loader.hide {
  opacity: 0;
  visibility: hidden;
}



/* Contenedor de tabs admin */
.block-local-tasks-block {
  margin: 20px auto;
  max-width: 1300px;
}

/* Lista de tabs */
.block-local-tasks-block ul {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

/* Cada tab */
.block-local-tasks-block li {
  margin: 0;
}

/* Links */
.block-local-tasks-block a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 30px;
  background: #e6eef6;
  color: #0b3c6f;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Hover */
.block-local-tasks-block a:hover {
  background: #0b3c6f;
  color: #fff;
}

/* Activo */
.block-local-tasks-block li.is-active a {
  background: #0b3c6f;
  color: #fff;
}












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

  #utpl-header,
  .utpl-branding,
  .nav-link-utpl,
  .dropdown-item,
  #global-loader {
    transition: none !important;
  }

  .loader-spinner {
    animation: none !important;
  }
}


/* ===============================
   HEADER REFINEMENT (premium look, colores UTPL)
================================ */
#utpl-header {
  min-height: 7rem;
  display: flex;
  align-items: center;
}

#utpl-header > .container {
  display: flex;
  align-items: center;
  min-height: 7rem;
}

#utpl-header .navbar-collapse {
  align-items: center;
}

#utpl-header .navbar-nav {
  align-items: center;
  gap: 0.25rem;
}

#utpl-header .navbar-nav > li,
#utpl-header .navbar-nav > .nav-item {
  display: flex;
  align-items: center;
}

.nav-link-utpl {
  min-height: 4.8rem;
  padding: 0.65rem 1.55rem !important;
  border-radius: 0.7rem;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  justify-content: center;
}

.dropdown-menu {
  margin-top: 0.8rem;
  border-radius: 0.8rem;
  padding: 0.4rem;
  min-width: 23rem;
  box-shadow: 0 14px 28px rgba(0,0,0,0.12);
}

.dropdown-item {
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.utpl-branding-wrapper {
  display: flex;
  align-items: center;
}

.utpl-branding {
  min-height: 7rem;
  gap: 0.35rem;
}

.utpl-branding__logo {
  max-width: 10.5rem;
  padding-right: 1.2rem;
  margin-right: 0.1rem;
}

.utpl-branding__text {
  padding-left: 1rem;
  display: flex;
  align-items: center;
}

.utpl-branding__name {
  display: inline-flex;
  align-items: center;
  min-height: 4.4rem;
  font-size: 1.5rem;
  line-height: 1.05;
  letter-spacing: 0.015em;
}

#utpl-header.scrolled,
#utpl-header.scrolled > .container {
  min-height: 6.4rem;
}

#utpl-header.scrolled .utpl-branding {
  min-height: 6.4rem;
}

#utpl-header.scrolled .utpl-branding__name {
  font-size: 1.8rem;
}

@media (max-width: 991.98px) {
  #utpl-header,
  #utpl-header > .container {
    min-height: 6rem;
  }

  #utpl-header > .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.35rem;
  }

  .utpl-branding {
    min-height: 6rem;
    flex: 1 1 auto;
    min-width: 0;
  }

  .utpl-branding__logo {
    max-width: 8.5rem;
    padding-right: 0.8rem;
  }

  .utpl-branding__name {
    min-height: auto;
    font-size: 1.6rem;
    line-height: 1.1;
  }

  #utpl-header.scrolled .utpl-branding__name {
    color: var(--utpl-blue) !important;
  }

  #utpl-header .navbar-toggler {
    margin-left: auto;
    flex: 0 0 auto;
  }

  #utplMainNav {
    position: fixed;
    top: calc(var(--utpl-topbar-height) + var(--utpl-header-height-mobile));
    left: 50%;
    transform: translateX(-50%);
    flex: none;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 0;
    background: rgba(10, 51, 97, 0.96);
    border: 0;
    box-shadow: 0 16px 28px rgba(4, 20, 38, 0.25);
    z-index: 1200;
  }

  #utpl-header.scrolled #utplMainNav {
    top: var(--utpl-header-height-mobile);
  }

  #utplMainNav .navbar-nav {
    width: 100%;
  }

  .nav-link-utpl {
    justify-content: flex-start;
    text-align: left;
    min-height: 4.2rem;
    width: 100%;
    font-size: 1.45rem;
    padding: 0.8rem 1rem !important;
  }

  #utplMainNav .nav-link-utpl {
    border-radius: 0.65rem;
  }

  /* En móvil, el título del sitio puede seguir azul; el panel del menú va con texto blanco. */
  #utplMainNav .nav-link-utpl,
  #utplMainNav .nav-link-utpl:hover,
  #utplMainNav .nav-link-utpl:focus,
  #utpl-header.scrolled #utplMainNav .nav-link-utpl,
  #utpl-header.scrolled #utplMainNav .nav-link-utpl:hover,
  #utpl-header.scrolled #utplMainNav .nav-link-utpl:focus {
    color: #fff !important;
  }

  body.toolbar-fixed #utplMainNav {
    top: calc(39px + var(--utpl-header-height-mobile));
  }

  body.toolbar-fixed.toolbar-horizontal #utplMainNav,
  body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utplMainNav {
    top: calc(79px + var(--utpl-header-height-mobile));
  }
}


/* ===============================
   TOPBAR + HEADER STACK (topbar sobre barra azul)
================================ */
:root {
  --utpl-topbar-height: 4.2rem;
  --utpl-header-height-desktop: 7rem;
  --utpl-header-height-mobile: 6rem;
}

#topabar-utpl {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1101;
  min-height: var(--utpl-topbar-height);
  display: flex;
  align-items: center;
}

#topabar-utpl > .container {
  min-height: var(--utpl-topbar-height);
  display: flex;
  align-items: center;
}

#utpl-header {
  top: var(--utpl-topbar-height);
  z-index: 1100;
}

body:not(.layout-builder):not(.path-admin) {
  padding-top: calc(var(--utpl-topbar-height) + var(--utpl-header-height-desktop));
}

#utpl-header.scrolled {
  top: var(--utpl-topbar-height);
}

@media (max-width: 991.98px) {
  :root {
    --utpl-topbar-height: 4rem;
  }

  body:not(.layout-builder):not(.path-admin) {
    padding-top: calc(var(--utpl-topbar-height) + var(--utpl-header-height-mobile));
  }

  #topabar-utpl > .container {
    min-height: var(--utpl-topbar-height);
  }
}


/* ===============================
   DRUPAL ADMIN TOOLBAR OFFSETS
================================ */
body.toolbar-fixed #topabar-utpl {
  top: 39px;
}

body.toolbar-fixed #utpl-header {
  top: calc(39px + var(--utpl-topbar-height));
}

body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
  padding-top: calc(39px + var(--utpl-topbar-height) + var(--utpl-header-height-desktop));
}

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #topabar-utpl {
  top: 79px;
}

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header {
  top: calc(79px + var(--utpl-topbar-height));
}

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin) {
  padding-top: calc(79px + var(--utpl-topbar-height) + var(--utpl-header-height-desktop));
}

@media (min-width: 610px) {
  body.toolbar-fixed.toolbar-horizontal #topabar-utpl {
    top: 79px;
  }

  body.toolbar-fixed.toolbar-horizontal #utpl-header {
    top: calc(79px + var(--utpl-topbar-height));
  }

  body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin) {
    padding-top: calc(79px + var(--utpl-topbar-height) + var(--utpl-header-height-desktop));
  }
}

@media (max-width: 991.98px) {
  body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
    padding-top: calc(39px + var(--utpl-topbar-height) + var(--utpl-header-height-mobile));
  }

  body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin),
  body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin) {
    padding-top: calc(79px + var(--utpl-topbar-height) + var(--utpl-header-height-mobile));
  }
}


/* ===============================
   TOPBAR HIDDEN (simplificación visual)
================================ */
#topabar-utpl {
  display: none !important;
}

#utpl-header,
#utpl-header.scrolled {
  top: 0 !important;
}

body:not(.layout-builder):not(.path-admin) {
  padding-top: var(--utpl-header-height-desktop) !important;
}

@media (max-width: 991.98px) {
  body:not(.layout-builder):not(.path-admin) {
    padding-top: var(--utpl-header-height-mobile) !important;
  }
}

/* Admin toolbar: compensar solo toolbar + header (sin topbar) */
body.toolbar-fixed #utpl-header,
body.toolbar-fixed #utpl-header.scrolled {
  top: 39px !important;
}

body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
  padding-top: calc(39px + var(--utpl-header-height-desktop)) !important;
}

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header,
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header.scrolled {
  top: 79px !important;
}

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin) {
  padding-top: calc(79px + var(--utpl-header-height-desktop)) !important;
}

@media (min-width: 610px) {
  body.toolbar-fixed.toolbar-horizontal #utpl-header,
  body.toolbar-fixed.toolbar-horizontal #utpl-header.scrolled {
    top: 79px !important;
  }

  body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin) {
    padding-top: calc(79px + var(--utpl-header-height-desktop)) !important;
  }
}

@media (max-width: 991.98px) {
  body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
    padding-top: calc(39px + var(--utpl-header-height-mobile)) !important;
  }

body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin) {
  padding-top: calc(79px + var(--utpl-header-height-mobile)) !important;
}
}

/* Admin UX: evitar que el header del sitio tape menús/contextual toolbar. */
body.toolbar-fixed #topabar-utpl,
body.toolbar-fixed #utpl-header {
  position: static !important;
  top: auto !important;
}

body.toolbar-fixed #topabar-utpl {
  display: none !important;
  min-height: 0 !important;
}

/* Mantener visible el header principal del sitio en admin. */
body.toolbar-fixed header[role="banner"],
body.toolbar-fixed #utpl-header,
body.toolbar-fixed #utpl-header.scrolled {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.toolbar-fixed {
  padding-top: 0 !important;
}

body.toolbar-fixed #utpl-header.scrolled {
  box-shadow: none !important;
}

/* Override final: anula espacios reservados del header/topbar en frontend con toolbar admin. */
body.toolbar-fixed:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin) {
  padding-top: 0 !important;
}

body.toolbar-fixed #utpl-header,
body.toolbar-fixed #utpl-header.scrolled {
  margin-top: 0 !important;
}

/* Admin frontend (ajuste final): mostrar header del sitio debajo del toolbar sin topbar. */
body.toolbar-fixed #topabar-utpl {
  display: none !important;
}

body.toolbar-fixed #utpl-header,
body.toolbar-fixed #utpl-header.scrolled,
body.toolbar-fixed.toolbar-horizontal #utpl-header,
body.toolbar-fixed.toolbar-horizontal #utpl-header.scrolled,
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header,
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header.scrolled {
  position: fixed !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  left: 0;
  right: 0;
  z-index: 400 !important;
}

body.toolbar-fixed #utpl-header,
body.toolbar-fixed #utpl-header.scrolled {
  top: 39px !important;
}

body.toolbar-fixed.toolbar-horizontal #utpl-header,
body.toolbar-fixed.toolbar-horizontal #utpl-header.scrolled,
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header,
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical #utpl-header.scrolled {
  top: 79px !important;
}

body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
  padding-top: calc(39px + var(--utpl-header-height-desktop)) !important;
}

body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin),
body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin) {
  padding-top: calc(79px + var(--utpl-header-height-desktop)) !important;
}

@media (max-width: 991.98px) {
  body.toolbar-fixed:not(.layout-builder):not(.path-admin) {
    padding-top: calc(39px + var(--utpl-header-height-mobile)) !important;
  }

  body.toolbar-fixed.toolbar-horizontal:not(.layout-builder):not(.path-admin),
  body.toolbar-fixed.toolbar-tray-open.toolbar-vertical:not(.layout-builder):not(.path-admin) {
    padding-top: calc(79px + var(--utpl-header-height-mobile)) !important;
  }
}
