:root {
  --ly-navy: #1f2f6d;
  --ly-navy-2: #243a8a;
  --ly-rose: #9f0d3a;
  --ly-text: #1e1e1e;
  --ly-muted: #6b6f7a;
  --ly-border: #e6e7ec;
  --ly-bg: #ffffff;
  --ly-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.ly-header {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  color: var(--ly-text);
  background: var(--ly-bg);
  position: relative;
  z-index: 50;
}

.ly-container {
  width: 1280px;
  max-width: 100%;
  margin: 0 auto;
}

.ly-header__top {
  background: #f5f5f7;
  border-bottom: 1px solid #efeff3;
  margin: 10px 20px 0;
  border-radius: 16px;
  overflow: hidden;
}

.ly-header__top .ly-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 16px;
}

.ly-topbar__url {
  color: #8c8f97;
  font-size: 12px;
}

.ly-topbar__url a,
.ly-topbar__url a:visited {
  color: #494955;
  font-weight: 400;
  font-size: 12px;
  text-decoration: none;
}

.ly-topbar__logos {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ly-topbar__logos img {
  height: 20px;
  width: auto;
  opacity: 0.75;
}

.ly-header__main {
  background: #fff;
  margin-top: 10px;
}

.ly-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

.ly-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 280px;
}

.ly-header__logo img {
  height: 52px;
  width: auto;
}

.ly-header__brand-sep {
  width: 1px;
  height: 46px;
  background: #e1e1e6;
}

/* Oculto no desktop, exibido apenas no mobile */
.ly-header__actions {
  display: none;
  align-items: center;
  gap: 16px;
}

.ly-header__toggle {
  display: none;
  border: 1px solid var(--ly-border);
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.ly-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
}

.ly-nav__list {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ly-nav__item {
  position: relative;
  display: flex;
  align-items: center;
}

.ly-nav__item a {
  color: #1a1925;
  text-decoration: none;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 4px;
}

.ly-nav__item.has-mega > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #8a8f9c;
  border-bottom: 2px solid #8a8f9c;
  transform: rotate(-135deg);
  margin-left: 6px;
  margin-bottom: 1px;
  transition: transform 0.2s ease;
}

.ly-nav__item.has-mega.is-open > a::after {
  transform: rotate(45deg);
}

.ly-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ly-rose);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
}

.ly-header__cta:hover {
  background: #cc3174;
  color: #fff;
}

.ly-header__cta img {
  width: 18px;
  height: 18px;
}

/* Mega Menu */
.ly-mega {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  width: min(920px, calc(100vw - 32px));
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
}

.ly-mega--small {
  width: min(300px, calc(100vw - 32px));
}

.has-mega.is-open .ly-mega {
  opacity: 1;
  pointer-events: auto;
}

.ly-mega__inner {
  background: #fff;
  border: 1px solid #eeeef0;
  border-radius: 16px;
  box-shadow: var(--ly-shadow);
  padding: 12px 12px 12px 18px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(230px, 270px);
  gap: 18px;
  position: relative;
  overflow: visible;
}

.ly-mega__inner--small {
  display: block;
  width: 100%;
  padding: 12px;
}

.ly-mega__inner::before {
  content: "";
  position: absolute;
  top: -7px;
  left: var(--caret-left, 50%);
  width: 14px;
  height: 14px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  border-top: 1px solid #eeeef0;
  border-left: 1px solid #eeeef0;
  border-radius: 2px 0 0 0;
  z-index: 2;
}

.ly-mega__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.ly-mega__stack {
  display: flex;
  flex-direction: column;
}

.ly-mega__col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px 8px 4px;
}

.ly-mega__col + .ly-mega__col {
  border-left: 1px solid #ececf2;
  padding-left: 22px;
}

.ly-mega__item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1f2442;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  padding: 8px 0;
}

.ly-mega__inner--small .ly-mega__item {
  gap: 14px;
  padding: 16px 14px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.ly-mega__inner--small .ly-mega__item + .ly-mega__item {
  border-top: 1px solid #ececf2;
}

.ly-mega__inner--small .ly-mega__item:hover {
  background: #f4f4f6;
}

.ly-mega__item:hover {
  color: #12183a;
  background: #f4f4f6;
  border-radius: 10px;
}

.ly-mega__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #eeeef0;
  display: grid;
  place-items: center;
  color: #b10558;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.ly-mega__icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ly-mega__icon::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b10558;
}

.ly-mega__icon--image::before {
  display: none;
}

.ly-mega__label {
  flex: 1;
}

.ly-mega__aside {
  border-left: 1px solid #ececf2;
  padding-left: 16px;
}

.ly-mega__card {
  background: #243a8a;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  color: #fff;
  padding: 18px 20px;
  border-radius: 8px;
  min-height: 322px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

.ly-mega__card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  gap: 18px;
}

.ly-mega__card h4 {
  margin: 0;
  color: #fff;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.25;
  position: relative;
}

.ly-mega__card p {
  margin: 0;
  color: #ffffff;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.ly-mega__link {
  color: #fff;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  font-size: 14px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  position: relative;
  margin-top: auto;
  text-decoration: none;
}

/* Modal de Busca */
.ly-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

.ly-search-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ly-search-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
}

.ly-search-modal__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: 0 24px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.ly-search-modal.is-open .ly-search-modal__content {
  transform: translateY(0);
}

.ly-search-modal__close {
  position: absolute;
  top: -60px;
  right: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ly-muted);
  padding: 8px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ly-search-modal__close:hover {
  color: var(--ly-rose);
  transform: scale(1.1);
}

.ly-search-modal__close svg {
  width: 32px;
  height: 32px;
}

.ly-search-modal__form {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ly-border);
  transition: border-color 0.3s ease;
}

.ly-search-modal__form:focus-within {
  border-color: var(--ly-navy);
}

.ly-search-modal__input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 36px;
  font-weight: 300;
  color: var(--ly-navy);
  padding: 16px 0;
  outline: none;
  width: 100%;
}

.ly-search-modal__input::placeholder {
  color: #a0a4b0;
}

.ly-search-modal__submit {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ly-navy);
  padding: 16px 0 16px 16px;
  transition: color 0.2s ease;
}

.ly-search-modal__submit:hover {
  color: var(--ly-rose);
}

.ly-search-modal__submit svg {
  width: 32px;
  height: 32px;
}

/* Estilos de Gatilhos (Desktop e Mobile) */
.ly-search-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ly-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.ly-search-trigger:hover,
.ly-search-trigger:focus {
  color: var(--ly-navy);
  outline: none;
}

.ly-search-trigger--desktop {
  border-left: 1px solid #e1e1e6;
  padding: 0 0 0 16px;
  margin-left: 2px;
}

.ly-search-trigger--desktop svg {
  width: 18px;
  height: 18px;
}

.ly-search-trigger--mobile {
  display: none;
}

/* =========================================
   MEDIA QUERIES
========================================= */
@media (max-width: 1100px) {
  .ly-header__row { 
    flex-wrap: wrap; 
  }
  
  /* Esconde a lupa da topbar */
  .ly-search-trigger--desktop {
    display: none !important;
  }

  /* Exibe o grupo de ações (Lupa + Menu) à direita */
  .ly-header__actions {
    display: flex;
    margin-left: auto;
  }

  /* Garante a exibição da lupa mobile e estiliza */
  .ly-search-trigger--mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--ly-navy);
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .ly-search-trigger--mobile:active {
    background: rgba(31, 47, 109, 0.08);
  }

  .ly-search-trigger--mobile svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
  }

  /* Força a exibição do botão de menu ao lado da lupa */
  .ly-header__toggle { 
    display: inline-flex !important; 
  }
  
  /* Ajustes do Nav Principal */
  .ly-nav { 
    width: 100%; 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 12px; 
    display: none; 
  }
  
  .ly-nav.is-open { display: flex; }
  .ly-nav__list { flex-direction: column; align-items: flex-start; width: 100%; }
  .ly-mega { position: static; transform: none; width: 100%; opacity: 1; pointer-events: auto; margin-top: 10px; display: none; }
  .has-mega.is-open .ly-mega { display: block; }
  .ly-mega__inner { grid-template-columns: 1fr; border-radius: 14px; }
  .ly-mega__inner--small { width: 100%; }
  .ly-mega__inner::before { display: none; }
  .ly-mega__aside { border-left: 0; padding-left: 0; }
  .ly-mega__col + .ly-mega__col { border-left: 0; padding-left: 4px; }
}

@media (max-width: 720px) {
  .ly-header__brand { gap: 10px; }
  .ly-header__logo img { height: 42px; }
  .ly-topbar__url { display: none; }
  .ly-topbar__logos img { height: 16px; }
  
  .ly-search-modal__input { font-size: 24px; padding: 12px 0; }
  .ly-search-modal__close { top: -50px; right: 16px; }
  .ly-search-modal__submit svg { width: 24px; height: 24px; }
}

@media (max-width: 480px) {
  .ly-search-modal__content {
    padding: 0 12px;
  }

  .ly-search-modal__close {
    top: -44px;
    right: 4px;
  }

  .ly-search-modal__close svg {
    width: 24px;
    height: 24px;
  }

  .ly-search-modal__input {
    font-size: 18px;
    padding: 10px 0;
  }

  .ly-search-modal__submit {
    padding: 12px 0 12px 12px;
  }

  .ly-search-modal__submit svg {
    width: 22px;
    height: 22px;
  }
}