/* Estilos para la barra de búsqueda */
.search-container {
  display: flex;
  justify-content: center;         /* Centra horizontalmente */
  align-items: center;             /* Centra verticalmente */
  margin: -10px auto 0 auto;        /* Arriba 10px, centrado horizontal */
  max-width: 500px;                /* Ancho máximo para uniformidad */
  width: 100%;                     /* Ocupa todo el ancho disponible */
  padding: 0;
  position: relative;              /* Necesario para posicionar las sugerencias */
  z-index: 1005 !important;                   /* Encima del overlay */
  box-sizing: border-box;
}


/* Input */
.search-input {
  width: 480px;
  padding: 0.75rem;        /* en lugar de 10px */
  font-size: 1rem;         /* en lugar de 16px */
  font-weight: bold;                   /* Letra en negrita */
  color: #ffdc00;                      /* Texto amarillo */
  background: rgba(0, 0, 0, 0.9);      /* Fondo oscuro translúcido */
  border: 4px solid #f39c12;
  border-radius: 20px;
  outline: none;
  transition: border-color .3s, box-shadow .3s;
  box-sizing: border-box;
  z-index: 1005 !important;
}

.search-input:focus {
  border-color: #f39c12;
    box-shadow:
    0 0 8px rgba(243,156,18,0.8),
    0 4px 12px rgba(0,0,0,0.5);
}
.search-input::placeholder {
  color: #ffdc00;       /* Amarillo brillante */
  font-weight: bold;    /* Negrita */
  opacity: 1;           /* Asegura que no se vea deslavado */
}


/* Botón */
.search-button {
  background: #f39c12;
  border: none;
  width: 50px; height: 45px;
  margin-left: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .3s, background .3s;
  z-index: 1005 !important;
}
.search-button i {
  font-size: 20px;
  color: #1a1a1a;
  transition: transform .3s, color .3s;
}
.search-button:hover {
  background: #fff;
  transform: scale(1.1);
}
.search-button:hover i {
  color: #f39c12;
  transform: scale(1.2);
}

/* Overlay oscuro (detrás de las sugerencias) */
#searchOverlay {
  position: fixed ;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  z-index: 1000;
}

/* —————————— SUGERENCIAS —————————— */
.search-suggestions {
  position: absolute;
  top: 100%;            /* justo al fondo del .search-container */
  left: 4% !important;              /* alineado a la izquierda del input */
  width: 80% !important;          /* mismo ancho que el input */
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0,0,0,0.8);
  border: 4px solid #f39c12;
  border-top: none;
  border-radius: 0 0 20px 20px;  /* solo radios abajo */
  box-shadow:
    0 0 8px rgba(243,156,18,0.8),
    0 4px 12px rgba(0,0,0,0.5);
  display: none;        /* se muestra desde JS */
  z-index: 1001;
  box-sizing: border-box;
}

/* Cada sugerencia */
.search-suggestions .suggestion {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* <--- AÑADIR ESTA LÍNEA */
  padding: 9px 12px;
  cursor: pointer;
  transition: background .2s;
}
.search-suggestions .suggestion + .suggestion {
  border-top: 1px solid #f39c12;
}
.search-suggestions .suggestion:hover {
  background: rgba(243,156,18,0.2);
}

/* Imagen */
.search-suggestions .suggestion img {
  width: 40px; height: 40px;
  object-fit: cover;
  margin-right: 8px;
  border-radius: 4px;
}

/* Texto */

.search-suggestions .suggestion span {
  color: #ffdc00;
  flex: 1;
  font-size: 16px;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;   /* ⬅️ Añadimos esto */
  justify-content: flex-start;   /* ⬅️ Por si acaso */
  display: inline-block;         /* ⬅️ Para evitar que se auto-centre */
  font-weight: bold;
}

/* 2) El precio se alinea a la derecha */
.search-suggestions .suggestion small {
  margin-left: auto;
  font-size: 16px;
  color: #ffdc00;
  font-weight: bold;
  text-align: right !important;
}

/* —————————— “Ver más resultados” centrado —————————— */
.search-suggestions .suggestion.ver-mas {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Asegura que el span de “Ver más” ocupe el 100% y centre su texto */
.search-suggestions .suggestion.ver-mas span {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 0 !important;
}


.search-suggestions .suggestion.ver-mas:hover {
  background: rgba(243,156,18,0.3);
}

@media (max-width: 768px) {
  .search-suggestions {
    left: 44.2% !important;
    transform: translateX(-50%) !important;
    width: 72% !important;
    max-width: 320px !important;
    
  }
}
@media (max-width: 768px) {
  .search-container {
    padding: 0 12px; /* ⬅️ Margen a izquierda y derecha */
    box-sizing: border-box; /* ⬅️ Para que no se desborde */
  }

  .search-input {
    width: 100% !important; /* ⬅️ Se adapta al ancho disponible dentro del padding */
    max-width: 100% !important;
    height: 40px;
  }
  .search-button {
      width: 40px; height: 40px;
  }
  .search-suggestions .suggestion span {
  color: #ffdc00;
  flex: 1;
  font-size: 14px;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;   /* ⬅️ Añadimos esto */
  justify-content: flex-start;   /* ⬅️ Por si acaso */
  display: inline-block;         /* ⬅️ Para evitar que se auto-centre */
  font-weight: bold;
}

/* 2) El precio se alinea a la derecha */
.search-suggestions .suggestion small {
  margin-left: auto;
  font-size: 14px;
  color: #ffdc00;
  font-weight: bold;
  text-align: right !important;
}
}

