.aa-Item {
  border-bottom: 1px solid #eeeded;
  padding: 6px 4px;
}

.aa-Item a {
  text-decoration: none;
}

.aa-ItemLink {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Panel section */
.aa-PanelSections {
  column-gap: var(--aa-spacing, 8px);
  display: flex;
}

.aa-PanelSection {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  min-width: 0;
}

.aa-PanelSection--left {
  width: 30%;
  overflow-y: auto;
  max-height: 750px;
}

.aa-PanelSection--right {
  width: 70%;
}

.aa-PanelSection h5 {
  font-size: 14px;
  margin: 10px 0 6px 0;
  padding: 0 4px;
}

.aa-PanelSection h5:first-child {
  margin-top: 0;
}

/* Item */
.aa-ItemPicture {
  width: 65%;
  margin-left: 20%;
  border-radius: 3px;
  overflow: hidden;
}

.aa-ItemPicture img {
  object-fit: cover;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.aa-ItemPicture--loaded img {
  opacity: 1;
}

/* Products */
.aa-ItemContentTitle mark,
.aa-ItemContentBrand mark,
.aa-ItemContentTitle em,
.aa-ItemContentBrand em {
  color: #3e73ae;
  background: none;
  font-style: normal;
}

/* Brand */
.aa-ItemContentBrand {
  font-size: 0.7em;
  text-transform: uppercase;
  color: #969696;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

/* Title */
.aa-ItemContentTitle {
  font-weight: bold;
  font-size: 0.9em;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow: hidden;
}

/* Panel */
.aa-Panel {
  position: absolute;
  left: 20%;
  width: 60%;
  z-index: 120;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  max-height: 80vh;
  overflow-y: auto;
  padding: 8px;
}

/* Form */
.aa-Form {
  border: 0px !important;
  height: 38px !important;
  flex-direction: row-reverse;
  display: flex;
  align-items: center;
}

.aa-Form:focus-within {
  border: 2px solid #6584c5 !important;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(101, 132, 197, 0.25);
}

.aa-SubmitIcon {
  color: #618eba !important;
}

.aa-SubmitButton {
  border-left: 1px solid #cccbda;
  background: none;
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

.aa-InputWrapper {
  padding-left: 10px;
  flex: 1;
}

.aa-InputWrapperPrefix {
  padding: 5px 1px 0px 0px;
}

.aa-Input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  height: 34px;
}

.aa-Input::placeholder {
  font-size: .9em;
  color: #999;
}

.aa-Autocomplete {
  z-index: 100 !important;
  position: relative !important;
}

/* Navbar encima del blanket overlay (z-index:99) */
nav.navbar:has(#buscador_global) {
  position: relative;
  z-index: 110;
}

/* ── Mobile product card ── */
.aa-ItemMobile {
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.aa-ItemMobile .aa-ItemLink {
  padding: 8px;
}

.aa-ItemMobilePicture {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.aa-ItemMobilePicture img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.aa-ItemPicture--loaded img,
.aa-ItemMobilePicture.aa-ItemPicture--loaded img {
  opacity: 1;
}

.aa-MobileGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0;
}

/* ── Media queries ── */
@media screen and (max-width: 680px) {

  .aa-Panel {
    left: 0 !important;
    width: 100% !important;
    z-index: 120;
    border-radius: 0;
    border: none;
    padding: 8px 12px 12px 12px;
    box-shadow: none;
    max-height: 80vh;
  }

  .aa-Panel h5 {
    font-size: 15px;
    margin: 14px 0 8px 0;
  }

  .aa-Panel h5:first-child {
    margin-top: 4px;
  }

  .aa-ItemContentTitle {
    -webkit-line-clamp: 3 !important;
    font-size: 0.82em;
  }

  .aa-ItemContentBrand {
    font-size: 0.65em;
  }

  /* Mobile: placeholder button (visible by default) */
  .aa-MobilePlaceholder {
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 12px;
    color: #999;
    font-size: 14px;
    cursor: text;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    gap: 8px;
  }

  .aa-MobilePlaceholder svg {
    flex-shrink: 0;
    color: #618eba;
  }

  /* Mobile: placeholder visible, real form hidden until open */
  #autocompleteMovil_1 .aa-Autocomplete {
    display: none;
  }

  #autocompleteMovil_1 .aa-Autocomplete.aa-open {
    display: flex;
    align-items: center;
    width: 100%;
  }

  #autocompleteMovil_1 .aa-Autocomplete.aa-open .aa-Form {
    flex: 1;
    height: 36px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px;
    background: #fff;
  }

  #autocompleteMovil_1 .aa-Autocomplete.aa-open + .aa-MobilePlaceholder {
    display: none;
  }

  #autocompleteMovil_1 .aa-SubmitButton {
    border-left: 0;
    padding: 4px 12px;
  }

  #autocompleteMovil_1 .aa-SubmitButton::before {
    content: 'Buscar';
    color: #0f4d83;
    font-weight: 600;
    font-size: 14px;
  }

  #autocompleteMovil_1 .aa-SubmitButton .aa-SubmitIcon {
    display: none;
  }

  #autocompleteMovil_1 .aa-InputWrapper {
    padding-left: 8px;
    background: transparent;
  }

  /* Back button */
  .aa-BackButton {
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    line-height: 1;
    flex-shrink: 0;
  }

  /* Hide on desktop */
  .aa-BackButton,
  .aa-MobilePlaceholder {
    display: none;
  }

  #autocompleteMovil_1 .aa-BackButton {
    display: block;
  }

  #autocompleteMovil_1 .aa-MobilePlaceholder {
    display: flex;
  }
}

.disable-btn-cart-algolia {
  opacity: .5;
  cursor: not-allowed;
}

.btn-stock-searcher {
  pointer-events: none;
}

/* Loader */
.loader-res {
  position: relative;
  width: 100px;
  height: 16px;
}

.loader-res:before, .loader-res:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgb(178, 176, 176);
  box-shadow: 32px 0 rgb(157, 154, 154);
  left: 0;
  top: 0;
  animation: ballMoveX 1s linear infinite;
}

.loader-res:after {
  box-shadow: none;
  transform-origin: 40px 0;
  transform: rotate(-153deg);
  animation: rotateLoader 1s linear infinite;
}

@keyframes rotateLoader {
  0%, 10% { transform: rotate(-153deg); }
  90%, 100% { transform: rotate(0deg); }
}

@keyframes ballMoveX {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(32px); }
}
