@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");

:root {
  --primary-orange-color: #e36900;
  --secondary-orange-color: #fcf0e6;
  --white-color: #ffffff;
  --shadow-color: #00000026;
  --text-black-color: #000000;
  --background-down: url("./assets/icons/down.png");
  --filter-white: brightness(0) invert(1);
  --border-color: #e2e2e2;
  --line-color: #d6d6d6;
  --placeholder-color: #a3a3a3;
  --overlay-light-color: rgba(0, 0, 0, 0.1);
}

section.filter_wrapper * {
  box-sizing: border-box;
  accent-color: var(--primary-orange-color);
  font-family: "Rubik", sans-serif;
}

section.filter_wrapper {
  background: var(--white-color);
  box-shadow: 0px 0px 20px 0px var(--shadow-color);
  border-radius: 12px;
  width: 100%;
  height: 200px;
  display: flex;
  flex-direction: column;
  row-gap: 20px;
  padding: 20px;
  color: var(--text-black-color);
}

section.filter_wrapper input[type="radio"] {
  display: none;
}

section.filter_wrapper ul.filter_menu {
  display: flex;
  column-gap: 20px;
  list-style: none;
  padding: 0 0 20px 0;
  border-bottom: 1px solid var(--line-color);
}

section.filter_wrapper ul.filter_menu li {
  background: var(--white-color);
  border-radius: 12px;
  height: 45px;
  line-height: 45px;
  font-size: 50px;
}

section.filter_wrapper ul.filter_menu li label {
  display: flex;
  align-items: center;
  column-gap: 10px;
  font-size: 18px;
  font-weight: 400;
  padding: 0 20px;
  cursor: pointer;
  height: 100%;
}

section.filter_wrapper ul.filter_menu li label img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

section.filter_wrapper form {
  display: none;
  column-gap: 20px;
}

section.filter_wrapper form#form_rent,
section.filter_wrapper form#form_purchase {
  grid-template-columns: repeat(4, 1fr);
}

section.filter_wrapper form#form_consignment {
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  margin-top: 14px;
}

section.filter_wrapper form div.form_field input,
section.filter_wrapper form select {
  padding: 0 20px;
  appearance: none;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  color: var(--text-black-color);
  font-weight: 400;
  font-size: 16px;
}

section.filter_wrapper form div.form_field input.select,
section.filter_wrapper form select {
  background-image: var(--background-down);
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: calc(100% - 10px);
}

section.filter_wrapper form select:focus,
section.filter_wrapper form div.form_field input:focus {
  outline: none;
  border: 1px solid var(--primary-orange-color);
}

section.filter_wrapper form div.form_field input::placeholder {
  color: var(--placeholder-color);
}

section.filter_wrapper form div.form_field button {
  display: none;
  appearance: none;
  border: none;
  outline: none;
  height: 20px;
  width: 20px;
  padding: 0;
  margin: 0;
  background: inherit;
  position: absolute;
  right: 10px;
  bottom: 12px;
  cursor: pointer;
}

section.filter_wrapper form div.form_field button img {
  height: 20px;
  width: 20px;
  object-fit: contain;
}

section.filter_wrapper form div.form_field div {
  display: flex;
  flex-direction: column;
  position: relative;
  row-gap: 10px;
}

section.filter_wrapper form div.form_field ul {
  position: absolute;
  background: var(--white-color);
  width: 100%;
  max-height: 145px;
  overflow-y: scroll;
  display: none;
  flex-direction: column;
  row-gap: 10px;
  background: var(--white-color);
  border-radius: 12px;
  padding: 20px;
  list-style: none;
  top: calc(100% + 5px);
  box-shadow: 0px 0px 20px 0px var(--shadow-color);
  z-index: 1;
}

section.filter_wrapper form div.form_field ul li {
  border-radius: 4px;
  padding: 5px 10px;
}

section.filter_wrapper form div.form_field ul li:hover {
  background: var(--overlay-light-color);
  cursor: pointer;
}

section.filter_wrapper form div.form_field div label {
  color: var(--text-black-color);
  font-weight: 400;
  font-size: 16px;
}

section.filter_wrapper form button[type="submit"] {
  border-radius: 12px;
  background: var(--primary-orange-color);
  height: 44px;
  width: 100%;
  border: none;
  color: var(--white-color);
  font-weight: 700;
  font-size: 20px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 20px;
}

section.filter_wrapper form button[type="submit"] img {
  filter: var(--filter-white);
  width: 20px;
  height: 20px;
  object-fit: contain;
  transform: rotate(-90deg);
}

section.filter_wrapper form button[type="submit"]:hover {
  filter: brightness(0.94);
  cursor: pointer;
}

section.filter_wrapper form select,
section.filter_wrapper form div.form_field input:not(:placeholder-shown) {
  background-color: var(--secondary-orange-color);
  border: 1px solid var(--primary-orange-color);
}

section.filter_wrapper form div.form_field input:not(:placeholder-shown) {
  background-image: none;
}

section.filter_wrapper
  form
  div.form_field
  input:not(:placeholder-shown)
  ~ button {
  display: block;
}

section.filter_wrapper form div.form_field input:not(:focus) ~ ul {
  display: none;
}

section.filter_wrapper input#rent:checked ~ ul li.item_rent,
section.filter_wrapper input#purchase:checked ~ ul li.item_purchase,
section.filter_wrapper input#consignment:checked ~ ul li.item_consignment {
  background: var(--primary-orange-color);
  color: var(--white-color);
  font-weight: bold;
}

section.filter_wrapper input#rent:checked ~ ul li.item_rent img,
section.filter_wrapper input#purchase:checked ~ ul li.item_purchase img,
section.filter_wrapper input#consignment:checked ~ ul li.item_consignment img {
  filter: var(--filter-white);
}

section.filter_wrapper input#rent:checked ~ ul li.item_rent label,
section.filter_wrapper input#purchase:checked ~ ul li.item_purchase label,
section.filter_wrapper
  input#consignment:checked
  ~ ul
  li.item_consignment
  label {
  cursor: default;
}

section.filter_wrapper input#rent:checked ~ form#form_rent,
section.filter_wrapper input#purchase:checked ~ form#form_purchase,
section.filter_wrapper input#consignment:checked ~ form#form_consignment {
  display: grid;
}

@media screen and (width <= 1200px) {
  section.filter_wrapper {
    min-height: 440px;
    margin-top: 170px;
  }

  section.filter_wrapper ul.filter_menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 0;
  }

  section.filter_wrapper ul.filter_menu li {
    height: unset;
    line-height: unset;
  }

  section.filter_wrapper ul.filter_menu li label {
    font-size: 12px;
    padding: 5px;
    column-gap: 5px;
  }

  section.filter_wrapper ul.filter_menu li label img {
    width: 14px;
    height: 14px;
  }

  section.filter_wrapper form {
    flex-direction: column;
    justify-content: center;
    flex: 1;
  }

  section.filter_wrapper form div.form_field ul li {
    border-radius: 4px;
    padding: 5px 10px;
  }

  section.filter_wrapper form div.form_field ul li:hover {
    background: var(--overlay-light-color);
    cursor: pointer;
  }

  section.filter_wrapper form div.form_field input,
  section.filter_wrapper form select {
    width: 100%;
  }

  section.filter_wrapper form div.form_field div label {
    font-size: 14px;
  }

  section.filter_wrapper {
    width: 100%;
    height: 100%;
  }

  section.filter_wrapper form {
    column-gap: 0;
    row-gap: 20px;
  }

  section.filter_wrapper form#form_rent,
  section.filter_wrapper form#form_purchase,
  section.filter_wrapper form#form_consignment {
    grid-template-columns: 1fr;
  }

  section.filter_wrapper form#form_consignment {
    margin-top: 0px;
  }

  section.filter_wrapper ul.filter_menu {
    flex-direction: column;
  }

  section.filter_wrapper form button[type="submit"] {
    font-size: 18px;
  }

  section.filter_wrapper input#rent:checked ~ form#form_rent,
  section.filter_wrapper input#purchase:checked ~ form#form_purchase,
  section.filter_wrapper input#consignment:checked ~ form#form_consignment {
    display: flex;
  }
}

@media screen and (width > 1500px) {
  section.filter_wrapper {
    width: 100%;
  }
}