/* Estilos para el buscador y resultados de búsqueda */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 300px;
  margin: 0 auto;
}

#search-input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid #d4c3b5;
  border-radius: 20px;
  font-size: 14px;
  color: #6b4423;
  background-color: #fff;
  transition: all 0.3s ease;
}

#search-input:focus {
  outline: none;
  border-color: #8b5d33;
  box-shadow: 0 0 0 2px rgba(139, 93, 51, 0.2);
}

/* Modificar el posicionamiento del botón de búsqueda */
#search-button {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: #6b4423;
  cursor: pointer;
  font-size: 16px;
  /* Mostrar solo cuando no hay texto */
  display: block;
}

/* Modificar el posicionamiento del botón de cerrar */
#search-close {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: #6b4423;
  cursor: pointer;
  font-size: 16px;
  display: none;
  z-index: 10; /* Asegurar que esté por encima de otros elementos */
}

/* Cuando el botón de cerrar está visible, ocultar el botón de búsqueda */
#search-close:not([style*="display: none"]) ~ #search-button {
  display: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #d4c3b5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 10px;
  display: none;
}

.search-results-header {
  padding: 12px 15px;
  font-weight: 600;
  color: #6b4423;
  border-bottom: 1px solid #f0e6dd;
  background-color: #f8f1e9;
}

.result-item {
  display: flex;
  padding: 12px 15px;
  border-bottom: 1px solid #f0e6dd;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background-color: #f8f1e9;
}

.result-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 15px;
}

.result-info {
  flex: 1;
}

.result-title {
  font-weight: 600;
  color: #6b4423;
  margin-bottom: 5px;
}

.result-category {
  font-size: 13px;
  color: #8b5d33;
  margin-bottom: 5px;
}

.result-difficulty {
  font-size: 13px;
  color: #6b4423;
  display: flex;
  align-items: center;
}

.difficulty-indicator {
  display: inline-flex;
  margin-left: 5px;
}

.difficulty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #e0d5c9;
  margin-right: 3px;
}

.difficulty-dot.active {
  background-color: #8b5d33;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: #6b4423;
}

.ver-todo-button {
  padding: 12px;
  text-align: center;
  background-color: #f8f1e9;
  color: #6b4423;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ver-todo-button:hover {
  background-color: #e0d5c9;
}

/* Estilos responsivos */
@media (max-width: 992px) {
  .search-container {
    width: 250px;
  }

  .search-results {
    width: 300px;
    left: -25px;
  }
}

@media (max-width: 768px) {
  .search-container {
    width: 100%;
    max-width: none;
  }

  .search-results {
    width: 100%;
    left: 0;
  }

  #search-input {
    font-size: 14px;
  }

  .result-title {
    font-size: 14px;
  }

  .result-category,
  .result-difficulty {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .result-image {
    width: 50px;
    height: 50px;
  }

  .result-item {
    padding: 10px;
  }

  .search-results-header {
    padding: 10px;
    font-size: 14px;
  }

  .ver-todo-button {
    padding: 10px;
    font-size: 14px;
  }
}
