/* Common styles used across all templates */

:root {
  --radius-sm: 6px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px var(--shadow-color);
  --shadow-hover: 0 8px 32px var(--shadow-color);
  --shadow-lg: 0 22px 60px var(--shadow-color);
  --transition-fast: 180ms ease;
  --transition-medium: 250ms ease;
  --transition-slow: 300ms ease;
}

.loader {
  width: 90px;
  aspect-ratio: 6;
  --dot: no-repeat
    radial-gradient(circle closest-side, currentColor 90%, transparent);
  --size: calc(100% / 4);
  --speed: 1s;
  background: var(--dot) 0% 50%, var(--dot) 33% 50%, var(--dot) 66% 50%,
    var(--dot) 100% 50%;
  background-size: var(--size) 100%;
  animation: l7 var(--speed) infinite ease-in-out;
}

@keyframes l7 {
  20% {
    background-size: var(--size) 0%, var(--size) 100%, var(--size) 100%,
      var(--size) 100%;
  }
  40% {
    background-size: var(--size) 100%, var(--size) 0%, var(--size) 100%,
      var(--size) 100%;
  }
  60% {
    background-size: var(--size) 100%, var(--size) 100%, var(--size) 0%,
      var(--size) 100%;
  }
  80% {
    background-size: var(--size) 100%, var(--size) 100%, var(--size) 100%,
      var(--size) 0%;
  }
}

.availabile-date {
  margin: 2px;
  background-color: rgba(var(--success-color-rgb), 0.1);
}

.lightboxOverlay,
.lightbox {
  z-index: 2000000002 !important;
}

/* ── Menu ── */
/* FIXME: architecturally these menu/layer variables and rules do not belong in common.css.
   Template-specific menu behaviour (heights, shrink transitions) should live in each
   template's own stylesheet. Having them here creates hidden coupling — individual templates
   (cortiva, haven) already re-declare the same rules in their own <style> blocks, which
   means there are now multiple sources of truth for the same values.
   --layer-search-* vars are the only ones that genuinely belong here because
   common/sections/blocks/search-bar.ejs depends on them. */

:root {
  --layer-header: 100;
  --layer-dropdown: 101;
  --layer-mobile: 102;
  --layer-search-scrim: 2147483645;
  --layer-search-overlay: 2147483646;
  --layer-mobile-actions: 2147483647;
  --layer-search-trigger: 2147483644;
}

@media (min-width: 1024px) {
  :root {
    --menu-h-max: 112px;
    --menu-h-min: 72px;
    --logo-h-max: 56px;
    --logo-h-min: 40px;
    --menu-h-cur: var(--menu-h-max);
    --logo-h-cur: var(--logo-h-max);
  }

  .menu-shrinkable {
    --menu-h-cur: var(--menu-h-max);
    --logo-h-cur: var(--logo-h-max);
  }

  .menu-shrinkable.menu--shrunk {
    --menu-h-cur: var(--menu-h-min);
    --logo-h-cur: var(--logo-h-min);
  }
}

.menu-bar {
  height: var(--menu-h-cur);
  transition: height var(--transition-fast);
}

.menu-logo {
  height: var(--logo-h-cur);
  transition: height var(--transition-fast);
}

.menu-item a {
  line-height: 1.25;
}

/* ── Date picker ── */

.date-picker-wrapper {
  z-index: 2000000004 !important;
}

/* ── Mobile scroll lock (search overlay, map view) ── */

body.mobile-no-scroll #showMapButton,
.show-map-hidden {
  opacity: 0;
  pointer-events: none;
}

.mobile-no-scroll .z-\[var\(--layer-header\)\],
.mobile-no-scroll .z-\[var\(--layer-mobile\)\] {
  z-index: 10 !important;
}

@media (max-width: 768px) {
  body.mobile-no-scroll {
    overflow: hidden;
    touch-action: none;
  }
}

/* ── List toggle ── */

.common-list-toggle-item[open] .list-toggle-icon {
  transform: rotate(180deg);
}

.common-list-toggle-item .list-toggle-icon {
  transition: transform var(--transition-medium);
}

.common-list-toggle-item[open] .list-toggle-content {
  animation: list-toggle-reveal var(--transition-medium);
}

@keyframes list-toggle-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── FAQ ── */

.faq-toggle + .faq-question .faq-icon {
  transform: rotate(-90deg);
  transition: transform var(--transition-slow);
}

.faq-toggle:checked + .faq-question .faq-icon {
  transform: rotate(0deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 500ms ease;
}

.faq-toggle:checked ~ .faq-content {
  max-height: fit-content;
  padding: 0px 10px 20px 0;
}

/* ── Utilities ── */

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── Property search ── */

.search-input-item {
  border: 1px solid black;
}

.list-map-swiper-slide {
  width: 100% !important;
  height: 250px !important;
  text-align: center;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-swiper-slide {
  width: 100% !important;
  height: 250px !important;
}

.gallery-swiper-slide img {
  margin: auto;
  height: 100%;
}

@media (min-width: 640px) {
  .gallery-swiper-slide {
    width: fit-content !important;
  }
  .gallery-swiper-slide img {
    height: 100%;
  }
}

.list-map-swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-icon {
  border: 1px solid gray;
  padding: 4px;
  stroke: black;
}

.map-icon-selected,
.map-icon:hover {
  background: var(--primary-button-background-color);
  z-index: 100000;
  stroke: var(--primary-button-text-color);
}

.property-search-title-font {
  font-family: var(--property-search-title-font);
}

.property-search-details-font {
  font-family: var(--property-search-details-font);
}

/* ── Move up-down hover animation ── */

@keyframes move-up-down {
  0%, 50%, 100% { transform: translateY(0); }
  25% { transform: translateY(15px); }
  75% { transform: translateY(-15px); }
}

.move-image {
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;
}

.move-image:hover {
  animation-name: move-up-down;
}
