/*********************************
    IMPORT MAIN STYLE SHEET
**********************************/
@import "./main.css";

/*********************************
            HEADER
**********************************/
header {
  width: 100%;
  padding: 2rem;
  padding-top: 0rem;
  max-height: 45vh;
}

header figure {
  position: relative;
  height: 45vh;
}

header figure:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(1, 1, 1, 1) 10%,
    rgba(1, 1, 1, 0.4) 50%,
    rgba(1, 1, 1, 0.1) 100%
  );
}

header figure img {
  object-fit: cover;
  object-position: top;
}

header figure figcaption {
  position: absolute;
  align-items: flex-end;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  color: var(--white);
}

header figure figcaption p {
  opacity: 0.6;
}

@media (max-width: 1200px) {
  header {
    padding: 1rem;
    padding-top: 0rem;
    max-height: 50vh;
  }

  header figure {
    height: 50vh;
  }

  header figure figcaption {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
  }

  header figure figcaption .flex_content {
    padding: 0 !important;
  }
}

@media (max-width: 580px) {
  header,
  header figure {
    height: 45vh;
  }
}

/*********************************
           DIVISIONS
**********************************/
/*DIVISION_1*/
.division_1 {
  gap: 2rem;
}

.division_1 .left_section {
  width: 30vw;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
}

.division_1 .right_section {
  width: 100%;
}

.division_1 .left_section .blocks {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  position: sticky;
  top: 1rem;
  gap: 2rem;
}

.left_section .filters {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  border: 1px solid rgba(1, 1, 1, 0.1);
  border-radius: 0px;
  gap: 1rem;
}

.filters fildset,
input,
select {
  width: 100%;
}

.filters fieldset {
  align-items: center;
  padding: 0;
}

.filters input,
.filters select {
  padding: 0.65rem;
  background-color: var(--white);
  border: 1px solid rgba(1, 1, 1, 0.4);
}

.left_section form {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 1rem;
}

.left_section fieldset label {
  display: block;
  margin-bottom: 0.2rem;
}

.left_section form .filter_btn {
  width: 100%;
}

/*RIGHT SECTION*/
.cards {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

.card {
  flex: 0 1 32%;
  width: 32%;
  margin: 0.5%;
  background-color: var(--white);
  color: var(--gray);
  border: 1px solid rgba(1, 1, 1, 0.1);
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  overflow: visible;
  transition: 0.5s;
}

/* Ensure text inside cards wraps naturally (without breaking words) */
.card p,
.card span,
.card div,
.card a,
.card li {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.card:hover {
  border: 1px solid rgba(1, 1, 1, 0.4);
}

.card a {
  color: currentcolor;
}

.card figure {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.card figure img {
  max-width: 90px;
}

.card figure figcaption {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.3rem;
}

.card figure figcaption .title {
  color: var(--dark) !important;
}

.card .price {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  display: block;
  color: var(--primary);
}

.card .price iconify-icon {
  position: relative;
  top: 1.5px;
}

.card article {
  border-bottom: 1px solid rgba(1, 1, 1, 0.1);
}

.card article p {
  font-size: 13px;
  line-height: 25px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

/* Modify tags container so that tags wrap to a new line */
.card .tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.tag {
  font-size: 12px;
  padding: 1px 5px;
  border: 1px solid rgba(1, 1, 1, 0.1);
  border-radius: 20px;
}

.tag:hover {
  color: var(--dark);
  border: 1px solid rgba(1, 1, 1, 0.5);
}

.card article {
  padding: 0.5rem 0;
}

.card .icons {
  gap: 0.5rem;
}

.card .icon_btn {
  font-size: 20px;
  width: 30px;
  height: 30px;
}

.card address {
  font-size: 13px;
  font-style: normal;
  padding-top: 0.5rem;
  line-height: 25px;
}

.card .map {
  display: none;
  width: 100%;
  height: 100%;
}

@media (max-width: 1180px) {
  .card {
    flex: 0 1 49%;
  }
}

@media (max-width: 920px) {
  .division_1 .left_section {
    width: 50vw;
  }

  .card {
    flex: 0 1 100%;
    width: 100%;
    max-width: 100%;
    margin: 0.5% 0;
  }
}

@media (max-width: 720px) {
  .division_1 {
    gap: 1rem;
  }

  .division_1 .left_section .blocks {
    gap: 1rem;
  }

  .division_1 .left_section {
    width: 100%;
    padding: 0;
    padding-top: 1rem;
  }

  .division_1 .left_section .filters {
    order: 2;
  }

  .division_1 .left_section .filters form {
    display: none;
    -webkit-animation: scale-up-ver-top 0.4s cubic-bezier(0.39, 0.575, 0.565, 1)
      both;
    animation: scale-up-ver-top 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
  }

  .division_1 .left_section .filters form .title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .division_1 .left_section .filters .title:after {
    content: "\f107";
    font-family: "FontAwesome";
    float: right;
    transition: 0.5s;
  }

  .division_1 .left_section .filters_active form {
    display: flex;
  }

  .division_1 .left_section .filters_active .title:after {
    transform: rotate(180deg);
  }

  .division_1 .left_section .adds {
    order: 1;
  }

  .card {
    flex: 0 1 100%;
    width: 100%%;
    margin: 0.5rem 0;
  }

  .card .icon_btn {
    font-size: 16px;
    width: 20px;
    height: 23px;
  }

  form .btn {
    padding: 0.6rem;
    height: 40px;
  }

  .btn iconify-icon {
    font-size: 16px;
  }
}

#map {
  height: 500px;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  width: 300px !important;
}

.leaflet-popup {
  margin-bottom: 0;
}

.leaflet-popup-tip-container {
  margin-top: -1px;
}

.leaflet-popup-content-wrapper {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}
