/* Buscador propio en la web (fase 4). Colores y letra de la tienda: rosa #E31971 (botón), Poppins. */

html.bys-sin-scroll, html.bys-sin-scroll body { overflow: hidden !important; }

/* ---------- Móvil B: barra visible bajo la cabecera ---------- */
.bys-barra-movil { display: none; }
@media (max-width: 767px) {
  /* Con la barra visible sobra la lupa de la cabecera (Luis: "tenemos dos buscadores"); diseño B: sin lupa */
  #brx-header .brxe-search { display: none !important; }
  .bys-barra-movil { display: block; width: 100%; padding: 0 16px 10px; background: #fff; }
  .bys-barra-movil button {
    width: 100%; height: 46px; border: 1.5px solid #ED0677; border-radius: 23px; background: #fff;
    display: flex; align-items: center; gap: 10px; padding: 0 16px; text-align: left; cursor: pointer;
    font-family: Poppins, sans-serif; box-shadow: none;
  }
  .bys-barra-movil span { font-size: 14px; color: #6B6B6B; }
}

/* ---------- La capa ---------- */
#bys-capa {
  position: fixed; inset: 0; z-index: 2147483000; background: #fff; color: #363636;
  font-family: Poppins, sans-serif; font-size: 14px; line-height: 1.4;
  display: none; flex-direction: column;
}
#bys-capa.abierta { display: flex; }
#bys-capa *, #bys-capa *::before, #bys-capa *::after { box-sizing: border-box; }
#bys-capa button { font-family: inherit; cursor: pointer; }
#bys-capa a { text-decoration: none; }
#bys-capa .bys-in { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 40px; }

#bys-capa .bys-arriba { flex-shrink: 0; padding-top: 22px; border-bottom: 1px solid #EDEDED; }
#bys-capa .bys-arriba .bys-in:first-child { display: flex; align-items: center; gap: 16px; }
#bys-capa .bys-caja {
  flex: 1; display: flex; align-items: center; gap: 14px; padding: 6px 4px 10px; border-bottom: 2px solid #ED0677;
}
#bys-capa .bys-q {
  flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important;
  font-family: Poppins, sans-serif; font-size: 20px; color: #1A1A1A; padding: 4px 0; margin: 0; height: auto;
}
#bys-capa .bys-q::-webkit-search-cancel-button { display: none; }
#bys-capa .bys-borrar {
  border: 0; background: #F1F1F1; width: 36px; height: 36px; border-radius: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
#bys-capa .bys-borrar svg { width: 16px; height: 16px; }
#bys-capa .bys-borrar[hidden] { display: none; }
#bys-capa .bys-cerrar { border: 0; background: none; padding: 6px; display: flex; }
#bys-capa .bys-msgs { padding-top: 8px; padding-bottom: 10px; min-height: 18px; font-size: 13px; color: #595959; }
#bys-capa .bys-msgs strong { color: #1A1A1A; }

#bys-capa .bys-cuerpo { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 0 48px; }
#bys-capa .bys-cargando, #bys-capa .bys-vacio { color: #6B6B6B; }

/* Inicio: una línea de búsquedas y "Lo más vendido" con foto */
#bys-capa .bys-inicio { display: flex; flex-direction: column; gap: 22px; }
#bys-capa .bys-busquedas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#bys-capa .bys-etq { font-size: 13px; font-weight: 600; color: #1A1A1A; margin-right: 2px; }
#bys-capa .bys-sep { width: 1px; height: 22px; background: #DADADA; margin: 0 6px; }
#bys-capa .bys-destacados { display: flex; flex-direction: column; gap: 12px; }
/* Cuantas columnas quepan (6 en ordenador grande); nunca tan estrechas que se corte la etiqueta (tablet) */
#bys-capa .bys-carrusel { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
#bys-capa h3 { margin: 0; font-size: 15px; font-weight: 600; color: #1A1A1A; }
#bys-capa .bys-tit { display: flex; align-items: center; justify-content: space-between; }
#bys-capa .bys-link { border: 0; background: none; font-size: 12px; color: #595959; text-decoration: underline; padding: 0; }
#bys-capa .bys-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#bys-capa .bys-chip {
  border: 1px solid #DADADA; background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 13px; color: #363636; line-height: 1.2;
}
#bys-capa .bys-chip.pop { border-color: #FCE4F0; background: #FCE4F0; color: #1A1A1A; }
#bys-capa .bys-chip.on { border-color: #1A1A1A; background: #1A1A1A; color: #fff; }
#bys-capa .bys-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#bys-capa .bys-cat {
  border: 1px solid #EDEDED; background: #FAFAFA; border-radius: 10px; padding: 12px 14px;
  font-size: 13px; font-weight: 500; color: #1A1A1A; text-align: left;
}

/* Filtro */
#bys-capa .bys-filtro { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #EDEDED; }
#bys-capa .bys-filtro-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#bys-capa .bys-filtro-tit { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #1A1A1A; }
#bys-capa .bys-filtro-op { display: flex; align-items: center; gap: 14px; font-size: 13px; }
#bys-capa .bys-filtro-op label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; color: #363636; font-size: 13px; }
#bys-capa .bys-filtro-op input { width: 18px; height: 18px; accent-color: #E31971; margin: 0; }
#bys-capa .bys-orden {
  font-family: inherit; font-size: 13px; color: #363636; border: 1px solid #DADADA; border-radius: 8px;
  padding: 6px 10px !important; background: #fff; height: auto !important; min-height: 0 !important; width: auto !important; line-height: 1.3;
}
#bys-capa .bys-precio small { font-size: 11px; font-weight: 400; color: #6B6B6B; margin-left: 4px; }
/* Cabecera de resultados (opción A): nº de productos y "Ordenar" en una línea */
#bys-capa .bys-cab-res { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 12px; }
#bys-capa .bys-cuantos { font-size: 13px; color: #595959; }
#bys-capa .bys-ordenar { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; color: #595959; min-width: 0; }
#bys-capa .bys-ordenar .bys-orden { border: 0 !important; background: transparent; font-weight: 500; color: #1A1A1A; padding: 4px 2px !important; cursor: pointer; }

/* Tarjetas (ordenador: rejilla) */
#bys-capa .bys-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
#bys-capa .bys-tarjeta {
  border: 1px solid #EDEDED; border-radius: 12px; padding: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 8px; text-align: center;
}
#bys-capa .bys-tarjeta:hover { border-color: #DADADA; }
#bys-capa .bys-foto { position: relative; display: block; }
#bys-capa .bys-foto img { width: 100%; height: 170px; object-fit: contain; display: block; }
#bys-capa .bys-tarjeta.agotado img { opacity: .45; }
/* Insignias siempre DENTRO de la foto (Luis, 1/10): nunca más anchas que la imagen */
#bys-capa .bys-insignias {
  position: absolute; top: 4px; left: 4px; max-width: calc(100% - 8px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; z-index: 1;
}
#bys-capa .bys-ins {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 600; color: #fff; border-radius: 4px; padding: 2px 7px; background: #1A1A1A; line-height: 1.3;
}
/* Promo (opción D elegida por Luis): blanca, borde y letra rosa de la tienda */
#bys-capa .bys-ins.promo {
  background: #fff; color: #E31971; border: 1.5px solid #E31971; border-radius: 20px; padding: 1px 8px;
}
#bys-capa .bys-ins.pro { background: #E31971; }
#bys-capa .bys-ins.ago { background: #595959; }
#bys-capa .bys-datos { flex: 1; display: flex; flex-direction: column; gap: 6px; }
#bys-capa .bys-nombre {
  font-size: 13px; color: #1A1A1A; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#bys-capa .bys-precio { font-size: 15px; color: #1A1A1A; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#bys-capa .bys-precio strong { font-weight: 600; }
#bys-capa .bys-precio strong.rosa { color: #E31971; }
#bys-capa .bys-precio s { font-size: 12px; color: #6B6B6B; }
#bys-capa .bys-precio em { font-style: normal; font-size: 11px; font-weight: 600; color: #E31971; }
#bys-capa .bys-precio.bys-espera { color: #B0B0B0; }

/* El botón de siempre de la tienda */
#bys-capa .bys-boton {
  display: inline-flex; align-items: center; justify-content: center;
  background: #E31971; color: #fff !important; border: 0; border-radius: 10px;
  font-family: Poppins, sans-serif; font-size: 16px; font-weight: 500; line-height: 1;
  padding: 2px 10px; min-height: 30px; white-space: nowrap;
}
#bys-capa .bys-boton:hover { filter: brightness(.93); }
#bys-capa .bys-boton:disabled { opacity: .7; cursor: default; }
#bys-capa .bys-boton.bys-ok { background: #1A1A1A; }
#bys-capa .bys-boton.bys-agotado { background: #BDBDBD; }
/* Semilac Professional para quien no es pro: como el botón de la ficha de la web (negro, muy redondeado).
   Más pequeño y en dos líneas si hace falta, para que nunca se salga de la tarjeta. */
#bys-capa .bys-boton.bys-solo-pro {
  background: #000; border-radius: 25px; font-size: 13px; line-height: 1.2; padding: 6px 14px;
  white-space: normal; text-align: center; max-width: 100%;
}
/* Reservas: la misma etiqueta que la ficha de la web */
#bys-capa .bys-ins.reserva { background: #fdf1de; color: #8a5a00; }
#bys-capa .bys-llega { font-size: 11px; color: #8a5a00; }

#bys-capa .bys-mas {
  display: block; margin: 24px auto 0; border: 1px solid #1A1A1A; background: #fff; border-radius: 10px;
  padding: 10px 20px; font-size: 14px; font-weight: 500; color: #1A1A1A;
}

/* Sin resultados */
#bys-capa .bys-sin { display: flex; gap: 40px; align-items: flex-start; }
#bys-capa .bys-sin > div:first-child { flex: 1; display: flex; flex-direction: column; gap: 12px; }
#bys-capa .bys-sin h2 { margin: 0; font-size: 22px; font-weight: 600; color: #1A1A1A; }
#bys-capa .bys-sin p { margin: 0; color: #595959; }
#bys-capa .bys-wa { width: 340px; flex-shrink: 0; border-radius: 12px; background: #FCE4F0; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
#bys-capa .bys-wa strong { font-size: 15px; color: #1A1A1A; }
#bys-capa .bys-wa a { align-self: flex-start; background: #1A1A1A; color: #fff; font-size: 13px; font-weight: 500; border-radius: 8px; padding: 10px 16px; }

/* Aviso "añadido" */
#bys-capa .bys-aviso {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1A1A1A; color: #fff; border-radius: 26px; padding: 12px 22px; font-size: 14px; font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); white-space: nowrap;
}
#bys-capa .bys-aviso a { color: #fff; text-decoration: underline; margin-left: 6px; }
#bys-capa .bys-aviso[hidden] { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  #bys-capa .bys-in { padding: 0 16px; }
  #bys-capa .bys-arriba { padding-top: 12px; }
  #bys-capa .bys-arriba .bys-in:first-child { gap: 10px; }
  #bys-capa .bys-caja { height: 44px; border: 0; border-radius: 22px; background: #F1F1F1; padding: 0 14px; gap: 8px; }
  #bys-capa .bys-q { font-size: 16px; }
  #bys-capa .bys-borrar { width: 24px; height: 24px; border-radius: 12px; background: #DADADA; }
  #bys-capa .bys-borrar svg { width: 12px; height: 12px; }
  #bys-capa .bys-cuerpo { padding: 12px 0 96px; }
  #bys-capa .bys-inicio { gap: 18px; }
  #bys-capa h3 { font-size: 14px; }
  #bys-capa .bys-sep { display: none; }
  #bys-capa .bys-ordenar > span { display: none; } /* en el móvil basta el desplegable: no se sale ni a 320 px */
  /* Filtro: en pantallas estrechas (320 px) "Solo en stock" y "Ordenar" se ajustan al ancho, sin salirse */
  #bys-capa .bys-filtro-cab > * { min-width: 0; }
  #bys-capa .bys-filtro-op { flex: 1 1 auto; justify-content: flex-end; gap: 10px; max-width: 100%; }
  #bys-capa .bys-orden { flex: 0 1 auto; min-width: 0 !important; max-width: 100% !important; }
  /* Búsquedas en una sola línea que se desliza de lado */
  #bys-capa .bys-busquedas { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  #bys-capa .bys-busquedas::-webkit-scrollbar, #bys-capa .bys-carrusel::-webkit-scrollbar { display: none; }
  #bys-capa .bys-busquedas > * { flex-shrink: 0; }
  #bys-capa .bys-carrusel { scrollbar-width: none; }

  /* "Lo más vendido" y "Novedades" en el móvil: en lista, uno debajo de otro, igual que los resultados (Luis, 1/10) */
  #bys-capa .bys-carrusel { display: flex; flex-direction: column; gap: 0; }

  /* Lista: foto a la izquierda, datos y botón a la derecha */
  #bys-capa .bys-rejilla { display: flex; flex-direction: column; gap: 0; }
  #bys-capa .bys-tarjeta {
    display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px;
    border: 0; border-bottom: 1px solid #F1F1F1; border-radius: 0; padding: 12px 0; text-align: left;
  }
  #bys-capa .bys-foto { grid-row: 1 / span 2; width: 84px; height: 84px; background: #FAFAFA; border-radius: 10px; }
  #bys-capa .bys-foto img { width: 84px; height: 84px; }
  #bys-capa .bys-insignias { top: 3px; left: 3px; max-width: calc(100% - 6px); gap: 3px; }
  #bys-capa .bys-ins { font-size: 8.5px; padding: 1px 5px; }
  #bys-capa .bys-ins.promo { padding: 0 5px; border-width: 1.2px; }
  #bys-capa .bys-precio { flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap; }
  #bys-capa .bys-accion { grid-column: 2; }
  #bys-capa .bys-boton { font-size: 14px; min-height: 30px; padding: 2px 12px; }

  #bys-capa .bys-sin { flex-direction: column; gap: 20px; }
  #bys-capa .bys-sin h2 { font-size: 18px; }
  #bys-capa .bys-wa { width: 100%; }
  #bys-capa .bys-aviso { bottom: 20px; font-size: 13px; }
}
