/* buscador.css — estilo inspirado en Post-Template.css */

/* Tipografías y base */
body {
  font-family: "Roboto", "Open Sans", sans-serif;
  background: #fafafa;
  color: #222;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Título */
h1.u-align-center.u-custom-font-Staatliches {
  font-family: "Staatliches", cursive;
  font-size: 2.25rem;
  margin: 24px auto 18px;
  text-align: center;
  letter-spacing: 2px;
}

/* Controles de búsqueda (input + botón) */
#searchInput {
  font-family: "Roboto", sans-serif;
  padding: 14px 16px;
  width: calc(100% - 180px);
  max-width: 520px;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  outline: none;
  margin: 12px 8px;
  display: inline-block;
  vertical-align: middle;
  background: #fff;
}

#searchInput:focus {
  box-shadow: 0 2px 8px rgba(71,138,201,0.18);
  border-color: #478ac9;
}

button.align-center {
  font-family: "Roboto", sans-serif;
  padding: 12px 18px;
  margin-left: 6px;
  border-radius: 8px;
  border: none;
  background: #478ac9;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(71,138,201,0.2);
  transition: transform .08s ease, box-shadow .12s ease;
}
button.align-center:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(71,138,201,0.22); }
button.align-center:active { transform: translateY(0); }

/* Contenedor de resultados */
#resultados {
  width: calc(100% - 40px);
  max-width: 1100px;
  margin: 28px auto 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
  box-sizing: border-box;
  padding: 0 10px;
}

/* Tarjeta resultado (inspirada en .u-group-*) */
.result {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  min-height: 220px;
  box-shadow: 5px 5px 20px rgba(0,0,0,0.12);
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none;
  color: inherit;
}

/* hover de tarjeta */
.result:hover {
  transform: translateY(-6px);
  box-shadow: 8px 12px 30px rgba(0,0,0,0.14);
}

/* Imagen — similar a .u-image-1 */
.result img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fff;
  display: block;
}

/* Contenido textual dentro de la tarjeta */
.result > div {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.result strong {
  font-family: "Staatliches", cursive;
  font-size: 1rem;
  color: #222;
}

/* enlace ver producto como botón secundario */
.result a {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.08);
  color: #478ac9;
  font-weight: 500;
  width: fit-content;
}

/* Mensaje sin resultados / buscando */
#resultados p {
  font-size: 1rem;
  text-align: center;
  color: rgba(0,0,0,0.6);
  grid-column: 1/-1;
  padding: 24px 10px;
}

/* --- Responsive: seguir la lógica de Post-Template --- */

/* menos de 1199px: 3 columnas */
@media (max-width: 1199px) {
  #resultados { grid-template-columns: repeat(3, 1fr); max-width: 900px; }
  .result img { height: 160px; }
}

/* menos de 991px: 2 columnas */
@media (max-width: 991px) {
  #resultados { grid-template-columns: repeat(2, 1fr); max-width: 720px; gap: 14px; }
  .result img { height: 200px; }
  #searchInput { width: calc(100% - 140px); max-width: 420px; }
}

/* menos de 767px: 1 columna (lista vertical) */
@media (max-width: 767px) {
  #resultados { grid-template-columns: 1fr; max-width: 540px; }
  .result { flex-direction: row; gap: 12px; min-height: 120px; align-items: center; }
  .result img { width: 140px; height: 100px; }
  .result > div { padding: 12px; }
  h1.u-align-center.u-custom-font-Staatliches { font-size: 1.8rem; }
}

/* muy pequeño (móvil estrecho) */
@media (max-width: 575px) {
  #searchInput { width: 100%; display: block; margin: 10px auto; max-width: none; }
  button.align-center { display: block; width: calc(100% - 24px); margin: 8px auto 18px; }
  .result { flex-direction: column; }
  .result img { width: 100%; height: 160px; }
}
