.alcemi {
  .mobile-container {
    height: 100vh;
    width: 30rem;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);

    &:has(.search-container:not(.hidden)) {
      overflow-y: hidden;
    }
  }

  .mobile-container::-webkit-scrollbar {
    display: none;
  }

  .search-button,
  .next-search-button {
    z-index: 9999;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* border-radius: 5rem; */
    height: 3rem;
    border: none;
    color: var(--WHITE-100);
    background-color: var(--PRIMARY);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;

    &.hidden {
      display: none;
    }
  }

  .search-container {
    width: 100%;
    height: 100%;
    position: fixed;
    overflow: hidden;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;

    &.expanded {
      transform: translateY(0);

      .search-overlay {
        justify-content: center;
        padding-top: 0;
      }
    }

    &.hidden {
      transform: translateY(100%);
    }
  }

  .drag-handle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 0.25rem;
    background-color: var(--GRAY-700);
    border-radius: 1rem;
    margin-top: 0.75rem;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s ease;

    &:hover {
      opacity: 1;
    }

    &:active {
      cursor: grabbing;
    }
  }

  .search-content {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 2rem;
  }

  .search-header {
    position: absolute;
    top: 1.25rem;
    right: 1rem;
    left: 1rem;

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

    &.hidden {
      display: none;
    }
  }

  .undo-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--GRAY-900);
    font-size: 0.875rem;
    line-height: 1.5;
    z-index: 999;

    &.hidden {
      display: none;
    }
  }

  .cart-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--PRIMARY);
    font-size: 0.875rem;
    line-height: 1.5;
    z-index: 999;
    position: relative;
    margin-left: auto;

    img {
      filter: brightness(0) saturate(100%) invert(16%) sepia(31%)
        saturate(4466%) hue-rotate(255deg) brightness(97%) contrast(101%);
    }

    .item-count {
      position: absolute;
      left: 0.5rem;
      width: 1rem;
      height: 1rem;
      background-color: var(--PRIMARY);
      border-radius: 50%;
      top: 60%;
      color: var(--WHITE-100);
      line-height: 1;
      font-size: 0.625rem;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    &.hidden {
      display: none;
    }
  }

  .close-button {
    cursor: pointer;
    background: none;
    border: none;
    filter: invert(1);
    z-index: 999;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.3s ease;

    &.visible {
      opacity: 1;
    }
  }

  .loading-overlay {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    padding: 3.375rem 1rem 0 1rem;

    &.hidden {
      display: none;
    }

    .filtering-message {
      font-weight: 500;
      font-weight: 1rem;
      line-height: 1.5;
      color: var(--BLUE-700);
      text-align: center;
    }

    .loading-wrapper {
      display: flex;
      flex-direction: column;
      gap: 3.75rem;
    }

    .loading-row {
      display: flex;
      gap: 2rem;
    }

    .grid-card {
      width: 9.875rem;
      height: 16.75rem;
      border-radius: 0.5rem;
      background: linear-gradient(
        0deg,
        var(--PRIMARY) 0%,
        var(--SECONDARY) 100%
      );
      box-shadow: 0px 1px 8px 4px rgba(0, 0, 0, 5%);
      opacity: 0.5;
    }

    .grid-card:nth-child(2n + 1) {
      animation: fluctuate-v1 2s ease-in-out infinite;
    }

    .grid-card:nth-child(2n) {
      margin-top: 2.625rem;
      animation: fluctuate-v2 2s ease-in-out infinite;
    }
  }

  .search-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100rem;
    aspect-ratio: 730/670;
    border-radius: 50% 50% 0 0;
    z-index: -1;
    background-color: #fdfdfd;
    box-shadow: 4px 4px 48px 2px var(--PRIMARY);
    transition: border-radius 0.3s ease;
  }

  .expanded .search-background {
    border-radius: 0;
  }

  .search-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 3rem;
    position: relative;
    gap: 3rem;
    width: 100%;
    height: 100%;
    interpolate-size: allow-keywords;
    transition: padding-top, justify-content 0.3s ease;

    &.hidden {
      display: none;
    }

    .welcome-message {
      font-size: 1.25rem;
      font-weight: 400;
      line-height: 1.5;
      color: var(--BLACK-999);
      text-align: center;
    }

    .voice-input {
      display: none;
      font-size: 1.25rem;
      font-weight: 600;
      line-height: 1.5;
      color: var(--GRAY-900);
      text-align: center;
    }

    .speak-button {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 9.25rem;
      aspect-ratio: 1/1;
      border-radius: 10rem;
      cursor: pointer;
      background-color: var(--GREY-100);
      border: 1px solid var(--GREY-200);
      position: relative;
      box-shadow: 0 0 22px 24px var(--BLUR);

      img {
        z-index: 2;
      }

      &.hidden {
        display: none;
      }

      &.listening {
        animation: pulse 1.5s ease-in-out infinite;

        &::before {
          animation: innerPulse 1.5s ease-in-out infinite;
        }
      }
    }

    .speak-button::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 7.25rem;
      aspect-ratio: 1/1;
      border-radius: 10rem;
      background-color: var(--WHITE-100);
      border: 1px solid var(--GREY-200);
      z-index: 1;
    }

    /* .ai-search-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .input-container {
    display: flex;
    align-items: center;
    border: 1px solid white;
    border-radius: 10px;
    overflow: hidden;
    height: 3rem;
    width: 100%;

    input {
      height: 100%;
      border: none;
      flex: 1;
      padding: 0 0.75rem;
      outline: none;
    }
  }

  .search-button {
    background-color: #000;
    padding: 0.875rem 1.25rem;
    border: none;

    img {
      filter: brightness(0) invert(1);
    }
  } */
  }

  .tap-hint {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;

    p {
      color: var(--GREY-400);
      font-size: 0.875rem;
      font-weight: 400;
      line-height: 1.25;
    }

    p:first-child {
      font-weight: 500;
    }
  }

  .results-overlay {
    height: 100%;
    width: 100%;
    padding: 3.375rem 1rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;

    &.hidden {
      display: none;
    }

    .query-results {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      align-items: flex-start;

      .results-helptext {
        font-size: 0.875rem;
        font-weight: 400;
        line-height: 1.5;
        color: var(--GRAY-700);
      }

      .query-text {
        font-family: "Inter";
        font-size: 1.125rem;
        font-weight: 500;
        line-height: 1.5;
        color: var(--GRAY-900);
      }
    }

    .results-grid {
      display: flex;
      /* grid-template-columns: 1fr 1fr; */
      flex-direction: column;
      gap: 0.75rem;
      overflow-y: scroll;
      padding: 0.5rem 0 2rem 0;

      &::-webkit-scrollbar {
        display: none;
      }

      .flex-row {
        display: flex;
        gap: 0.75rem;
      }

      .shop-item {
        display: flex;
        flex-direction: column;
        min-height: 20rem;
        width: 100%;
        color: var(--GRAY-700);

        /* border-radius: 0.5rem; */
        border: 1px solid var(--GREY-200);
        overflow: hidden;
        background-color: var(--WHITE-100);
        /* box-shadow: 0px 1px 8px 4px rgba(0, 0, 0, 5%); */

        picture {
          min-height: 10rem;
          max-height: 10rem;
          position: relative;
        }

        .add-to-cart-btn {
          display: flex;
          align-items: center;
          justify-content: center;
          /* border-radius: 10rem; */
          width: 2rem;
          height: 2rem;
          background-color: var(--PRIMARY);
          position: absolute;
          bottom: 0.5rem;
          right: 0.5rem;
          border: none;
          cursor: pointer;
        }
      }

      .info-box {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0.5rem 0.75rem 0.5rem;
      }

      .misc-info-box {
        display: flex;
        align-items: center;
        justify-content: space-between;

        .price {
          font-size: 1rem;
          font-weight: 500;
          line-height: 1.5;
          color: var(--BLACK-999);
        }
      }

      .item-title {
        font-family: "Inter";
        font-size: 0.875rem;
        font-weight: 400;
        line-height: 1.5;
      }
    }
  }

  .next-search-overlay {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 999;
    animation: moveUp 1s cubic-bezier(0.25, 1, 0.5, 1);

    &.hidden {
      display: none;
    }

    .content {
      z-index: 10;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      position: relative;
      height: 100%;
      padding: 2rem 0 2.5rem;

      .drag-handle {
        position: absolute;
        top: -3rem;
        opacity: 0.5;
        transition: opacity 0.2s ease;

        &:hover {
          opacity: 1;
        }
      }

      .question-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin-top: 1rem;
      }
    }

    .help-followup-text {
      font-size: 0.875rem;
      line-height: 1.5;
      font-weight: 400;
      color: var(--GRAY-700);
      text-align: center;
    }

    .followup-text {
      font-size: 1rem;
      font-weight: 600;
      line-height: 1.5;
      color: var(--BLACK-999);
      text-align: center;
    }

    .followup-voice-input {
      display: none;
      font-size: 1.25rem;
      font-weight: 600;
      line-height: 1.5;
      color: var(--GRAY-900);
      text-align: center;
    }

    .next-speak-button {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 9.25rem;
      aspect-ratio: 1/1;
      border-radius: 10rem;
      cursor: pointer;
      background-color: var(--GREY-100);
      border: 1px solid var(--GREY-200);
      position: relative;
      box-shadow: 0 0 22px 24px var(--BLUR);

      img {
        z-index: 2;
      }

      &.hidden {
        display: none;
      }

      &.listening {
        animation: pulse 1.5s ease-in-out infinite;
        /* background-color: var(--WHITE-100);
        border-color: var(--PRIMARY); */

        &::before {
          /* background-color: var(--WHITE-100);
          border-color: var(--PRIMARY); */
          animation: innerPulse 1.5s ease-in-out infinite;
        }
      }
    }

    .next-speak-button::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 7.25rem;
      aspect-ratio: 1/1;
      border-radius: 10rem;
      background-color: var(--WHITE-100);
      border: 1px solid var(--GREY-200);
      z-index: 1;
    }

    .cancel-button {
      display: none;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--GREY-400);
      font-size: 0.875rem;
      line-height: 1.5;
      font-weight: 400;
      text-decoration: underline;
      text-underline-offset: 0.25rem;
    }
  }

  .next-search-background {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 100rem;
    aspect-ratio: 730/670;
    border-radius: 50%;
    background-color: #fdfdfd;
    box-shadow: 4px 4px 48px 2px var(--PRIMARY);
  }

  .search-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* border-radius: 5rem; */
    overflow: hidden;
    border: 1px solid var(--PRIMARY);
    height: 3rem;

    input {
      border: none;
      padding: 0.75rem;

      &:focus {
        outline: none;
      }
    }

    button {
      background-color: var(--PRIMARY);
      border: none;
      padding: 0.75rem 1.25rem;
      height: 100%;
      cursor: pointer;
    }

    &.hidden {
      display: none;
    }
  }

  .checkout-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    &.hidden {
      display: none;
    }
  }
}

@keyframes moveUp {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0%);
  }
}

@keyframes scrollLeft {
  to {
    transform: translateX(calc(-50% - 2rem));
  }
}

@keyframes fluctuate-v1 {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2.625rem);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes fluctuate-v2 {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2.625rem);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes moveUp-v2 {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(-10%);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 22px 24px var(--BLUR);
  }
  50% {
    box-shadow: 0 0 36px 44px var(--BLUR-BRIGHT);
  }
  100% {
    box-shadow: 0 0 22px 24px var(--BLUR);
  }
}

@keyframes innerPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
