/* =========================================================
   SITE HEADER
========================================================= */

:root {
  --th-header-offset: 180px;
}

body.has-sticky-header {
  padding-top: var(--th-header-offset);
}

.th-site-header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1200;
  transform: translateY(0);
  transition:
    transform 0.32s ease,
    box-shadow 0.25s ease;
}

.th-header,
.th-header__link,
.th-header__link--trigger,
.th-header__login,
.th-header__trial,
.th-header__mobile a,
.th-eco-text,
.th-mega-card__content strong,
.th-mega-card__content span {
  font-family: 'Poppins', sans-serif;
}

.th-site-header-wrap.is-hidden {
  transform: translateY(calc(-100% - 10px));
}

.th-site-header-wrap.is-scrolled {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.th-eco-top {
  position: relative;
  min-height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(2, 8, 33, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.th-eco-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 28, 74, 0.32), rgba(2, 8, 33, 0.14));
  pointer-events: none;
}

.th-eco-top__inner {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  min-height: 38px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.th-eco-badge {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #39d98a;
  box-shadow: 0 0 0 4px rgba(57, 217, 138, 0.16);
  flex: 0 0 auto;
}

.th-eco-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.th-header {
  position: relative;
  background: rgba(2, 8, 33, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.th-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 28, 74, 0.42), rgba(2, 8, 33, 0.18));
  pointer-events: none;
}

.th-header__inner {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 2rem));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.th-header__brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.th-header__brand img {
  display: block;
  width: auto;
  height: 42px;
  max-width: 100%;
}

.th-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
}

.th-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.th-header__item {
  position: relative;
}

.th-header__link,
.th-header__link--trigger {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.th-header__link:hover,
.th-header__link--trigger:hover,
.th-header__item.is-open > .th-header__link--trigger {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.th-header__caret {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-right: 2px solid rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.th-header__item.is-open .th-header__caret {
  transform: rotate(-135deg) translateY(-1px);
}

.th-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

/* CTA secundario desktop */
.th-header__trial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 170, 255, 0.34);
  background: rgba(255, 255, 255, 0.04);
  color: #dce7ff;
  font-weight: 500;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.th-header__trial:hover {
  background: rgba(16, 98, 254, 0.12);
  border-color: rgba(120, 170, 255, 0.58);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow:
    0 10px 24px rgba(16, 98, 254, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.th-header__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.3rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f7cff 0%, #1d63f2 100%);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow:
    0 10px 24px rgba(27, 99, 242, 0.24),
    inset 0 1px 0 rgba(255,255,255,0.14);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.th-header__login:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.th-header__toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.th-header__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.th-header__mobile {
  display: none;
}

.th-header.is-menu-open .th-header__toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.th-header.is-menu-open .th-header__toggle span:nth-child(2) {
  opacity: 0;
}

.th-header.is-menu-open .th-header__toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mega dropdown */

.th-header__item--mega {
  position: relative;
}

.th-mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 370px;
  padding-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 1300;
}

.th-header__item--mega.is-open .th-mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.th-mega-dropdown__grid {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(76,123,232,0.88) 0%, rgba(33,63,132,0.93) 55%, rgba(25,45,98,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 22px 54px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
}

.th-mega-dropdown__grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.22), transparent 24%),
    radial-gradient(circle at 78% 36%, rgba(59,140,255,0.26), transparent 24%),
    radial-gradient(circle at 52% 70%, rgba(255,255,255,0.10), transparent 22%);
  pointer-events: none;
}

.th-mega-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0.65rem;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.th-mega-card:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.th-mega-card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}

.th-mega-card__icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.th-mega-card__content {
  display: grid;
  gap: 0.45rem;
}

.th-mega-card__content strong {
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 700;
  color: #fff;
}

.th-mega-card__content span {
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.76);
}

.th-mega-card--cta {
  margin-top: 0.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.th-mega-card--cta .th-mega-card__content {
  align-self: center;
}

.th-mega-card--cta strong {
  font-size: 1.02rem;
}

@media (min-width: 981px) {
  .th-header__item--mega:hover .th-mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .th-header__item--mega:hover > .th-header__link--trigger .th-header__caret {
    transform: rotate(-135deg) translateY(-1px);
  }
}

@media (max-width: 980px) {
  .th-header {
    position: relative;
  }

  .th-header__mobile {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
    border-radius: 0 0 30px 30px;
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem 0.75rem 1rem;
    background: rgba(2, 8, 33, 0.96);
    border-top: 1px solid rgba(255,255,255,0.05);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    overflow: hidden;
    z-index: 1300;
  }

  .th-header.is-menu-open .th-header__mobile {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    max-height: 420px;
    padding: 1rem;
  }

  .th-eco-top__inner {
    width: min(100%, calc(100% - 1rem));
    min-height: 38px;
    padding: 0.45rem 0;
  }

  .th-eco-text {
    font-size: 0.82rem;
    line-height: 1.3;
    white-space: normal;
  }

  .th-header__inner {
    min-height: 76px;
  }

  .th-header__nav {
    display: none;
  }

  .th-header__toggle {
    display: inline-block;
  }

  .th-header__login,
  .th-header__trial {
    display: none;
  }

  .th-header__mobile a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    text-decoration: none;
  }

  .th-header__mobile-trial {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
    padding: 0.95rem 1.1rem !important;
    border-radius: 14px;
    border: 1px solid rgba(120, 170, 255, 0.38);
    background: rgba(16, 98, 254, 0.12) !important;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.06),
      0 10px 24px rgba(16, 98, 254, 0.14);
    transition:
      background 0.22s ease,
      border-color 0.22s ease,
      transform 0.22s ease;
  }

  .th-header__mobile-trial:hover {
    background: rgba(16, 98, 254, 0.18) !important;
    border-color: rgba(120, 170, 255, 0.58);
    transform: translateY(-1px);
  }

  .th-header__mobile-login {
    justify-content: center;
    margin-top: 0.35rem;
    background: linear-gradient(180deg, #2f7cff 0%, #1d63f2 100%) !important;
  }

  .th-mega-dropdown {
    position: static;
    width: 100%;
    margin-top: 0.35rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    display: none;
  }

  .th-header__item--mega.is-open .th-mega-dropdown {
    display: block;
  }

  .th-mega-dropdown__grid {
    border-radius: 20px;
    padding: 0.75rem;
  }

  .th-mega-card {
    grid-template-columns: 42px 1fr;
    gap: 0.8rem;
    padding: 0.9rem 0.55rem;
  }

  .th-mega-card__icon {
    width: 42px;
    height: 42px;
  }

  .th-mega-card__icon img {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 640px) {
  .th-eco-text {
    font-size: 50%;
    line-height: 1.3;
    white-space: normal;
  }
}