@use "sass:map";
@use "global/acms-common" as acms;
@use "global/common" as global;

/* 検索フォーム（大）
------------------------------ */
.form-search {
  .form-search-action {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .form-search-label {
    margin-right: 1rem;
    font-size: map.get(global.$font-scales, body-s);
    font-weight: bold;
    line-height: 3rem;
    white-space: nowrap;
  }

  input.form-search-input {
    box-sizing: border-box;
    flex: 1 1 auto;
    height: 3rem;
    padding: 0.75rem 1rem;
    font-size: map.get(global.$font-scales, body-m);
    appearance: none;
    background: var(--color-white);
    border: var(--border-width-sm) solid var(--color-gray30);
    border-radius: var(--border-radius-md);
    transition: background-color 0.25s ease;

    &:hover {
      background: var(--color-white);
      border-color: var(--color-gray50);
    }

    &:focus {
      outline: none;
      background: var(--color-white);
      border-color: acms.$acms-form-focus-border-color;
      box-shadow: var(--box-shadow-focus), acms.$acms-form-box-shadow;
    }
  }


  .form-search-side-button {
    display: flex;
    white-space: nowrap;
  }

  .form-search-button {
    width: initial;
    padding: 0.75rem 2rem;
  }

  @include acms.media-breakpoint-up(md) {
    .form-search-button {
      padding: 0.75rem 2rem;
    }
  }
}

/* 検索結果 */
.search-result-heading {
  margin-bottom: 1.5rem;

  .form-search-label {
    display: none;
  }
}

@include acms.media-breakpoint-up(md) {
  .search-result-heading {
    .form-search-action {
      max-width: 50%;
    }

    .form-search-button {
      min-width: initial;
    }
  }
}

.search-back-button-wrap {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem 1rem 2rem;
}


/* 検索ボックス
----------------------------- */
.search-panel {
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background: var(--color-gray10);
  border-radius: var(--border-radius-xl);

  .form-checkbox {
    width: 50%;
  }

  .form-input-wrap {
    padding-bottom: 1.5rem;
  }
}

.search-panel-group {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-panel-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.search-panel-label {
  display: inline-block;
  min-width: 8rem;
  font-weight: bold;
}

.search-panel-input {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0;
  align-items: center;

  &.price {
    flex-direction: column;
    width: 100%;
  }
}

.search-panel-keyword {
  width: 100%;
}

.search-panel-footer {
  text-align: center;
}

@include acms.media-breakpoint-up(md) {
  .search-panel {
    padding: 3rem;
    margin-bottom: 3rem;
    border-radius: var(--border-radius-xxl);

    .form-checkbox {
      width: calc(100% / 3 - 2rem);
    }

    .search-panel-group {
      display: flex;
      flex-flow: row wrap;
    }

    .search-panel-item {
      flex-direction: row;
      gap: var(--col-gutter);
      align-items: center;
    }

    .search-panel-input {
      flex: 1;
      gap: 1rem;

      &.price {
        flex-direction: row;

        select {
          flex: 1;
        }
      }
    }
  }
}

/* 検索結果
----------------------------- */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 0 2rem;

  &:not(:has(*)) {
    display: none;
  }
}

.search-amount {
  margin: 0;
  font-size: map.get(global.$font-scales, body-m);
  font-weight: bold;
  line-height: var(--line-height-base);
}

.search-conditions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  margin: 0;
  background: var(--color-gray10);
  border-radius: var(--border-radius-lg);

  dt {
    font-weight: bold;
  }

  dd {
    margin: 0;
  }

  @include acms.media-breakpoint-up(md) {
    flex-direction: row;
    gap: var(--col-gutter);
  }
}
