@use '_theme.scss';

.search-addresses {
  display: flex;
  position: relative;
  width: 300px;

  @media (max-width: theme.$sm) {
    width: 100%;
  }

  .search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding-right: 15px;
  }

  .search-input {
    height: 40px;
    width: 100%;
    padding: 0 20px;
    padding-right: 50px;
    font-size: var(--text-size-regular);
    color: var(--text-color-dark);
    border: 1px solid var(--color-line);
    border-top-left-radius: var(--button-border-radius);
    border-bottom-left-radius: var(--button-border-radius);
    border-right: none;
    outline: none;
    transition: border-color 0.2s ease;

    &:focus {
      border-color: var(--color-highlight, var(--color-line));
    }

    &::placeholder {
      color: var(--text-color-medium);
      font-size: var(--text-size-regular);
      opacity: 1;
      transition: opacity 0.2s ease;
    }

    &:focus::placeholder {
      opacity: 0;
    }
  }

  .search-clear-button {
    position: absolute;
    right: 50px;
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding-right: 12px;

    .search-clear-icon {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  .search-button {
    position: absolute;
    right: 0;
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-primary-background-color);
    border: none;
    border-top-right-radius: var(--button-border-radius);
    border-bottom-right-radius: var(--button-border-radius);
    cursor: pointer;

    &:hover {
      background: var(--button-primary-hover-background-color, var(--button-primary-background-color));
    }

    .search-icon-container {
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .search-icon {
      vertical-align: baseline;

      path {
        fill: var(--button-primary-text-color);
      }
    }
  }
}

