/**
* Block Name: wohnungen
*/

img.size-full {
  width: 1000px;
}
/* Prevent body from scrolling when modal is open */
body.no-scroll {
  overflow: hidden;
}

section.wohnungen {
  display: flex; /* Make the section flexbox */
  position: relative;
  overflow: hidden;
}

/* isometry */

section.wohnungen .isometry_container {
  position: absolute;
  background-color: var(--ecru);
  width: 45vw;
  right: 0;
  top: 0;
  transition: all 500ms ease-in-out;
}

section.wohnungen .isometry_container:has(> .isometry.hide) {
  transform: translateX(100%);
  opacity: 0;
}

section.wohnungen .isometry {
  position: relative;
  padding: 30px;
  height: 960px;
  width: 45vw;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 300ms ease-in-out;
}

section.wohnungen .isometry .title-intro {
  display: none;
}

section.wohnungen .isometry.hide {
  transform: translateX(100%);
  opacity: 0;
}

section.wohnungen .isometry .bild_container svg {
  height: 470px;
  width: 100%;
  text-align: right;
}

section.wohnungen .isometry.hide .bild_container,
section.wohnungen .isometry.hide .bild_container svg {
  width: 0;
}

section.wohnungen .isometry .bild_container svg {
  height: 470px;
  width: 100%;
  text-align: right;
}

/* modal  */

.modal {
  width: 100vw;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  position: fixed;
  top: 0;
  right: 0;
  background: rgba(211, 81, 39, 0.37);
  backdrop-filter: blur(5.5px);
  z-index: -1;
  transition: opacity 500ms ease-in-out;
  display: block;
}

.modal.open {
  opacity: 1;
  z-index: 1000;
}

.modal #flatInformation {
  width: 70vw;
  background-color: var(--ecru);
  padding: 50px;
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  transform: translateX(100%);
  transition: transform 500ms ease-in-out;
  justify-content: flex-start !important;
  z-index: 0;
  z-index: 1000;
  opacity: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal.open #flatInformation {
  transform: translateX(0);
}

/* svg elements */

svg polygon,
svg path {
  transition: fill 100ms ease-in;
}
.g-highlight polygon,
.g-highlight path {
  fill: #f2b540 !important;
  cursor: pointer;
}

/* #flatInformation */

#flatInformation .bild_container.swiper {
  width: 100%;
  height: 250px;
  overflow: hidden;
  margin: 50px 0;
}

#flatInformation .swiper-wrapper {
  display: flex;
  padding-inline-start: 0;
}

#flatInformation .swiper-slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#flatInformation .swiper-slide svg {
  height: 100%;
  width: auto;
}

#flatInformation .swiper-slide svg .g-highlight polygon,
#flatInformation .swiper-slide svg .g-highlight path {
  cursor: default;
}

.wohnung-item {
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid #a4aead;
  cursor: pointer;
}

.wohnung-item:has(#sold) + .flat-data .flat-price {
  display: none;
}

.details span,
.address {
  opacity: 0.5;
}

.info {
  gap: 20px;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.availability {
  gap: 30px;
}

.availability span {
  padding: 4px 10px;
  border-radius: 100px;
  max-height: fit-content;
}

.availability span#forSale {
  background-color: #ebf3ec;
  color: #00875a;
}

.availability span#sold {
  background-color: #fdf6f4;
  color: #de350b;
}

.availability span#reserviert {
  background-color: var(--ecru);
  color: #c98930;
}

#flat-links a {
  border-top: 1px solid #a4aead;
  padding: 20px 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  color: var(--terrakotta);
  font-weight: 500;
}

#flat-links a:last-of-type {
  border-bottom: 1px solid #a4aead;
}

.fancybox-content {
  transition: all 400ms ease-in-out !important;
}

.fancybox-slide.fancybox-slide--svg .fancybox-content {
  height: 80vh !important;
  width: 100% !important;
  transform: translateX(0%) translateY(10%) !important;
  background: var(--ecru);
}

/* media queries */

@media (max-width: 992px) {
  section.wohnungen {
    flex-direction: column;
  }

  section.wohnungen .container {
    order: 2;
  }

  section.wohnungen .isometry_container {
    order: 1;
    position: static !important;
    width: 100% !important;
    max-height: max-content;
    padding: 0;
    margin: 0;
    margin-top: 50px;
  }

  section.wohnungen .isometry {
    width: 100%;
    height: 500px;
    justify-content: center;
    padding-bottom: 0;
    padding-top: 0;
  }

  section.wohnungen .isometry .title-intro {
    display: block;
    position: absolute;
    background-color: white;
    text-align: center;
    width: 100%;
    padding: 15px 0;
    top: -15px;
    left: 0;
  }

  section.wohnungen .container .title-intro {
    display: none;
  }

  section.wohnungen .isometry.hide {
    transform: translateX(0);
    opacity: 1;
  }

  section.wohnungen .isometry .bild_container {
    width: 100%;
    height: auto;
    position: relative;
    top: 30px;
  }

  section.wohnungen .isometry .bild_container svg {
    height: 100%;
  }

  section.wohnungen .isometry.hide .bild_container,
  section.wohnungen .isometry.hide .bild_container svg {
    width: 100%;
  }

  #flatInformation .bild_container.swiper {
    height: max-content;
  }

  section.wohnungen .sticky-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding-bottom: 50px;
    padding-top: 75px;
  }

  section.wohnungen .container {
    padding-right: 0;
  }

  .modal.open #flatInformation {
    width: 100vw;
    padding: 50px 30px;
  }

  .modal.open #flatInformation .bild_container.swiper {
    overflow: visible;
  }

  .modal.open #flatInformation .details {
    display: flex;
    flex-direction: column;
  }

  .modal.open #flatInformation .details #flat-links {
    order: 2;
  }

  .modal.open #flatInformation .details #flat-infos {
    order: 1;
  }

  .wohnung-item {
    flex-direction: column-reverse !important;
  }

  .availability {
    justify-content: space-between;
    margin-bottom: 30px;
  }

  .details {
    flex-direction: column !important;
    gap: 10px;
  }
}
