.custom-search-drawer {
  max-width: 100vw;
  overflow-y: auto;
  max-height: calc(100dvh - calc(var(--header-height, 0px) + var(--header-offset, 0px)));

  position: absolute;
  top: 100%;
  background: var(--color-header-bg, var(--bg-body, #fff));
  min-width: 190px;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  border-top: 1px solid var(--color-header-border, var(--color-border));
  box-shadow: 0 10px 15px #0000001a;

  &.active {
    opacity: 1;
    visibility: visible;
    /* transform: translateY(0); */
    z-index: 51;
    transition: all 0.25s linear;
  }

  .custom-search-drawer__form-wrapper {
    width: 100%;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border, #dedede);
    @media screen and (min-width: 1068px) {
      padding: 1.25rem 1.875rem;
    }
  }

  .custom-search-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #151515;
    form {
      padding: 3px 0;
      width: 100%;
      @media screen and (min-width: 1068px) {
        padding: 5px 0;
      }
      /* max-width: 41.3125rem; */
    }

    .search-field {
      width: 100%;
      padding: 0;
      outline: none;
      border: none;
      height: 1.25rem;
      font-size: 1rem;
      font-weight: 400;
      line-height: 1.4;
      letter-spacing: 0;
      color: #151515;
    }
    .search-field::-webkit-search-decoration,
    .search-field::-webkit-search-cancel-button,
    .search-field::-webkit-search-results-button,
    .search-field::-webkit-search-results-decoration {
      display: none;
    }
    .search-field::placeholder {
      font-size: 1rem;
      line-height: 1.4;
    }
  }

  .custom-search-drawer__form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    @media screen and (min-width: 1068px) {
      gap: 1rem;
    }
  }

  .custom-search-drawer__close {
    width: 1.625rem;
    height: 1.625rem;
    cursor: pointer;

    svg {
      display: block;
      width: 100%;
      height: 100%;
      transition: transform 0.3s ease;
    }

    &:hover svg,
    &:focus svg {
      transform: scale(1.1);
    }

    @media screen and (min-width: 1068px) {
      width: 2.4375rem;
      height: 2.4375rem;
    }
  }

  .custom-search-drawer__search-icon {
    width: 1.625rem;
    height: 1.625rem;

    svg {
      display: block;
      width: 100%;
      height: 100%;
    }

    @media screen and (min-width: 1068px) {
      width: 1.875rem;
      height: 1.875rem;
    }
  }

  .custom-search-drawer__wrapper {
    display: flex;
    flex-direction: column;
    color: #151515;
    --color-accent: #151515;


    @media screen and (min-width: 1068px) {
      flex-direction: row;
    }
  }

  .custom-search-drawer__content {
    padding: 1.25rem;
    background-color: var(--search-suggestions-bg);
    @media screen and (min-width: 1068px) {
      padding-left: 1.875rem;
      padding-right: 1.875rem;
      padding-bottom: 2.5rem;

      max-width: 24.25rem;
      flex: 1;
    }
  }

  .custom-search-drawer__collections{
    padding: 1.25rem;
    padding-bottom: 0;
    @media screen and (min-width: 1068px){
      padding: 0;
    }
  }

  .custom-search-drawer__suggestions-heading {
    font-weight: 800;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    line-height: 1.45;
    color: var(--color-accent);
  }

  .custom-search-drawer__suggestions-list {
    margin: 0;
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .custom-search-drawer__suggestions-link {
    opacity: 1;
    transition: opacity 0.3s ease;

    &:hover,
    &:focus {
      opacity: 0.6;
    }
  }

  .custom-search-drawer__main-part {
    position: relative;
    flex: 1;
    min-height: 150px;
    padding-bottom: 1.25rem;

    @media screen and (min-width: 1068px) {
      padding-top: 1.25rem;
      padding-left: 1.875rem;
      padding-right: 1.875rem;
      padding-bottom: 2.5rem;
    }
  }

  .custom-search-drawer__predictions {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;

    &.active {
      display: block;
      opacity: 1;
    }

    &.loading {
      opacity: 0.6;
      pointer-events: none;
      position: relative;
    }

    .custom-search-drawer__promo-top{
      padding: 1.25rem;
    }
    @media screen and (min-width: 1068px){
      .custom-search-drawer__promo-top{
        padding: 0rem;
      }
    }
  }

  .custom-search-drawer__promo-top {
    display: flex;
    align-items: baseline;
  }

  .custom-search-drawer__promo-heading {
    margin: 0;
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--color-accent);
    line-height: 1.45;
  }

  .custom-search-drawer__promo-link {
    margin-left: auto;
    margin-right: 0;
    opacity: 1;
    transition: all 0.2s linear;
    white-space: nowrap;

    &:hover, &:focus {
      opacity: 0.6;
    }

    &::before {
      background: var(--color-accent);
      height: 2px;
      top: calc(100% + 4px);
    }
    &::after{
      display: none;
    }
  }

  .custom-search-drawer__promo-bottom {
    margin-top: 1.5rem;
  }

  .custom-search-drawer__promo-list,
  .custom-search-drawer__result-list {
    display: grid;
    column-gap: 0.375rem;
    row-gap: 0.75rem;

    grid-template-columns: repeat(2, 1fr);

    @media screen and (min-width: 768px) {
      grid-template-columns: repeat(3, 1fr);
    }

    @media screen and (min-width: 1200px) {
      grid-template-columns: repeat(var(--desktop-col), minmax(0, 1fr));
    }
  }

  .custom-search-drawer__result-list {
    gap: 1rem;
    row-gap: 1.875rem;
    @media screen and (min-width: 1200px) {
      grid-template-columns: repeat(var(--desktop-col), 1fr);
    }

    /* Fix for product cards in grid */
    custom-product-card,
    .card-product {
      min-width: 0;
      max-width: 100%;
      width: 100%;
    }

    .card-product .swym-wishlist-collections-v2 svg{
      display: none !important;
    }

    .card-product__colors{
      border-color: #dedede;
    }

    .card-product__colors, .card-product__title-price-wrapper, .card-product__category-link, .card-product__color-swatches, .card-product__color-names {
      padding-left: 0.75rem;
      padding-right: 0.75rem;
    }

    .card-product__color-names{
      gap: .8rem;
    }

    .card-product__color-names .card-product__color-name{
      font-size: 0.8rem;
    }

    .card-product__title-price-wrapper{
      display: block;
    }

    .card-product__category-link{
      margin-top: 0;
    }

    @media screen and (min-width: 1200px) {
      .card-product__info{
        padding-right: 2rem;
      }
    }
  }
  .hide-mobile {
    @media screen and (max-width: 1200px) {
      display: none;
    }
  }

  .hide-desktop {
    @media screen and (min-width: 1200px) {
      display: none;
    }
  }

  .custom-search-drawer__promo-item {
    min-width: 0;

    .collection-tab__content {
      padding-bottom: 1.21875rem;
      padding-left: 2px;
      padding-right: 2px;
      padding-top: 0.62rem;
    }

    .collection-tab__title,
    .collection-tab__title > a {
      --text-color: "#000";
      font-size: 0.9375rem;
      opacity: 1;
      transition: opacity 0.3s ease;
    }

    .collection-tab__title:hover {
      opacity: 0.6;
    }
  }

  .loading-overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;

    svg {
      width: 3rem;
      height: 3rem;
      animation: spin 1s linear infinite;
    }

    &.active {
      display: flex;
      opacity: 1;
    }
  }
}
