/* =========================================================
   SOHOGLAM — LIVE SEARCH / AUTOCOMPLETE
   ========================================================= */

.sg-autocomplete-host {
  position: relative !important;
  overflow: visible !important;
}

.sg-autocomplete {
  position: absolute;
  z-index: 9999999;

  top: calc(100% + 8px);
  left: 0;

  width: max(100%, 520px);
  max-width: min(620px, calc(100vw - 30px));

  overflow: hidden;

  border: 1px solid #e3ddda;
  border-radius: 2px;

  background: #fff;

  box-shadow:
    0 18px 55px rgba(25, 25, 25, .11),
    0 3px 12px rgba(25, 25, 25, .05);

  color: #272321;

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

.sg-autocomplete[hidden] {
  display: none !important;
}

.sg-autocomplete__label {
  padding: 12px 15px 10px;

  border-bottom: 1px solid #eee9e6;

  color: #a76670;

  font-size: 8px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .13em;
}

.sg-autocomplete__items {
  max-height: min(470px, 58vh);

  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color: #d9d2ce transparent;
}

.sg-autocomplete__items::-webkit-scrollbar {
  width: 4px;
}

.sg-autocomplete__items::-webkit-scrollbar-thumb {
  background: #d9d2ce;
  border-radius: 10px;
}

.sg-autocomplete__item {
  min-height: 92px;

  display: grid;

  grid-template-columns:
    68px
    minmax(0, 1fr)
    auto
    18px;

  gap: 13px;

  align-items: center;

  padding: 11px 14px;

  border-bottom: 1px solid #eee9e6;

  background: #fff;

  color: #292525 !important;

  text-decoration: none !important;

  transition:
    background .16s ease,
    padding-left .16s ease;
}

.sg-autocomplete__item:hover,
.sg-autocomplete__item.is-active {
  padding-left: 18px;

  background: #f8f5f3;
}

.sg-autocomplete__image {
  width: 68px;
  height: 68px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background: #f6f4f2;
}

.sg-autocomplete__image img {
  width: 100% !important;
  height: 100% !important;

  display: block;

  margin: 0 !important;

  object-fit: contain !important;
}

.sg-autocomplete__content {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 4px;
}

.sg-autocomplete__content small {
  color: #a76670;

  font-size: 7.5px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .08em;
}

.sg-autocomplete__content strong {
  overflow: hidden;

  color: #292525;

  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;

  text-overflow: ellipsis;
}

.sg-autocomplete__content > span {
  color: #948b87;

  font-size: 8px;
  line-height: 1.35;
}

.sg-autocomplete__price {
  min-width: 75px;

  color: #292525;

  font-size: 10.5px;
  font-weight: 700;

  text-align: right;

  white-space: nowrap;
}

.sg-autocomplete__price del {
  margin-right: 4px;

  color: #aaa29e;

  font-size: 8.5px;

  opacity: 1;
}

.sg-autocomplete__price ins {
  color: #a15e67;

  text-decoration: none;
}

.sg-autocomplete__arrow {
  color: #77706c;

  font-size: 13px;

  transition: transform .16s ease;
}

.sg-autocomplete__item:hover .sg-autocomplete__arrow,
.sg-autocomplete__item.is-active .sg-autocomplete__arrow {
  transform: translateX(3px);
}

.sg-autocomplete__all {
  min-height: 47px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 0 15px;

  background: #191919;

  color: #fff !important;

  font-size: 9px;
  font-weight: 650;

  text-decoration: none !important;
}

.sg-autocomplete__all span {
  font-size: 14px;

  transition: transform .16s ease;
}

.sg-autocomplete__all:hover span {
  transform: translateX(3px);
}

.sg-autocomplete__status,
.sg-autocomplete__empty {
  min-height: 90px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 7px;

  padding: 20px;

  color: #756e6a;

  font-size: 9.5px;

  text-align: center;
}

.sg-autocomplete__status {
  flex-direction: row;
}

.sg-autocomplete__empty strong {
  color: #302b29;

  font-size: 11px;
  font-weight: 650;
}

.sg-autocomplete__empty span {
  color: #958d88;

  font-size: 9px;
}

.sg-autocomplete__spinner {
  width: 14px;
  height: 14px;

  display: block;

  border: 1px solid #d8d1cd;
  border-top-color: #a76670;

  border-radius: 50%;

  animation: sg-autocomplete-spin .7s linear infinite;
}

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

/* Wąski sidebar Sklepu: dropdown może wyjść w prawo ponad sidebar. */
.sg-shop-sidebar .sg-autocomplete {
  width: 480px;
}

/* Duża wyszukiwarka wyników */
.sg-search-hero-form .sg-autocomplete {
  width: 100%;
  max-width: none;
}

/* Divi często nadaje formom overflow:hidden */
.et_pb_searchform.sg-autocomplete-host,
.et_pb_search.sg-autocomplete-host,
.et_pb_module:has(.sg-autocomplete-host) {
  overflow: visible !important;
}

@media (max-width: 900px) {
  .sg-autocomplete,
  .sg-shop-sidebar .sg-autocomplete {
    position: absolute;

    width: 100%;
    max-width: 100%;

    top: calc(100% + 7px);
  }

  .sg-autocomplete__item {
    grid-template-columns:
      58px
      minmax(0, 1fr)
      auto;

    min-height: 80px;

    gap: 10px;

    padding: 10px 12px;
  }

  .sg-autocomplete__image {
    width: 58px;
    height: 58px;
  }

  .sg-autocomplete__arrow {
    display: none;
  }
}

@media (max-width: 520px) {
  .sg-autocomplete {
    left: 0;

    width: 100%;
    max-width: calc(100vw - 30px);
  }

  .sg-autocomplete__item {
    grid-template-columns:
      54px
      minmax(0, 1fr);

    align-items: start;
  }

  .sg-autocomplete__image {
    width: 54px;
    height: 54px;

    grid-row: 1 / span 2;
  }

  .sg-autocomplete__price {
    grid-column: 2;

    min-width: 0;

    text-align: left;
  }

  .sg-autocomplete__content strong {
    white-space: normal;
  }
}
