.c-header {
  padding: 16px;
  border-bottom: 1px solid var(--color-border-primary);
  z-index: 99999999;
}
.c-header__preheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.c-header__preheader--links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.c-header__link {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 8px;
  border-radius: 99px;
  transition: all 0.4s ease-in-out;
}

.c-header__link-icon {
  background-color: var(--color-blue-light);
  padding: 4px;
  border-radius: 99px;
  width: 16px;
  height: 16px;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1),
    background-color 0.3s ease, color 0.3s ease;
}

.c-header__logo {
  display: block;
  width: 104px;
  transition: all 0.4s ease-in-out;
}
.c-header__logo:hover {
  opacity: 0.5;
}
@media (min-width: 64em) {
  .c-header__logo {
    width: 104px;
  }
}

.c-header__link:hover {
  background-color: var(--color-blue-light);
}
.c-header__link:hover .c-header__link-icon {
  background-color: var(--color-body);
  color: white;
}

.c-header__link:first-child:hover .c-header__link-icon {
  transform: rotate(-45deg);
}

/* Utilidades */
.u-hidden {
  display: none !important;
}
.u-hidden\@mobile {
  @media (max-width: 1024px) {
    display: none !important;
  }
}
.u-hidden\@desktop {
  @media (min-width: 1025px) {
    display: none !important;
  }
}

.c-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.c-header__menu {
  list-style: none;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  flex-wrap: wrap;
}

.c-header__link {
  text-decoration: none;
  font-size: 14px;
  display: block;
  font-weight: 500;
}

@media (min-width: 1024px) {
  .c-header__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background-color: var(--color-blue-light);

    border-bottom: 1px solid var(--color-border-primary);
    list-style: none;
    padding: 0 48px; /* padding vertical 0 al inicio */
    z-index: 1000;

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
  }

  .has-dropdown.is-open .c-header__dropdown {
    /* el padding aparece cuando se abre */

    border-top: 1px solid var(--color-border-primary);
  }
}
.dropdown__inner {
  display: flex;
  margin: 0 auto;
  align-items: stretch;
  max-height: fit-content;
  padding: 48px 0;
  max-width: var(--max-width);
}

@media (max-width: 1024px) {
  .c-header__dropdown {
    position: fixed; /* cubre la pantalla */
    top: 0;
    right: 0;
    height: 100vh;
    width: 100%; /* ancho del menú lateral */
    max-height: none; /* desactivamos la lógica de desktop */
    padding: 0 32px;
    background-color: var(--color-blue-light);
    transform: translateX(100%); /* empieza fuera */
    transition: transform 0.4s ease;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  }

  .has-dropdown.is-open .c-header__dropdown {
    transform: translateX(0); /* entra desde la derecha */
  }

  .dropdown__inner {
    flex-direction: column;
    padding: 32px 0;
    min-height: 100%;
  }
}
.dropdown__inner:has(.map-menu) > :nth-child(1) {
  border: none !important;
}
.dropdown__col {
  flex: 1;
  padding: 0 32px;
}

.dropdown__inner > *:nth-child(1) {
  border-right: 1px solid var(--color-border-primary);
}

.dropdown__inner > *:nth-child(1) h3 {
  margin-bottom: 0;
}

.dropdown__inner > *:nth-child(2) {
  align-self: center;
}
align-self: center;

.dropdown__col--title h3 {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-body);
}

.dropdown__col--links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown__col--links li a {
  display: block;
  padding: 4px 8px;
  border-radius: 99px;
  transition: all 0.4s ease-in-out;
  cursor: pointer;
  color: var(--color-body);
  text-decoration: none;
  width: fit-content;
}

.dropdown__col--links li:not(:last-child) {
  margin-bottom: 8px;
}

.dropdown__col--links li a:hover {
  background-color: var(--color-blue-light-hover);
  text-decoration: none;
}

.dropdown__col--image img {
  width: 100%;
  height: auto;
  border-radius: 24px 24px 0 24px;
  object-fit: cover;
}

.c-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-header__search {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--color-blue-light);
  border-radius: 50px;
  padding: 12px;
  width: fit-content;
  height: fit-content;
  transition: all 0.4s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

.c-header__search:hover {
  border: 1px solid var(--color-body);
}

.c-header__burger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: fit-content;
  height: fit-content;
  border: 1px solid var(--color-blue-light);
  border-radius: 99px;
  background: none;
  cursor: pointer;
  padding: 12px;
  transition: all 0.4s ease-in-out;
}

.c-header__burger:active {
  border: 1px solid var(--color-body);
}
.c-header__burger-line {
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 2px;
}
.c-header__burger {
  width: 42px;
  height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--color-blue-light);
  border-radius: 99px;
  background: none;
  cursor: pointer;
  padding: 12px;
  transition: all 0.4s ease-in-out;
}

.c-header__burger span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--color-body);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.c-header__burger span:last-child {
  width: 60%;
}

/* ANIMACIÓN AL ABRIR */
.c-header__burger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.c-header__burger.is-open span:nth-child(2) {
  transform: translateY(0px) rotate(-45deg);
}

.c-header__burger.is-open span:nth-child(3) {
  opacity: 0;
}

.c-header__mobile-menu {
  background-color: white;
  padding: 0 16px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 0;
  height: 100%;
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  transition: max-height 0.6s cubic-bezier(0.77, 0, 0.175, 1),
    padding 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.c-header__mobile-menu.is-open {
  padding: 16px;
}

.c-header__menu--mobile {
  list-style: none;
  margin: 0;
  padding: 0;
}

.c-header__mobile-menu > div {
  width: 100%;
  padding-top: 16px;
}
.c-header__menu--mobile li {
  margin-bottom: 16px;
}
.c-header__menu--mobile a {
  color: var(--color-body);
  text-decoration: none;
  font-weight: 500;
}

.c-header__item {
  padding: 4px 8px;
  border-radius: 99px;
  transition: all 0.4s ease-in-out;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-body);
}

.menu-item--with-icon {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.menu-item--with-icon svg {
  width: 16px;
  height: 16px;
  padding: 5px;
  background-color: var(--color-blue-light);
  color: var(--color-body);
  border-radius: 99px;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1),
    background-color 0.4s ease, color 0.4s ease;
}

@media (min-width: 1024px) {
  .c-header__item:hover .menu-item--with-icon svg,
  .c-header__item.is-open .menu-item--with-icon svg {
    background-color: var(--color-body);
    color: white;
    transform: rotate(90deg);
  }
  .c-header__item:hover {
    background-color: var(--color-blue-light);
  }
  .c-header__item.is-open .dropdown-icon path:last-child {
    transform: rotate(90deg);
  }
}

.c-header__item .dropdown-icon path:last-child {
  transition: all 0.4s ease-in-out;
  transform-box: fill-box;
  transform-origin: center;
}

.map-menu {
  padding: 0 32px;
  width: 100%;
  flex: 2;
}

.map-menu .dropdown__col--image img {
  display: none;
}
.map-menu .dropdown__col {
  padding: 0 !important;
}

.map-menu ul {
  display: flex;
  gap: 32px;
}
.map-menu ul li {
  flex: 1;
  position: relative;
  margin-bottom: 0 !important;
  border-radius: 32px 32px 0 32px;
  overflow: hidden;
}

.map-menu ul li a {
  padding: 0;
}

.map-menu ul li a:first-child {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
}

.map-menu ul li a:last-child {
  width: 100%;
}
.map-menu ul li .dropdown__col--image {
  padding: 0;
  width: 100%;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .map-menu ul li .dropdown__col--image {
    min-height: 280px;
  }
}

.map-menu ul li:first-child .dropdown__col--image::before,
.map-menu ul li:first-child .dropdown__col--image::after,
.map-menu ul li:last-child .dropdown__col--image::before,
.map-menu ul li:last-child .dropdown__col--image::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.map-menu ul li:first-child .dropdown__col--image::before {
  background-image: url("/themes/custom/korian/img/europe.svg");
  opacity: 1;
}

.map-menu ul li:first-child .dropdown__col--image::after {
  background-image: url("/themes/custom/korian/img/europe-selected.svg");
  opacity: 0;
}

.map-menu ul li:last-child .dropdown__col--image::before {
  background-image: url("/themes/custom/korian/img/spain.svg");
  opacity: 1;
}

.map-menu ul li:last-child .dropdown__col--image::after {
  background-image: url("/themes/custom/korian/img/spain-selected.svg");
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .map-menu ul li:first-child:hover .dropdown__col--image::before,
  .map-menu ul li:last-child:hover .dropdown__col--image::before {
    opacity: 0;
  }

  .map-menu ul li:first-child:hover .dropdown__col--image::after,
  .map-menu ul li:last-child:hover .dropdown__col--image::after {
    opacity: 1;
  }
}

.map-menu ul li .dropdown__col--image img {
  height: 100% !important;
  border-radius: 0 !important;
}

.mobile-nav-back {
  outline: none;
  border: none;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.c-header__links--mobile {
  display: flex;
  justify-content: space-between;
}

.c-header__search-bar {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  display: none;
  height: auto;
}

.c-header__search-bar form {
  background-color: white;
  padding: 0 16px 16px;

  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s ease-in-out, opacity 0.5s ease-in-out;
}

.c-header__search-bar.is-open form {
  transform: translateY(0);
  opacity: 1;
}
.c-header__search-bar input {
  width: 100%;
  outline: none;
  border: none;
  border-radius: 99px;
  background-color: var(--color-blue-light);
  padding: 16px 48px;
  text-align: center;
}

.c-header__search-bar .search-close {
  position: absolute;
  top: calc(50% - 8px);
  transform: translateY(-50%);
  right: 24px;
  outline: none;
  border: 1px solid var(--color-border-primary);
  border-radius: 99px;
  color: var(--color-body);
  cursor: pointer;
  transition: all 0.4s ease-in-out;
}

.c-header__search-bar .search-close:hover {
  border: 1px solid var(--color-body);
}

.c-header__search-bar .search-close svg {
  vertical-align: sub;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

input[type="search"] {
  -moz-appearance: textfield;
}

.c-header__item.has-dropdown.is-open:focus-within .c-header__dropdown,
.c-header__item.has-dropdown:focus-within .c-header__dropdown {
  display: block;
  max-height: none;
}
@media (max-width: 1120px) {
  .c-header__menu {
    gap: 0;
  }
}
@media (max-width: 1024px) {
  .c-header {
    padding: 16px;
  }
  .c-header__menu {
    flex-direction: column;
    width: 100%;
    border-bottom: 1px solid var(--color-blue-light);
  }

  .c-header__dropdown {
    height: calc(100dvh - 75px);
  }
  .dropdown__inner {
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
  }
  .dropdown__inner > *:nth-child(2) {
    align-self: flex-start;
    margin-top: auto;
  }
  .dropdown__col {
    flex: none;
    padding: 0;
  }
  .dropdown__inner > :nth-child(1) {
    border-right: none;
  }
  .dropdown__inner > *:nth-child(1) h3 {
    margin-bottom: 0;
  }
  .map-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }

  .map-menu > div {
    height: 100%;
  }
  .map-menu ul {
    flex-direction: column;
    height: 100%;
  }
  .mobile-nav-back {
    margin-bottom: 16px;
  }
  .map-menu ul li > *:last-child,
  .map-menu ul li .dropdown__col--image {
    height: 100%;
  }
}

@media (max-width: 600px) {
  .dropdown__col--links li a {
    white-space: break-spaces;
  }
}

@media (min-width: 1024px) {
  .c-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .c-header__preheader {
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }

  .c-header__preheader.is-hidden {
    max-height: 0;
    opacity: 0;
  }
}

.menu-item--active-trail {
  background-color: var(--color-blue-light);
}

.menu-item--active-trail .dropdown-icon svg {
  background-color: var(--color-body);
  color: white;
}

.dropdown__col--links li a.is-active {
  background-color: var(--color-body);
  color: white;
}
.map-menu .dropdown__col--links li a.is-active {
  background-color: transparent;
  color: var(--color-body);
}
.map-menu
  .dropdown__col--links
  li
  a.is-active
  + a
  .dropdown__col--image::before {
  opacity: 0;
}
.map-menu
  .dropdown__col--links
  li
  a.is-active
  + a
  .dropdown__col--image::after {
  opacity: 1;
}
