/**
 * athsearch - barra de cabecera + modal de búsqueda.
 * Prefijo .ath-. Usa las variables de Bootstrap 5 / Hummingbird con valores de respaldo.
 */

.ath-bar,
.ath-modal {
  --ath-primary: var(--bs-primary, #e22018);
  --ath-primary-contrast: #fff;
  --ath-primary-soft: rgba(226, 32, 24, .08);
  --ath-text: #1d1d1f;
  --ath-muted: #6b7280;
  --ath-border: #e3e5e8;
  --ath-bg: #fff;
  --ath-bg-soft: #f4f5f7;
  --ath-radius: var(--bs-border-radius, 8px);
  --ath-font: var(--bs-body-font-family, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --ath-focus: 0 0 0 3px rgba(226, 32, 24, .25);
  font-family: var(--ath-font);
  color: var(--ath-text);
}

.ath-bar [hidden],
.ath-modal [hidden],
.ath-modal[hidden] {
  display: none !important;
}

.ath-bar .visually-hidden,
.ath-modal .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =====================================================================
   Barra de cabecera (widget CE "ps-widget-module", _flex_size: grow)
   ===================================================================== */
.elementor-widget-ps-widget-module > .elementor-widget-container:has(> .ath-bar) {
  width: 100%;
}

.ath-bar {
  width: 100%;
  min-width: 0;
}

.ath-bar__form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  margin: 0;
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}

.ath-bar__form:hover {
  border-color: #c9ccd1;
}

.ath-bar__form:focus-within {
  border-color: var(--ath-primary);
  box-shadow: var(--ath-focus);
}

.ath-bar__icon {
  flex: 0 0 auto;
  margin-left: 16px;
  color: var(--ath-muted);
}

.ath-bar__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--ath-text);
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
}

.ath-bar__input::placeholder {
  color: var(--ath-muted);
  opacity: 1;
}

.ath-bar__input::-webkit-search-cancel-button,
.ath-modal .ath-form__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

.ath-bar__kbd {
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 2px 7px;
  font: 600 11px/1.6 var(--ath-font);
  color: var(--ath-muted);
  background: var(--ath-bg-soft);
  border: 1px solid var(--ath-border);
  border-radius: 6px;
  box-shadow: none;
  white-space: nowrap;
}

.ath-bar__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  margin: 0;
  padding: 0 20px;
  font: 600 14px/1 var(--ath-font);
  color: var(--ath-primary-contrast);
  background: var(--ath-primary);
  border: 0;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
  transition: filter .15s ease;
}

.ath-bar__submit:hover,
.ath-bar__submit:focus-visible {
  filter: brightness(.92);
}

.ath-bar__submit-icon {
  display: none;
}

@media (max-width: 767.98px) {
  .ath-bar__form {
    height: 42px;
  }
  .ath-bar__kbd,
  .ath-bar__submit-text {
    display: none;
  }
  .ath-bar__submit {
    padding: 0 14px;
  }
  .ath-bar__submit-icon {
    display: block;
  }
  .ath-bar__icon {
    display: none;
  }
  .ath-bar__input {
    padding-left: 16px;
    font-size: 16px; /* evita el zoom de iOS */
  }
}

@media (hover: none) {
  .ath-bar__kbd {
    display: none;
  }
}

/* =====================================================================
   Bloqueo de scroll de la página con el modal abierto
   ===================================================================== */
html.ath-lock,
html.ath-lock body {
  overflow: hidden !important;
}

html.ath-lock body {
  padding-right: var(--ath-sbw, 0);
}

/* =====================================================================
   Modal (z-index 1040: el modal del carrito de ps_shoppingcart, 1050+, queda encima)
   ===================================================================== */
.ath-modal {
  position: fixed;
  inset: 0;
  z-index: 1040;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.ath-modal *,
.ath-modal *::before,
.ath-modal *::after {
  box-sizing: border-box;
}

.ath-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 20, .55);
  opacity: 0;
  transition: opacity .2s ease;
}

.ath-modal__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 1440px;
  height: 100%;
  background: var(--ath-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .2s ease, transform .2s ease;
  overflow: hidden;
}

.ath-modal.is-open .ath-modal__backdrop {
  opacity: 1;
}

.ath-modal.is-open .ath-modal__dialog {
  opacity: 1;
  transform: none;
}

@media (min-width: 992px) {
  .ath-modal {
    padding: 16px;
  }
  .ath-modal__dialog {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ath-modal__backdrop,
  .ath-modal__dialog,
  .ath-filters {
    transition: none !important;
  }
}

/* ---------- cabecera del modal ---------- */
.ath-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ath-border);
  background: var(--ath-bg);
}

.ath-form {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 56px;
  margin: 0;
  background: var(--ath-bg-soft);
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color .15s ease, background-color .15s ease;
}

.ath-form:focus-within {
  background: var(--ath-bg);
  border-color: var(--ath-primary);
}

.ath-form__icon {
  display: inline-flex;
  margin: 0 4px 0 16px;
  color: var(--ath-muted);
}

.ath-form__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 8px;
  font: 500 20px/1.2 var(--ath-font);
  color: var(--ath-text);
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.ath-form__input::placeholder {
  color: #9aa0a8;
  font-weight: 400;
  opacity: 1;
}

.ath-form__spinner {
  display: none;
  width: 20px;
  height: 20px;
  margin: 0 8px;
  border: 2px solid var(--ath-border);
  border-top-color: var(--ath-primary);
  border-radius: 50%;
  animation: ath-spin .7s linear infinite;
}

.ath-form.is-loading .ath-form__spinner {
  display: block;
}

@keyframes ath-spin {
  to { transform: rotate(360deg); }
}

.ath-form__clear,
.ath-modal__close,
.ath-filters__close,
.ath-recent__remove,
.ath-chip__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: var(--ath-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.ath-form__clear {
  width: 36px;
  height: 36px;
  margin-right: 4px;
  border-radius: 50%;
}

.ath-form__clear:hover {
  color: var(--ath-text);
  background: rgba(0, 0, 0, .06);
}

.ath-form__submit {
  height: 40px;
  margin-right: 8px;
  padding: 0 20px;
  font: 600 15px/1 var(--ath-font);
  color: var(--ath-primary-contrast);
  background: var(--ath-primary);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.ath-form__submit:hover,
.ath-form__submit:focus-visible {
  filter: brightness(.92);
}

.ath-modal__close {
  flex: 0 0 auto;
  gap: 6px;
  height: 44px;
  padding: 0 10px;
  border-radius: 10px;
}

.ath-modal__close:hover {
  color: var(--ath-text);
  background: var(--ath-bg-soft);
}

.ath-modal__esc {
  padding: 1px 6px;
  font: 600 11px/1.6 var(--ath-font);
  color: var(--ath-muted);
  background: var(--ath-bg-soft);
  border: 1px solid var(--ath-border);
  border-radius: 6px;
  box-shadow: none;
}

.ath-modal button:focus-visible,
.ath-modal a:focus-visible,
.ath-modal select:focus-visible,
.ath-modal input[type="checkbox"]:focus-visible,
.ath-modal input[type="number"]:focus-visible {
  outline: 0;
  box-shadow: var(--ath-focus);
}

/* ---------- cuerpo ---------- */
.ath-modal__body {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Solo hay scroll dentro de la zona central (resultados) y del panel de filtros. */
.ath-home,
.ath-scroll,
.ath-filters {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ath-home {
  height: 100%;
}

.ath-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 24px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--ath-bg);
  border-top: 1px solid var(--ath-border);
}

.ath-foot__range {
  flex: 1 1 0;
  margin: 0;
  font-size: 13px;
  color: var(--ath-muted);
  white-space: nowrap;
}

.ath-foot__all {
  flex: 1 1 0;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.ath-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ath-pager__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ath-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  margin: 0;
  padding: 0 8px;
  font: 600 14px/1 var(--ath-font);
  color: var(--ath-text);
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: 8px;
  cursor: pointer;
}

.ath-pager__btn:hover:not(:disabled) {
  border-color: var(--ath-text);
}

.ath-pager__btn.is-current {
  color: var(--ath-primary-contrast);
  background: var(--ath-primary);
  border-color: var(--ath-primary);
  cursor: default;
}

.ath-pager__btn:disabled {
  cursor: default;
  opacity: .4;
}

.ath-pager__prev svg {
  transform: rotate(180deg);
}

.ath-pager__gap {
  min-width: 20px;
  color: var(--ath-muted);
  text-align: center;
}

.ath-pager__compact {
  display: none;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.ath-section-title,
.ath-suggest__title,
.ath-facet__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 0;
  font: 700 12px/1.3 var(--ath-font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ath-muted);
}

.ath-link-btn {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ath-primary);
  text-transform: none;
  letter-spacing: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.ath-link-btn:hover {
  text-decoration: underline;
}

.ath-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  font: 600 14px/1 var(--ath-font);
  color: var(--ath-text);
  text-decoration: none;
  white-space: nowrap;
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: var(--ath-radius);
  cursor: pointer;
}

.ath-btn:hover {
  color: var(--ath-text);
  border-color: #c4c8ce;
  text-decoration: none;
}

.ath-btn--primary,
.ath-btn--primary:hover {
  color: var(--ath-primary-contrast);
  background: var(--ath-primary);
  border-color: var(--ath-primary);
}

.ath-btn--ghost {
  color: var(--ath-primary);
  border-color: transparent;
  background: var(--ath-primary-soft);
}

.ath-btn--ghost:hover {
  color: var(--ath-primary);
  border-color: transparent;
}

.ath-btn--sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.ath-btn--block {
  width: 100%;
}

.ath-badge {
  min-width: 20px;
  padding: 2px 6px;
  font: 700 11px/1.3 var(--ath-font);
  color: var(--ath-primary-contrast);
  text-align: center;
  background: var(--ath-primary);
  border-radius: 999px;
}

.ath-notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #6b4e00;
  background: #fff7e0;
  border: 1px solid #f3dd9b;
  border-radius: var(--ath-radius);
}

/* ---------- estado inicial ---------- */
.ath-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px;
}

.ath-recent__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ath-recent__row {
  display: flex;
  align-items: center;
  border-radius: var(--ath-radius);
}

.ath-recent__row:hover {
  background: var(--ath-bg-soft);
}

.ath-recent__item {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  color: var(--ath-text);
  text-decoration: none;
  border-radius: var(--ath-radius);
}

.ath-recent__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ath-recent__item svg {
  flex: 0 0 auto;
  color: var(--ath-muted);
}

.ath-recent__item:hover,
.ath-recent__item.is-active {
  color: var(--ath-text);
  text-decoration: none;
  background: var(--ath-bg-soft);
}

.ath-recent__remove {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border-radius: 50%;
}

.ath-recent__remove:hover {
  color: var(--ath-text);
  background: rgba(0, 0, 0, .06);
}

.ath-hints__title {
  margin: 0 0 10px;
  font-weight: 700;
}

.ath-hints__list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--ath-muted);
}

.ath-hints__list li {
  margin-bottom: 6px;
}

/* ---------- maquetación de resultados ---------- */
.ath-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 32px;
  height: 100%;
  padding: 0 0 0 24px;
}

.ath-modal--nofilters .ath-layout {
  grid-template-columns: minmax(0, 1fr);
}

.ath-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.ath-main__top .ath-toolbar {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 24px 12px 0;
  border-bottom: 1px solid var(--ath-border);
}

.ath-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 24px 32px 2px;
}

/* Filtros: barra lateral en escritorio, offcanvas en móvil */
.ath-filters {
  min-height: 0;
  padding: 18px 4px 24px 0;
  outline: 0;
}

.ath-filters__head,
.ath-filters__foot,
.ath-filters-backdrop {
  display: none;
}

.ath-filters__title {
  margin: 0;
  font: 700 18px/1.2 var(--ath-font);
}

.ath-facet {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.ath-facet__title {
  float: none;
  width: 100%;
  margin-bottom: 8px;
}

.ath-facet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ath-facet__item--extra {
  display: none;
}

.ath-facet.is-expanded .ath-facet__item--extra {
  display: block;
}

/* Facetas de características / atributos (plegables) */
.ath-facet__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.ath-facet__toggle > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ath-facet__toggle svg {
  flex: 0 0 auto;
  transform: rotate(90deg);
  transition: transform .15s ease;
}

.ath-facet.is-collapsed .ath-facet__toggle svg {
  transform: none;
}

.ath-facet.is-collapsed .ath-facet__content {
  display: none;
}

.ath-facet__toggle .ath-badge {
  letter-spacing: 0;
}

/* Árbol de categorías */
.ath-tree,
.ath-tree__children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ath-tree__children {
  display: none;
  margin-left: 11px;
  padding-left: 8px;
  border-left: 1px solid var(--ath-border);
}

.ath-tree__item.is-open > .ath-tree__children {
  display: block;
}

.ath-tree__row {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.ath-tree__row .ath-check {
  flex: 1 1 auto;
  min-width: 0;
}

.ath-tree__toggle,
.ath-tree__spacer {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 4px;
}

.ath-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ath-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.ath-tree__toggle:hover {
  color: var(--ath-text);
  background: rgba(0, 0, 0, .06);
}

.ath-tree__toggle svg {
  transition: transform .15s ease;
}

.ath-tree__item.is-open > .ath-tree__row > .ath-tree__toggle svg {
  transform: rotate(90deg);
}

.ath-tree__item.is-included > .ath-tree__row .ath-check {
  cursor: default;
  opacity: .7;
}

.ath-tree__item.is-included > .ath-tree__row input {
  cursor: default;
}

.ath-facet .ath-link-btn {
  margin-top: 6px;
  font-size: 13px;
}

.ath-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 5px 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
}

.ath-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ath-primary);
  cursor: pointer;
}

.ath-check__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ath-check__count {
  flex: 0 0 auto;
  padding: 0 7px;
  font-size: 12px;
  line-height: 20px;
  color: var(--ath-muted);
  background: var(--ath-bg-soft);
  border-radius: 999px;
}

.ath-price {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.ath-price__field {
  flex: 1 1 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: var(--ath-muted);
}

.ath-price__field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font: 400 14px/1 var(--ath-font);
  color: var(--ath-text);
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: var(--ath-radius);
}

@media (max-width: 991.98px) {
  .ath-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
  }

  .ath-main__top .ath-toolbar {
    padding: 10px 16px;
  }

  .ath-scroll {
    padding: 14px 16px 24px;
  }

  .ath-filters {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: min(88vw, 380px);
    max-height: none;
    background: var(--ath-bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, .2);
    padding: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
    overflow: hidden;
  }

  .ath-filters-open .ath-filters {
    transform: none;
    visibility: visible;
    transition: transform .25s ease, visibility 0s;
  }

  .ath-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ath-border);
  }

  .ath-filters__close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .ath-filters__body {
    flex: 1 1 auto;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ath-filters__foot {
    display: block;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ath-border);
  }

  .ath-filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: rgba(17, 17, 20, .45);
  }

  .ath-filters-open .ath-filters-backdrop {
    display: block;
  }
}

@media (min-width: 992px) {
  .ath-filters-toggle {
    display: none;
  }
}

/* ---------- sugerencias ---------- */
.ath-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--ath-border);
}

.ath-suggest__group {
  flex: 1 1 260px;
  min-width: 0;
}

.ath-suggest__group--refs {
  flex: 2 1 420px;
}

.ath-sref {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ath-sref__item {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: var(--ath-text);
  text-decoration: none;
  border-radius: var(--ath-radius);
}

.ath-sref__item:hover,
.ath-sref__item.is-active {
  color: var(--ath-text);
  text-decoration: none;
  background: var(--ath-bg-soft);
}

.ath-sref__ref {
  font: 700 13px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.ath-sref__name {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ath-sref__brand {
  font-size: 12px;
  color: var(--ath-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.ath-sref__price {
  font-weight: 700;
  white-space: nowrap;
}

.ath-modal mark {
  padding: 0;
  color: inherit;
  background: rgba(226, 32, 24, .14);
  border-radius: 2px;
}

.ath-schips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ath-schip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 6px 12px;
  font: 500 13px/1.3 var(--ath-font);
  color: var(--ath-text);
  text-decoration: none;
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: 999px;
  cursor: pointer;
}

.ath-schip svg {
  flex: 0 0 auto;
  color: var(--ath-muted);
}

.ath-schip:hover,
.ath-schip.is-active {
  color: var(--ath-text);
  text-decoration: none;
  border-color: var(--ath-text);
}

.ath-schip__count {
  font-size: 12px;
  color: var(--ath-muted);
}

/* ---------- barra de herramientas, chips ---------- */
.ath-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 12px;
}

.ath-count {
  margin: 0;
  font-size: 15px;
  color: var(--ath-muted);
}

.ath-count strong {
  color: var(--ath-text);
}

.ath-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ath-sort {
  margin: 0;
}

.ath-sort__select {
  height: 40px;
  max-width: 230px;
  padding: 0 34px 0 12px;
  font: 500 14px/1 var(--ath-font);
  color: var(--ath-text);
  background: var(--ath-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--ath-border);
  border-radius: var(--ath-radius);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.ath-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.ath-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 4px 4px 12px;
  font: 500 13px/1.3 var(--ath-font);
  color: var(--ath-text);
  background: var(--ath-bg-soft);
  border: 1px solid var(--ath-border);
  border-radius: 999px;
}

.ath-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ath-chip--moto {
  padding-left: 10px;
  color: var(--ath-primary);
  background: var(--ath-primary-soft);
  border-color: rgba(226, 32, 24, .35);
}

.ath-chip--nomatch {
  border-style: dashed;
  opacity: .75;
}

.ath-chip--moto > svg {
  flex: 0 0 auto;
}

.ath-chip__x {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: inherit;
  border-radius: 50%;
}

.ath-chip__x:hover {
  background: rgba(0, 0, 0, .08);
}

.ath-chips__note {
  flex: 1 0 100%;
  margin: 0;
  font-size: 13px;
  color: var(--ath-muted);
}

.ath-motos {
  margin: 0 0 16px;
  padding: 10px 12px 12px;
  background: var(--ath-bg-soft);
  border: 1px solid var(--ath-border);
  border-radius: var(--ath-radius);
}

.ath-motos__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font: 700 12px/1.3 var(--ath-font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ath-muted);
}

.ath-motos__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ath-motos__q {
  font-size: 13px;
  font-weight: 600;
}

.ath-motos__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 0;
  padding: 5px 12px;
  font: 500 13px/1.3 var(--ath-font);
  color: var(--ath-text);
  white-space: nowrap;
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: 999px;
  cursor: pointer;
}

.ath-motos__btn:hover,
.ath-motos__btn:focus-visible {
  color: var(--ath-primary);
  border-color: var(--ath-primary);
}

.ath-motos__btn--alt {
  color: var(--ath-primary);
  border-style: dashed;
  border-color: var(--ath-primary);
}

.ath-motos__count {
  color: var(--ath-muted);
}

@media (max-width: 767.98px) {
  /* móvil: una sola fila desplazable */
  .ath-motos__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .ath-motos__list > * {
    flex: 0 0 auto;
  }
}

.ath-dym {
  margin: 0 0 14px;
}

.ath-status {
  margin: 0 0 14px;
  padding: 14px;
  text-align: center;
  background: var(--ath-bg-soft);
  border-radius: var(--ath-radius);
}

.ath-status p {
  margin: 0 0 8px;
}

/* ---------- rejilla ---------- */
.ath-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px 16px;
  transition: opacity .15s ease;
}

.ath-layout.is-loading .ath-grid {
  opacity: .45;
}

@media (max-width: 575.98px) {
  .ath-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
}

.ath-item {
  position: relative;
  min-width: 0;
}

.ath-item__brand {
  margin: 0 0 4px;
  overflow: hidden;
  font: 700 11px/1.4 var(--ath-font);
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ath-muted);
}

.ath-item--theme > .elementor {
  width: 100%;
  max-width: none;
}

/* Tarjeta compacta */
.ath-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--ath-bg);
  border: 1px solid var(--ath-border);
  border-radius: 10px;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.ath-card:hover {
  border-color: #cfd3d8;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .08);
}

.ath-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #fff;
}

.ath-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.ath-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font: 700 12px/1.3 var(--ath-font);
  color: #fff;
  background: var(--ath-primary);
  border-radius: 6px;
}

.ath-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.ath-card__brand {
  margin: 0;
  font: 700 11px/1.4 var(--ath-font);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ath-muted);
}

.ath-card__name {
  margin: 0;
  font: 600 14px/1.35 var(--ath-font);
}

.ath-card__name a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ath-text);
  text-decoration: none;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.ath-card__name a:hover {
  color: var(--ath-primary);
}

.ath-card__ref,
.ath-card__avail {
  margin: 0;
  font-size: 12px;
  color: var(--ath-muted);
}

.ath-card__avail--available,
.ath-card__avail--in_stock {
  color: #1d7a3a;
}

.ath-card__avail--unavailable {
  color: #b42318;
}

.ath-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.ath-card__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.ath-card__price {
  font: 700 17px/1.2 var(--ath-font);
}

.ath-card__regular {
  font-size: 13px;
  color: var(--ath-muted);
}

.ath-card__cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  font: 600 13px/1 var(--ath-font);
  color: var(--ath-primary-contrast);
  background: var(--ath-primary);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.ath-card__cart:disabled {
  cursor: default;
  opacity: .55;
}

.ath-card__msg {
  margin: 4px 0 0;
  font-size: 12px;
  color: #b42318;
}

/* ---------- vacío / cargar más ---------- */
.ath-empty {
  max-width: 640px;
  margin: 24px auto;
  text-align: center;
}

.ath-empty__icon {
  color: #c4c8ce;
}

.ath-empty__title {
  margin: 8px 0 10px;
  font: 700 20px/1.3 var(--ath-font);
}

.ath-empty__text {
  margin: 0 0 14px;
  color: var(--ath-muted);
}

.ath-empty__try {
  margin: 18px 0 6px;
  font-weight: 600;
}

.ath-empty__tips {
  display: inline-block;
  margin: 0 0 18px;
  padding-left: 18px;
  text-align: left;
  color: var(--ath-muted);
}

.ath-empty__sugg,
.ath-empty__recent {
  margin-top: 18px;
  text-align: left;
}

.ath-link {
  font-weight: 600;
  color: var(--ath-primary);
}

/* ---------- móvil ---------- */
@media (max-width: 767.98px) {
  .ath-modal__head {
    gap: 6px;
    padding: 10px 10px 10px 12px;
  }
  .ath-form {
    height: 48px;
    border-radius: 10px;
  }
  .ath-form__icon {
    margin-left: 10px;
  }
  .ath-form__input {
    font-size: 17px;
  }
  .ath-form__submit,
  .ath-modal__esc {
    display: none;
  }
  .ath-home {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 18px 16px;
  }
  .ath-toolbar {
    margin-bottom: 10px;
  }
  .ath-toolbar__actions {
    width: 100%;
  }
  .ath-toolbar__actions .ath-sort {
    flex: 1 1 auto;
  }
  .ath-sort__select {
    width: 100%;
    max-width: none;
  }
  .ath-viewall {
    display: none;
  }
  .ath-sref__item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "ref price" "name name";
    row-gap: 2px;
  }
  .ath-sref__ref { grid-area: ref; }
  .ath-sref__name { grid-area: name; white-space: normal; }
  .ath-sref__price { grid-area: price; }
  .ath-sref__brand { display: none; }
  .ath-suggest {
    gap: 14px;
  }
  .ath-modal__foot {
    padding-left: 12px;
    padding-right: 12px;
    justify-content: center;
  }
  .ath-foot__range,
  .ath-foot__all {
    display: none;
  }
  .ath-pager__pages {
    display: none;
  }
  .ath-pager__compact {
    display: inline;
  }
  .ath-pager__btn {
    min-width: 44px;
    height: 44px;
  }
}

/* ATHENA: cabecera del listado fija; solo hace scroll la rejilla */
.ath-main__top { flex: 0 0 auto; min-height: 0; max-height: 55vh; overflow-y: auto; padding-right: 24px; border-bottom: 1px solid var(--ath-border); }
.ath-main > .ath-scroll { flex: 1 1 auto; min-height: 0; }

/* ATHENA: la plantilla CE 65 (categoría) se usa también en /busqueda; ahí el bloque de categorías raíz no tiene sentido */
body#search .elementor-widget-category-grid { display: none !important; }

/* ATHENA: cabecera de resultados (contador, orden, ver todos) en el pie, junto al paginador */
.ath-modal__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.ath-modal__foot .ath-toolbar { flex: 1 1 auto; margin: 0; padding: 0; border: 0; min-width: 0; }
.ath-modal__foot .ath-pager { flex: 0 0 auto; margin: 0; }
.ath-modal__foot .ath-foot__range, .ath-modal__foot .ath-foot__all { display: none; }
@media (max-width: 767.98px) { .ath-modal__foot .ath-toolbar { flex-basis: 100%; } }

/* ATHENA: "Ver todos los resultados" a la derecha del todo del pie */
.ath-modal__foot .ath-viewall { flex: 0 0 auto; margin-left: auto; order: 10; }

/* ATHENA: pie en 3 columnas: [contador + orden] [paginador centrado] [ver todos a la derecha] */
@media (min-width: 768px) {
  .ath-modal__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 16px; }
  .ath-modal__foot .ath-toolbar { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .ath-modal__foot .ath-toolbar__actions { margin-left: 0; }
  .ath-modal__foot .ath-pager { grid-column: 2; justify-self: center; margin: 0; }
  .ath-modal__foot .ath-viewall { grid-column: 3; justify-self: end; margin-left: 0; order: 0; }
}

/* ATHENA: modal más ancho cuando la pantalla lo permite */
.ath-modal__dialog { max-width: min(1920px, calc(100vw - 32px)); }
@media (max-width: 1200px) { .ath-modal__dialog { max-width: 100vw; } }

/* ATHENA: modal a todo el ancho de la pantalla */
.ath-modal__dialog { max-width: 100vw; width: 100vw; }

/* ATHENA: tarjetas más grandes y de ancho estable (260-320 px), máx. 6 por fila, sin estirarse cuando hay pocos resultados */
@media (min-width: 768px) {
  .ath-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 320px)); justify-content: start; gap: 28px 20px; }
}
.ath-grid .ce-product-image img, .ath-grid .elementor-widget-product-miniature-image img { width: 100%; height: auto; max-width: 100%; }
.ath-grid .ce-product-image { width: 100%; }
