/* PSAMZ Search - desplegable de búsqueda instantánea */
.psamz-search-panel {
  --c: var(--psamz-search-color, #2563eb);
  position: fixed;
  z-index: 2147483000;
  overflow-y: auto;
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
}
.psamz-search-panel[hidden] { display: none; }
.psamz-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #777;
}
.psamz-notice, .psamz-empty { padding: 10px 14px; color: #555; }
.psamz-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.psamz-item:hover, .psamz-item.psamz-active { background: color-mix(in srgb, var(--c) 10%, #fff); color: inherit; text-decoration: none; }
.psamz-img { flex: 0 0 48px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.psamz-img img { max-width: 100%; max-height: 100%; }
.psamz-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.psamz-name { overflow: hidden; text-overflow: ellipsis; }
.psamz-product .psamz-name { white-space: normal; }
.psamz-cat { font-size: 12px; color: #888; }
.psamz-price { flex: 0 0 auto; font-weight: 700; color: var(--c); white-space: nowrap; }
.psamz-price s { font-weight: 400; color: #999; margin-right: 4px; }
.psamz-name mark { background: transparent; color: var(--c); font-weight: 700; padding: 0; }
.psamz-all { justify-content: center; font-weight: 700; color: var(--c); border-top: 1px solid #eee; }
.psamz-popular::before { content: "\2197"; color: #999; }

.psamz-oos { font-size: 11px; font-weight: 700; color: #b42318; text-transform: uppercase; letter-spacing: .04em; }
.psamz-is-oos .psamz-img img, .psamz-is-oos .psamz-name { opacity: .55; }
.psamz-clear { float: right; border: 0; background: none; padding: 0; font-size: 11px; color: var(--psamz-search-color, #2563eb); cursor: pointer; text-transform: none; letter-spacing: 0; }
.psamz-item.psamz-last::before { content: "\21BA"; color: #999; }

/* ------------------------------------------------------------------ capa a pantalla completa (estilo Doofinder / EcommFinder) */
html.psamz-noscroll, html.psamz-noscroll body { overflow: hidden; }

.psamz-layer {
  --c: var(--psamz-search-color, #2563eb);
  --psamz-text: #272727;
  --psamz-muted: #767575;
  --psamz-line: #e5e5e5;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: var(--psamz-text);
  text-align: left;
}
.psamz-layer[hidden] { display: none; }
.psamz-layer *, .psamz-layer *::before, .psamz-layer *::after { box-sizing: border-box; }
.psamz-layer button, .psamz-layer input { font-family: inherit; text-transform: none; letter-spacing: normal; }
.psamz-layer a, .psamz-layer a:hover { text-decoration: none; }
.psamz-layer h1, .psamz-layer h2, .psamz-layer p { margin: 0; }
.psamz-layer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

.psamz-layer__box {
  position: absolute;
  top: 50px; right: 50px; bottom: 50px; left: 50px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 21px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* cabecera */
.psamz-layer__header { display: flex; align-items: center; flex: 0 0 auto; border-bottom: 1px solid #d3d3d3; }
.psamz-layer__logo { flex: 0 0 auto; margin-left: 42px; }
.psamz-layer__logo img { display: block; max-height: 48px; max-width: 220px; width: auto; height: auto; }
.psamz-layer__bar { position: relative; flex: 1 1 auto; margin: 24px 24px 24px 42px; min-width: 0; }
.psamz-layer__bar .psamz-glass { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--psamz-muted); pointer-events: none; }
.psamz-layer__input {
  display: block;
  width: 100%;
  height: 45px;
  margin: 0;
  padding: 8px 52px 8px 58px;
  font: inherit;
  font-size: 16px;
  color: var(--psamz-text);
  background: #f5f5f5;
  border: 0;
  border-radius: 100px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.psamz-layer__input::-webkit-search-cancel-button { display: none; }
.psamz-layer__input:focus { outline: 0; box-shadow: 0 0 0 2px var(--c); }
.psamz-layer__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--psamz-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.psamz-layer__clear[hidden] { display: none; }
.psamz-layer__clear:hover { background: rgba(0, 0, 0, .06); }
.psamz-layer__close {
  flex: 0 0 auto; margin-right: 30px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--psamz-text); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.psamz-layer__close:hover { background: #f0f0f0; }

/* cuerpo: filtros | resultados */
.psamz-layer__body { position: relative; display: flex; flex: 1 1 auto; min-height: 0; padding: 0 33px; }
.psamz-layer__filters {
  flex: 0 0 300px; width: 300px; max-height: 100%; overflow-y: auto; padding: 15px 15px 15px 9px;
  scrollbar-width: thin; scrollbar-color: #c2c2c2 transparent;
}
.psamz-layer__filters[hidden] { display: none; }
.psamz-layer__main { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.psamz-layer__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c2c2c2 transparent; padding-bottom: 24px; }
.psamz-layer__filterbtn { display: none; }
.psamz-layer__drawer-backdrop { display: none; }
.psamz-layer--loading .psamz-layer__grid { opacity: .55; transition: opacity .15s; }

.psamz-layer__title, .psamz-layer__heading { margin: 15px 9px 4px; font-size: 16px; line-height: normal; display: flex; align-items: baseline; gap: 6px 8px; }
.psamz-layer__heading { justify-content: space-between; }
.psamz-layer__title[hidden], .psamz-layer__last[hidden], .psamz-layer__notice[hidden], .psamz-layer__more[hidden] { display: none; }
.psamz-count { color: var(--psamz-muted); font-weight: 400; }
.psamz-layer__notice { margin: 15px 9px 0; padding: 12px 16px; border-radius: 12px; background: #f5f5f5; }
.psamz-layer__notice--error { background: #fdecea; color: #b42318; }
.psamz-layer__try { margin: 8px 0 8px; color: var(--psamz-muted); }

/* facetas */
.psamz-facet { margin: 0 0 32px; }
.psamz-facet__key { margin-bottom: 8px; font-size: 16px; font-weight: 700; line-height: normal; }
.psamz-facet__value { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 6px; padding: 2px 0; line-height: 1.25; cursor: pointer; }
.psamz-facet__name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.psamz-facet__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psamz-facet__check { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--c); cursor: pointer; }
.psamz-facet__value.is-selected .psamz-facet__name span { font-weight: 700; }
.psamz-facet__count { flex: 0 0 auto; color: #b8b8b8; font-size: 13px; }
.psamz-layer .psamz-facet__more, .psamz-layer .psamz-facets__clear { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--psamz-text); text-decoration: underline; cursor: pointer; }
.psamz-facets__clear { margin: 0 0 18px; font-weight: 700; }
.psamz-facets__apply { display: none; }

/* términos (populares / últimas búsquedas) */
.psamz-terms { display: flex; flex-wrap: wrap; gap: 8px; }
.psamz-term {
  display: inline-block; max-width: 100%; padding: 7px 14px; border: 1px solid var(--psamz-line); border-radius: 100px;
  background: #fff; color: var(--psamz-text); font-size: 14px; line-height: 1.2; cursor: pointer; text-align: left;
}
.psamz-term:hover { border-color: var(--c); }
.psamz-layer a.psamz-term { text-decoration: none; color: var(--psamz-text); }
.psamz-facet .psamz-terms { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
.psamz-last { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 9px 0; }
.psamz-last__item { display: inline-flex; align-items: center; border: 1px solid var(--psamz-line); border-radius: 100px; background: #fff; }
.psamz-last__item .psamz-term { border: 0; padding-right: 6px; }
.psamz-last__del { width: 28px; height: 28px; margin-right: 4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--psamz-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.psamz-last__del svg { width: 11px; height: 11px; }
.psamz-last__del:hover { background: #f0f0f0; }
.psamz-last__clear { border: 0; background: none; padding: 0; font-size: 13px; color: var(--psamz-text); text-decoration: underline; cursor: pointer; }

/* cuadrícula y tarjetas */
.psamz-layer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-items: stretch;
  align-content: flex-start;
  gap: 18px;
  padding: 9px 9px 18px;
}
.psamz-card {
  position: relative; display: flex; flex-direction: column; padding: 15px 13px; background: #fff;
  border: 2px solid var(--psamz-line); border-radius: 13px; transition: border-color .15s;
}
.psamz-card:hover { border-color: var(--c); }
.psamz-card__link { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; text-decoration: none; }
.psamz-card__link:hover, .psamz-card__link:focus { color: inherit; text-decoration: none; }
.psamz-card__img { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 160px; margin: 0 auto 12px; }
.psamz-card__img img { display: block; max-width: 100%; max-height: 250px; width: auto; height: auto; object-fit: contain; }
.psamz-card__name { font-size: 16px; line-height: 1.3; color: var(--psamz-text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.psamz-card__name mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }
.psamz-card__oos { margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b42318; }
.psamz-card.is-oos .psamz-card__img img, .psamz-card.is-oos .psamz-card__name { opacity: .55; }
.psamz-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; padding: 5px 11px; border-radius: 100px;
  background: var(--c); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.1;
}
.psamz-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; margin-top: 14px; }
.psamz-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 16px; }
.psamz-card__now { font-weight: 700; }
.psamz-card__price s { color: #9a9a9a; font-weight: 400; }
.psamz-card__cart {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 45px; padding: 0;
  border: 1px solid var(--psamz-text); border-radius: 23px; background: #fff; color: #1e1e1e; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.psamz-card__cart--view { width: auto; padding: 0 16px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.psamz-card__cart:hover { background: var(--c); border-color: var(--c); color: #fff; }
.psamz-card__cart.is-busy { opacity: .5; pointer-events: none; }
.psamz-card__cart.is-done { background: var(--c); border-color: var(--c); color: #fff; }
.psamz-layer__more { display: flex; justify-content: center; padding: 8px 0 16px; }
.psamz-layer__morebtn { padding: 10px 24px; border: 1px solid var(--psamz-text); border-radius: 100px; background: #fff; cursor: pointer; font-size: 14px; }
.psamz-layer__sentinel { height: 1px; }

/* carrusel de recomendados (estado inicial), como el de EcommFinder */
.psamz-layer__gridwrap { position: relative; }
.psamz-layer__gridwrap.is-carousel .psamz-layer__grid {
  display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth; cursor: grab; user-select: none;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 0; margin-bottom: 18px;
}
.psamz-layer__gridwrap.is-carousel .psamz-layer__grid::-webkit-scrollbar { display: none; }
.psamz-layer__gridwrap.is-carousel .psamz-card { flex: 0 0 250px; width: 250px; }
.psamz-layer__gridwrap.is-carousel .psamz-card img { -webkit-user-drag: none; user-drag: none; }
.psamz-layer__gridwrap.is-dragging .psamz-layer__grid { cursor: grabbing; scroll-behavior: auto; }
.psamz-layer__gridwrap.is-dragging a, .psamz-layer__gridwrap.is-dragging button { pointer-events: none; }
.psamz-carousel__btn {
  position: absolute; top: 50%; z-index: 10; transform: translateY(-50%); width: 38px; height: 38px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: #fff;
  color: var(--psamz-text); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); cursor: pointer;
}
.psamz-carousel__btn[hidden] { display: none; }
.psamz-carousel__btn:disabled { opacity: .35; cursor: default; }
.psamz-carousel__btn--prev { left: 4px; }
.psamz-carousel__btn--next { right: 0; }
/* en la vista inicial de escritorio la caja se ajusta a su contenido */
@media (min-width: 1200px) {
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__box { bottom: auto; max-height: calc(100% - 100px); }
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__filters, .psamz-layer:not(.psamz-layer--results) .psamz-layer__scroll { max-height: none; }
}

/* tablet / móvil: pantalla completa, filtros en cajón */
@media (max-width: 1199px) {
  .psamz-layer__box { inset: 0; border-radius: 0; box-shadow: none; }
  .psamz-layer__body { padding: 0; }
  .psamz-layer__logo { margin-left: 15px; }
  .psamz-layer__bar { margin: 14px 8px 14px 15px; }
  .psamz-layer__close { margin-right: 10px; }
  .psamz-layer__filterbtn {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 10px 15px 0; padding: 8px 16px;
    border: 1px solid var(--psamz-text); border-radius: 100px; background: #fff; color: var(--psamz-text); font-size: 14px; cursor: pointer;
  }
  .psamz-layer__filterbtn[hidden] { display: none; }
  .psamz-layer__filters {
    position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: min(88%, 340px); max-width: none; flex: none; max-height: none;
    padding: 18px 18px 90px; background: #fff; box-shadow: 8px 0 30px rgba(0, 0, 0, .2); transform: translateX(-105%); transition: transform .22s ease;
    visibility: hidden;
  }
  .psamz-layer__filters[hidden] { display: none; }
  .psamz-layer--drawer .psamz-layer__filters { transform: none; visibility: visible; }
  .psamz-layer--drawer .psamz-layer__drawer-backdrop { display: block; position: absolute; z-index: 2; inset: 0; background: rgba(0, 0, 0, .45); }
  /* en el estado inicial (populares) la columna sí se muestra en línea */
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__filters { position: static; transform: none; visibility: visible; width: auto; flex: none; box-shadow: none; padding: 12px 15px 0; overflow: visible; }
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__body { flex-direction: column; overflow-y: auto; }
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__main { flex: none; }
  .psamz-layer:not(.psamz-layer--results) .psamz-layer__scroll { overflow: visible; }
  .psamz-facets__apply {
    display: block; position: fixed; left: 0; bottom: 0; width: min(88%, 340px); padding: 14px; border: 0; background: var(--c); color: #fff;
    font-size: 15px; font-weight: 700; cursor: pointer;
  }
  .psamz-layer:not(.psamz-layer--results) .psamz-facets__apply { display: none; }
  .psamz-layer:not(.psamz-layer--results) .psamz-facet { margin-bottom: 8px; }
  .psamz-layer:not(.psamz-layer--results) .psamz-facet .psamz-terms { flex-direction: row; flex-wrap: wrap; }
  .psamz-layer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 9px 12px 18px; }
  .psamz-layer__gridwrap.is-carousel .psamz-layer__grid { gap: 12px; }
  .psamz-layer__gridwrap.is-carousel .psamz-card { flex-basis: 190px; width: 190px; }
  .psamz-layer__title, .psamz-layer__heading { margin-left: 15px; margin-right: 15px; }
  .psamz-layer__notice { margin-left: 15px; margin-right: 15px; }
  .psamz-last { margin-left: 15px; margin-right: 15px; }
  .psamz-card { padding: 10px 9px; border-radius: 11px; }
  .psamz-card__name { font-size: 14px; -webkit-line-clamp: 3; }
  .psamz-card__price { font-size: 14px; }
  .psamz-card__cart { width: 44px; height: 38px; border-radius: 19px; }
}
@media (min-width: 600px) and (max-width: 1199px) { .psamz-layer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .psamz-layer__gridwrap.is-carousel .psamz-card { flex-basis: 230px; width: 230px; } }
@media (max-width: 767px) { .psamz-layer__logo { display: none; } .psamz-carousel__btn { display: none !important; } }
@media (max-width: 1199px) and (min-height: 1px) { .psamz-layer__bar { margin-left: 15px; } }

/* filtro de precio (mín – máx) */
.psamz-range { padding: 4px 4px 0; }
.psamz-range__track { position: relative; height: 28px; margin: 0 8px; }
.psamz-range__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: #e5e5e5; }
.psamz-range__fill { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--c, #2563eb); }
.psamz-range__slider { position: absolute; left: -8px; top: 0; width: calc(100% + 16px); height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.psamz-range__slider::-webkit-slider-runnable-track { background: none; height: 28px; }
.psamz-range__slider::-moz-range-track { background: none; height: 28px; }
.psamz-range__slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: #fff; border: 2px solid var(--c, #2563eb); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.psamz-range__slider::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--c, #2563eb); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.psamz-range__slider:active::-webkit-slider-thumb { cursor: grabbing; }
.psamz-range__nums { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.psamz-range__num { width: 100%; min-width: 0; box-sizing: border-box; height: 40px; padding: 0 10px; border: 2px solid #e5e5e5; border-radius: 10px; font: inherit; font-size: 14px; background: #fff; color: inherit; }
.psamz-range__num:focus { outline: none; border-color: currentColor; }
.psamz-range__sep, .psamz-range__unit { color: #b8b8b8; }
