:root {
  --header-h: 0px;
} /* la seteamos por JS */

body.modal-open {
  overflow: hidden; /* Bloquea el scroll */
}

/* OVERLAY: comienza debajo del header y aplica blur al resto */
.search-modal-overlay {
  display: none;
  position: fixed;
  top: var(--header-h); /* clave: inicia justo debajo */
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-h)); /* ocupa el resto de la pantalla */
  z-index: 100; /* header (99) queda arriba */
  backdrop-filter: blur(3px);
  background: rgba(0, 0, 0, 0.4);
  flex-direction: column;
}

/* CONTENIDO del buscador pegado arriba del overlay */
.search-modal-content {
  width: 100%;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(199, 166, 104, 0.25);
}

/* Barra del buscador */
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 3.5rem;
  min-height: 58px;
}

#searchWord {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f5f5f5;
  font-size: 1.1rem;
}

#searchWord::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.buscador-close {
  background: none;
  border: 0;
  cursor: pointer;
}

/* Resultados (cartas) */
.search-body {
  display: flex;
  flex-wrap: wrap;
  background: rgba(16, 16, 16, 0.9);
  backdrop-filter: blur(6px);
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow: auto;
  padding: 12px 16px;
  gap: 0; /* o el mismo gap que uses en el catálogo */
}

.search-body .producto {
  width: 20%;
  padding: 0.3rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  color: white;
  text-decoration: none;
}

.search-body .nombreProducto {
  font-weight: 200;
}

.search-body .imagen-contenedor {
  position: relative;
  width: 100%;
  padding-top: 135%;
  overflow: hidden;
}

.search-body .imgProducto {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /*transition: opacity 0.4s ease;*/
  display: block;
  pointer-events: none;
}

.search-body .imgProducto.principal {
  opacity: 1;
  z-index: 2;
}

.search-body .imgProducto.hover {
  opacity: 0;
  z-index: 1;
}

.search-body .producto:hover .imgProducto.principal {
  opacity: 0;
}

.search-body .producto:hover .imgProducto.hover {
  opacity: 1;
}

.search-body .productoContenido {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-body .precioProducto{
  font-size: 0.8rem;
}

p {
  margin: 0;
  padding: 0;
}
