/* Cabecera: marca a la izquierda, navegación centrada y acciones a la derecha. */
header[data-glass] {
  width: 100%;
}

header.je-header-hidden {
  transform: translateY(calc(-110% - var(--je-topbar-height, 0px))) !important;
}

header.je-scroll-header {
  position: fixed !important;
  right: 0;
  left: 0;
}

.je-scroll-topbar {
  position: fixed !important;
  z-index: 2147482999 !important;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
}

.je-scroll-topbar.je-topbar-hidden {
  transform: translateY(-110%) !important;
}

html,
body {
  width: 100%;
  overflow-x: clip;
}

header[data-glass] > div:first-child {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 14px clamp(20px, 3vw, 48px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 18px;
}

header[data-glass] [data-nav="1"] {
  grid-column: 2;
  margin: 0 !important;
}

header[data-glass] [data-nav-actions="1"] {
  grid-column: 3;
  justify-self: end;
  margin-left: 0 !important;
}

@media (max-width: 920px) {
  header[data-glass] [data-nav-actions="1"] > div:first-child,
  header[data-glass] [data-nav-actions="1"] > a {
    display: none !important;
  }
}

@media (max-width: 1179px) {
  header[data-glass] > div:first-child {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 12px;
  }

  header[data-glass] [data-nav="1"] {
    display: none !important;
  }

  header[data-glass] [data-nav-actions="1"] {
    /* La cabecera tiene estilos en línea de escritorio; se fuerzan aquí para
       que el botón no se desplace a una tercera columna fuera de pantalla. */
    grid-column: 2 !important;
  }

  header[data-glass] [data-nav-toggle="1"] {
    display: flex !important;
  }
}

@media (max-width: 620px) {
  body > div > div:has(+ header[data-glass]) > div {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 14px !important;
    min-width: 0;
  }

  body > div > div:has(+ header[data-glass]) a {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  body > div > div:has(+ header[data-glass]) span {
    grid-column: 1 / -1;
    margin-left: 0 !important;
  }

  /* En móvil la franja informativa se reduce al horario. */
  body > div > div:has(+ header[data-glass]) a {
    display: none !important;
  }

  body > div > div:has(+ header[data-glass]) span {
    text-align: center;
    justify-self: center;
  }
}

@media (min-width: 900px) {
  .je-home-services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Megamenú de servicios, activo únicamente en la navegación de escritorio. */
.je-service-mega {
  display: none;
}

/* Panel de navegación móvil. El HTML se compone desde services-megamenu.js
   para conservar exactamente el mismo menú en todas las páginas. */
@media (max-width: 1179px) {
  header[data-glass] {
    z-index: 2147483000 !important;
    isolation: isolate;
  }

  header[data-glass] > div:first-child {
    position: relative;
    z-index: 2;
  }

  header[data-glass] [data-nav-panel="1"] {
    position: fixed;
    z-index: 1;
    top: 72px;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 18px 16px 28px;
    border: 0 !important;
    background: rgba(12, 23, 18, .72) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  header[data-glass] [data-nav-panel="1"] > div {
    width: min(100%, 520px);
    margin: 0 auto !important;
    padding: 22px !important;
    gap: 0 !important;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 24px;
    background: rgba(245, 248, 246, .98);
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .44);
  }

  .je-mobile-menu-kicker {
    margin: 0 0 5px;
    color: #00873D;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  .je-mobile-menu-title {
    margin: 0 0 18px;
    color: #0C1712;
    font-family: "Sora", sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.03em;
  }

  .je-mobile-menu-link,
  .je-mobile-services-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid rgba(16, 26, 21, .09);
    border-radius: 13px;
    background: rgba(255, 255, 255, .64);
    color: #101A15 !important;
    font-size: 16px;
    font-weight: 600;
  }

  .je-mobile-menu-link + .je-mobile-menu-link,
  .je-mobile-services + .je-mobile-menu-link {
    margin-top: 8px;
  }

  .je-mobile-services-toggle {
    cursor: pointer;
    font-family: inherit;
    text-align: left;
  }

  .je-mobile-services-toggle span:last-child {
    color: #00873D;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s ease;
  }

  .je-mobile-services.is-open .je-mobile-services-toggle span:last-child {
    transform: rotate(45deg);
  }

  .je-mobile-services-list {
    display: grid;
    grid-template-rows: 0fr;
    margin: 0;
    transition: grid-template-rows .28s ease, margin .28s ease;
  }

  .je-mobile-services-list > div {
    min-height: 0;
    overflow: hidden;
  }

  .je-mobile-services.is-open .je-mobile-services-list {
    grid-template-rows: 1fr;
    margin: 8px 0 2px;
  }

  .je-mobile-service-link {
    display: block;
    padding: 10px 14px 10px 18px;
    border-left: 2px solid rgba(0, 160, 72, .35);
    color: #42544A !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
  }

  .je-mobile-service-link + .je-mobile-service-link {
    margin-top: 3px;
  }

  .je-mobile-menu-cta {
    display: block;
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #00A048, #00803A);
    box-shadow: 0 14px 28px -14px rgba(0, 122, 55, .8);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
  }
}

@media (max-width: 620px) {
  header[data-glass] [data-nav-actions="1"] {
    display: contents !important;
  }

  header[data-glass] [data-nav-toggle="1"] {
    display: none !important;
  }

  .je-mobile-menu-launcher {
    position: fixed;
    z-index: 2147483647;
    top: 47px;
    right: 20px;
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    border: 1px solid rgba(16, 26, 21, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 20px -12px rgba(12, 23, 18, .35);
    cursor: pointer;
  }

  .je-mobile-menu-launcher span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #0C1712;
  }
}

@media (min-width: 621px) {
  .je-mobile-menu-launcher { display: none !important; }
}

@media (min-width: 1180px) {
  header[data-glass] [data-nav="1"] {
    position: relative;
  }

  .je-service-menu {
    position: relative;
  }

  .je-service-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .je-service-trigger::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .24s ease;
  }

  .je-service-menu.is-open .je-service-trigger::after {
    transform: rotate(225deg) translate(-2px, -1px);
  }

  .je-service-mega {
    display: block;
    position: absolute;
    z-index: 50;
    top: calc(100% + 22px);
    left: 50%;
    width: min(940px, calc(100vw - 40px));
    padding: 18px;
    border: 1px solid rgba(12, 23, 18, .11);
    border-radius: 22px;
    background: rgba(245, 248, 246, .97);
    box-shadow: 0 30px 70px -28px rgba(12, 23, 18, .36);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -10px);
    transition: opacity .22s ease, transform .26s cubic-bezier(.2, .7, .2, 1), visibility .22s;
  }

  .je-service-menu.is-open .je-service-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .je-service-mega-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 6px 16px;
  }

  .je-service-mega-kicker {
    margin: 0;
    color: #00873D;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
  }

  .je-service-mega-title {
    margin: 5px 0 0;
    color: #0C1712;
    font-family: "Sora", sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.02em;
  }

  .je-service-mega-all {
    color: #00873D;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .je-service-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .je-service-mega-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 10px;
    border: 1px solid rgba(12, 23, 18, .07);
    border-radius: 15px;
    background: rgba(255, 255, 255, .72);
    color: #0C1712;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
  }

  .je-service-mega-card:hover,
  .je-service-mega-card:focus-visible {
    color: #0C1712;
    border-color: rgba(0, 135, 61, .35);
    background: #fff;
    box-shadow: 0 16px 28px -22px rgba(0, 100, 45, .55);
    transform: translateY(-2px);
  }

  .je-service-mega-card img {
    width: 64px;
    height: 64px;
    border-radius: 11px;
    object-fit: cover;
  }

  .je-service-mega-card span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.32;
  }
}
