/* Widget del asistente con los colores del tema hijo "sandoit" */
.sandoit-asistente {
  --sa-brand: var(--sandoit-brand, #8b5a33);
  --sa-cream: var(--sandoit-cream, #f8f3ec);
  --sa-border: var(--sandoit-cream-border, #e8d9c6);
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
}

.sandoit-asistente__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--sa-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 42, 30, 0.3);
  cursor: pointer;
}

.sandoit-asistente__toggle .material-icons {
  font-size: 1.75rem;
}

.sandoit-asistente.is-open .sandoit-asistente__toggle {
  display: none;
}

.sandoit-asistente__panel {
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 2rem));
  height: min(32rem, calc(100vh - 6rem));
  background: #fff;
  border: 1px solid var(--sa-border);
  border-radius: var(--bs-border-radius-lg, 0.5rem);
  box-shadow: 0 10px 30px rgba(59, 42, 30, 0.25);
  overflow: hidden;
}

.sandoit-asistente__panel[hidden] {
  display: none;
}

.sandoit-asistente__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--sa-brand);
  color: #fff;
}

.sandoit-asistente__close {
  display: flex;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}

.sandoit-asistente__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--sa-cream);
}

.sandoit-asistente__msg {
  max-width: 88%;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.sandoit-asistente__msg p {
  margin: 0;
  white-space: pre-line;
}

.sandoit-asistente__msg--bot {
  background: #fff;
  border: 1px solid var(--sa-border);
}

.sandoit-asistente__msg--user {
  margin-left: auto;
  background: var(--sa-brand);
  color: #fff;
}

.sandoit-asistente__msg.is-thinking {
  font-style: italic;
  opacity: 0.7;
}

.sandoit-asistente__products {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sandoit-asistente__product {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem;
  border: 1px solid var(--sa-border);
  border-radius: 0.5rem;
  color: inherit;
  text-decoration: none;
  background: var(--sa-cream);
}

.sandoit-asistente__product img {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 0.35rem;
}

.sandoit-asistente__product-name {
  display: block;
  font-size: 0.8rem;
  line-height: 1.2;
}

.sandoit-asistente__product-price {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sa-brand);
}

.sandoit-asistente__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}

.sandoit-asistente__chip {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--sa-brand);
  border-radius: 1rem;
  background: #fff;
  color: var(--sa-brand);
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}

.sandoit-asistente__chip:hover,
.sandoit-asistente__chip:focus-visible {
  background: var(--sa-brand);
  color: #fff;
}

.sandoit-asistente__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem;
  border-top: 1px solid var(--sa-border);
}

.sandoit-asistente__form .btn {
  display: flex;
  align-items: center;
  padding-inline: 0.6rem;
}

.sandoit-asistente__notice {
  margin: 0;
  padding: 0 0.6rem 0.5rem;
  font-size: 0.7rem;
  color: #6c5a4c;
}

.sandoit-asistente__notice a {
  color: var(--sa-brand);
}

/* Cabecera: frase + botón "Dame ideas" a la izquierda del buscador. El bloque ocupa todo el hueco
   libre alineado a la derecha, así el margen automático del buscador (ms-auto) se queda en 0 y los
   dos van juntos. */
.sandoit-ideas-header {
  order: 2; /* como el buscador, que va justo detrás */
  flex: 1 1 auto;
  width: auto; /* Bootstrap da width: 100% a los hijos de .row */
  justify-content: flex-end;
  gap: 0.75rem;
}

.sandoit-ideas-header__text {
  color: var(--sandoit-brand-dark, #6e4526);
  font-weight: 600;
  white-space: nowrap;
}

.sandoit-ideas-header__button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.sandoit-ideas-header__button .material-icons {
  font-size: 1.15rem;
}

/* Móvil: solo el icono, redondo, antes de la lupa, la cuenta y el carrito (el logo ya empuja a la derecha) */
@media (max-width: 767.98px) {
  .sandoit-ideas-header {
    order: 0;
  }

  .sandoit-ideas-header__button {
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
  }
}
