/* ======================= */
/*  BARRA AZUL SUPERIOR    */
/* ======================= */
.topBar {
  width: 100%;
  color: var(--ColorWhite);
  font-size: 14px;
  position: fixed;
  top: 0;
  z-index: 20;
  padding: 12px 15px;
  height:auto;
}

.topBarContent {
  max-width: 1400px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contactInfo {
  display: flex;
  gap: 20px;
  align-items: center;
  font-family: Poppins;
  font-weight: 400;
  font-size:11px;
}

.socialIcons {
  display: flex;
  gap: 12px;
}

.socialIcons a {
  color: var(--AzulFuerte);
  font-size: 18px;
  transition: 0.3s;
  background-color: var(--ColorWhite);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.socialIcons a:hover {
  color: var(--AzulFuerte);
}

/* ======================= */
/*  MENÚ PRINCIPAL BLANCO  */
/* ======================= */

header {
  width: 100%;
  background-color: var(--ColorWhite);
  position: sticky;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  top:40px;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding:25px 0;
  position: fixed;
  z-index: 1000;
}

.containerMenu {
  width: 100%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 0 10px;
}


/* Logo */
.containerOpenLogo img {
  width: 100%;
  max-width:200px;
  height: auto;
  overflow: hidden;
  display:block;
}

/* Menú */
nav ul {
  display: flex;
  gap: 60px;
  list-style: none;
}

/* Desktop: oculto */
.onlyMobile {
  display: none;
}
/*
nav ul .contacto-mostrar-response{
  display: none;
}*/

nav ul li a {
  text-decoration: none;
  color: var(--Colorplomo);
  font-weight: 600;
  font-size: 16px;
}

nav ul li a:hover {
  color: var(--AzulFuerte);
}

/* ======================= */
/*  SUBMENÚ (PROYECTOS)    */
/* ======================= */
.submenu {
  position: relative;
}

.submenu .flecha {
  margin-left:4px;
  font-size: 10px;
  transition: transform 0.3s ease;
}

.submenu-items {
  flex-direction: column;
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--ColorWhite);
  min-width: 190px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  /*padding: 10px 0;*/ /*por siaca esto lo borramos*/
  margin-top: 10px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  gap: 15px;
  padding:20px 0px;
}

.submenu-items li a {
  display: block;
  padding: 5px 15px;
  color: #222;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.submenu-items li a:hover {
  color: var(--AzulFuerte);
}

/* Buscador */
.searchBox {
  display: flex;
  align-items: center;
  background: var(--AzulFuerte);
  border-radius: 20px;
  padding: 10px 20px;
  transition: all ease .3s;
  font-family: var(--font-Poppins);
  cursor: pointer;
}

.searchBox:hover{
  background-color: var(--AzulCorporativo);
}

.searchBox button{
  color: var(--ColorWhite);
  font-size: 13px;
  font-weight:600;
  letter-spacing:1px;
  background-color: transparent;
  border:none;
  outline:none;
  cursor: pointer;
}

.searchBox input {
  border: none;
  outline: none;
  background: none;
  width: 100%;
  font-size: 14px;
}

.searchBox i {
  color: #666;
  cursor: pointer;
}

/* Botón hamburguesa */
.nav-bar {
  display: none;
  width: 45px;
  height: 45px;
  justify-content: center;
  align-items: center;
  border: 1px solid #ccc;
  cursor: pointer;
}

.nav-bar span {
  position: relative;
  width: 25px;
  height: 3px;
  background: #000;
}

.nav-bar span::before,
.nav-bar span::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background: #000;
  transition: 0.3s;
}

.nav-bar span::before {
  top: -8px;
}
.nav-bar span::after {
  top: 8px;
}

.closeBar span {
  background: transparent;
}
.closeBar span::before {
  transform: rotate(45deg);
  top: 0;
}
.closeBar span::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Overlay */
.overlayMenu {
  position: fixed;
  top: 136px;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  display: none;
}

.displayOverlayMenu {
  display: block;
}


.spaceNav {
  width: 100%;
  /*height: 90px;*/
  height: 105px;
  background-color: transparent;
}

/* ESTILOS ADICIONALES PARA EL BUSCADOR */
.flexBuscador {
  display: flex;
}
.responseSearchButtonBox {
  display: none;
  width: 45px;
  height: 45px;
  justify-content: center;
  align-items: center;
}

.search-box {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  background-color: var(--ColorWhite);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 25px 0;
  z-index: 1001;
  transition: all ease .3s;
  display: flex;
  justify-content: space-between;
  padding-left: 15px;
}

.search-box.active {
  top: 0;
}

.search-wrapper {
  position: relative;
  width: 92%;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 20px 50px 20px 20px;
  border: 1px solid var(--ColorBtn);
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  transition: all ease .3s;
  box-shadow: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-clear {
  position: absolute;
  right: 50px;
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 0 10px;
  opacity: 0;
  visibility: hidden;
  transition: all ease .3s;
}

.search-input:not(:placeholder-shown) + .search-clear {
  opacity: 1;
  visibility: visible;
}

.search-submit {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--ColorBtn);
  cursor: pointer;
  padding: 0 10px;
}

.search-close {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--gray);
  cursor: pointer;
  transition: all ease .3s;
  margin-left: 20px;
}

.search-close:hover {
  color: var(--ColorBtn);
}

/* Overlay */
.overlay {
  position: fixed;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all ease .3s;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Resultados de búsqueda */
.search-results {
  position: absolute;
  top: 110px;
  left: 0;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--ColorWhite);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  margin-top: 10px;
  display: none;
}

.search-box.active .search-results {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  text-decoration: none;
  color: var(--black);
  border-bottom: 1px solid var(--gray);
  transition: all ease .3s;
  background-color: var(--ColorWhite);
}

.search-result-item:hover {
  background-color: var(--ColorVerde);
}

.search-result-image {
  width: 50px;
  height: 50px;
  margin-right: 15px;
  flex-shrink: 0;
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-result-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--gray);
}

/* ======================= */
/*  SUBMENÚ — DESKTOP      */
/* ======================= */
@media (min-width: 1081px) {
  .submenu:hover .submenu-items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .submenu:hover .flecha {
    transform: rotate(180deg);
  }

}

/* Responsive */
@media (max-width: 1080px) {
  nav ul {
    flex-direction: column;
    background: var(--ColorWhite);

    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    margin-top: 83px;
    margin-left: -100%;
    height: 100vh;
    gap: 20px;
  }

  nav ul li a {
    display: block;
    text-decoration: none;
    color: var(--Colorplomo);
    padding: 20px 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
  }

  nav ul li a:hover {
    color: var(--AzulFuerte);
  }

  .onlyMobile {
    display: block; /* o list-item, da igual, ya heredas el flex-column del padre */
  }

  .nav-bar {
    display: flex;
  }

  .searchBox {
    display: none;
  }

  .mostrar {
    margin-left: 0;
    transition: 0.3s;
  }

  .responseSearchButtonBox {
    display: flex;
  }

  /* SUBMENÚ — MÓVIL */
  .submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .submenu-items {
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
    margin-left: 0;
    width: 100%;
    padding-left: 15px;
    max-height: 0;
    opacity: 0;
    visibility: visible;
    transform: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }


  .submenu.open .submenu-items {
    opacity: 1;
    padding: 10px 0px;
    position: static;
  }

  .submenu.open .flecha {
    transform: rotate(180deg);
  }
}

@media (max-width: 700px) {
  .topBar {
    display: none;
  }
  header {
    top: 0px;
  }

  .overlayMenu {
    top:95px;
  }

  nav ul{
     top:10px;
  }

  .spaceNav {
    /*height: 30px;*/
    height: 70px;
  }

  .search-wrapper {
    width: 89%;
  }
}
@media (max-width: 500px) {
  .search-wrapper {
    width: 84%;
  }
}

@media (max-width: 430px) {
  .search-wrapper {
    width: 82%;
  }
}
