.ads-property-gallery {
  --gallery-left-rail: clamp(56px, 8vw, 120px);
  --gallery-main-width: min(68vw, 980px);
  --gallery-peek-width: calc(var(--gallery-main-width) * 0.75);
  --gallery-arrow-size: clamp(44px, 4vw, 58px);
  --gallery-arrow-gap: clamp(22px, 2.4vw, 34px);
  --gallery-frame-padding: 0px;
  --gallery-peek-frame-padding-x: 0px;
  --gallery-peek-frame-padding-y: 0px;
  --gallery-line-color: rgba(255, 255, 255, 0.72);
  --gallery-line-width: 1px;
  --gallery-pagination-gap: clamp(24px, 2.6vw, 36px);
  --gallery-thumbs-gap-top: clamp(84px, 8vw, 130px);
  --gallery-thumb-width: clamp(240px, 18vw, 320px);
  --gallery-thumb-height: clamp(130px, 10vw, 180px);
  --gallery-thumb-gap: clamp(72px, 6vw, 110px);
  --gallery-main-ratio: 16 / 10;
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow-x: clip;
}

html,
body {
  overflow-x: hidden;
}

.ads-property-gallery__stage {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.ads-property-gallery__main {
  position: relative;
  width: min(68vw, 980px);
  margin-left: clamp(56px, 8vw, 120px);
  overflow: hidden;
  transition: opacity 120ms ease;
}

.ads-property-gallery__swiper {
  width: 100%;
  overflow: hidden;
}

.ads-property-gallery__swiper .swiper-wrapper {
  align-items: center;
}

.ads-property-gallery__slide {
  opacity: 0 !important;
  pointer-events: none;
}

.ads-property-gallery__slide.swiper-slide-active {
  opacity: 1 !important;
  pointer-events: auto;
}

.ads-property-gallery__slide-frame {
  width: 100%;
  aspect-ratio: var(--gallery-main-ratio);
  border: var(--gallery-line-width) solid var(--gallery-line-color);
  padding: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  overflow: hidden;
}

.ads-property-gallery__slide-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #f3f3f3;
}

.ads-property-gallery__prev,
.ads-property-gallery__next {
  position: absolute;
  top: 50%;
  width: clamp(44px, 4vw, 58px);
  height: clamp(44px, 4vw, 58px);
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.78);
  background: transparent !important;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 40;
  transform: translateY(-50%);
}

.ads-property-gallery__prev {
  left: clamp(28px, 4vw, 60px);
}

.ads-property-gallery__next {
  left: calc(
    clamp(56px, 8vw, 120px)
    + min(68vw, 980px)
    + clamp(22px, 2.4vw, 34px)
  );
}

.ads-property-gallery__prev:hover,
.ads-property-gallery__next:hover {
  background: transparent !important;
  box-shadow: none;
}

.ads-property-gallery__prev::before,
.ads-property-gallery__next::before {
  content: "";
  width: 11px;
  height: 11px;
  display: block;
  border-top: 2px solid rgba(0, 0, 0, 0.78);
  border-right: 2px solid rgba(0, 0, 0, 0.78);
}

.ads-property-gallery__prev::before {
  transform: rotate(-135deg);
  margin-left: 3px;
}

.ads-property-gallery__next::before {
  transform: rotate(45deg);
  margin-right: 3px;
}

.ads-property-gallery__peek {
  position: absolute;
  top: 50%;
  left: calc(
    clamp(56px, 8vw, 120px)
    + min(68vw, 980px)
    + clamp(22px, 2.4vw, 34px)
    + clamp(44px, 4vw, 58px)
    + clamp(22px, 2.4vw, 34px)
  );
  width: calc(min(68vw, 980px) * 0.75);
  aspect-ratio: 16 / 10;
  transform: translateY(-50%);
  overflow: visible;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.ads-property-gallery__peek-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: var(--gallery-line-width) solid var(--gallery-line-color);
  padding: 0;
  background: transparent;
  box-sizing: border-box;
  overflow: hidden;
}

.ads-property-gallery__peek-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(0.75);
  transform-origin: left center;
}

.ads-property-gallery__pagination {
  width: min(68vw, 980px);
  margin-top: clamp(24px, 2.6vw, 36px);
  margin-left: clamp(56px, 8vw, 120px);
  text-align: center;
}

.ads-property-gallery__pagination.swiper-pagination-bullets .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  margin: 0 6px !important;
  opacity: 1;
  background: rgba(0, 0, 0, 0.16);
}

.ads-property-gallery__pagination.swiper-pagination-bullets .swiper-pagination-bullet-active {
  background: rgba(0, 0, 0, 0.42);
}

.ads-property-gallery__thumbs-wrap {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: clamp(84px, 8vw, 130px);
  padding-left: clamp(56px, 8vw, 120px);
  padding-right: clamp(56px, 8vw, 120px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.ads-property-gallery__thumbs-wrap::-webkit-scrollbar {
  display: none;
}

.ads-property-gallery__thumbs-wrap:active {
  cursor: grabbing;
}

.ads-property-gallery__thumbs-swiper {
  width: max-content;
  min-width: 100%;
}

.ads-property-gallery__thumbs-swiper .swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gallery-thumb-gap);
  width: max-content;
  align-items: center;
}

.ads-property-gallery__thumb-slide {
  width: clamp(240px, 18vw, 320px);
  min-width: clamp(240px, 18vw, 320px);
  flex: 0 0 clamp(240px, 18vw, 320px);
  opacity: 0.78;
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}

.ads-property-gallery__thumb-slide.is-active {
  opacity: 1;
}

.ads-property-gallery__thumb-frame {
  width: 100%;
  height: clamp(130px, 10vw, 180px);
  overflow: hidden;
  background: transparent;
}

.ads-property-gallery__thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* CAPA DE ANIMACIÓN */

.ads-property-gallery__anim-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: visible;
  opacity: 1;
}

.ads-property-gallery__anim-layer.is-fading-out {
  opacity: 0;
  transition: opacity 120ms ease;
}

.ads-property-gallery__anim-item {
  position: absolute;
  box-sizing: border-box;
  will-change: left, top, width, height, opacity;
}

.ads-property-gallery__anim-frame {
  width: 100%;
  height: 100%;
  border: var(--gallery-line-width) solid var(--gallery-line-color);
  background: transparent;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
}

.ads-property-gallery__anim-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  will-change: transform;
}

.ads-property-gallery__stage.is-animating .ads-property-gallery__main,
.ads-property-gallery__stage.is-animating .ads-property-gallery__peek {
  opacity: 0;
}

@media (max-width: 1200px) {
  .ads-property-gallery {
    --gallery-main-width: min(64vw, 860px);
  }
}

@media (max-width: 1024px) {
  .ads-property-gallery {
    --gallery-left-rail: 44px;
    --gallery-main-width: min(70vw, 760px);
    --gallery-main-ratio: 16 / 11;
  }

  .ads-property-gallery__main {
    width: min(70vw, 760px);
    margin-left: 44px;
  }

  .ads-property-gallery__next {
    left: calc(
      44px
      + min(70vw, 760px)
      + clamp(22px, 2.4vw, 34px)
    );
  }

  .ads-property-gallery__peek {
    left: calc(
      44px
      + min(70vw, 760px)
      + clamp(22px, 2.4vw, 34px)
      + clamp(44px, 4vw, 58px)
      + clamp(22px, 2.4vw, 34px)
    );
    width: calc(min(70vw, 760px) * 0.75);
    aspect-ratio: 16 / 11;
  }

  .ads-property-gallery__pagination {
    width: min(70vw, 760px);
    margin-left: 44px;
  }
}

@media (max-width: 767px) {
  .ads-property-gallery {
    width: 100%;
    margin-left: 0;
    overflow-x: hidden;
    --gallery-main-ratio: 4 / 3;
    --gallery-thumb-gap: 24px;
  }

  .ads-property-gallery__main,
  .ads-property-gallery__pagination {
    width: 100%;
    margin-left: 0;
  }

  .ads-property-gallery__peek,
  .ads-property-gallery__next {
    display: none;
  }

  .ads-property-gallery__prev {
    left: 10px;
  }

  .ads-property-gallery__thumbs-wrap {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    margin-top: 42px;
  }

  .ads-property-gallery__thumb-slide {
    width: 220px;
    min-width: 220px;
    flex: 0 0 220px;
  }

  .ads-property-gallery__thumb-frame {
    height: 126px;
  }
}

/* ================================
   GRILLA DE PROPIEDADES SIMILARES
   ================================ */

.ads-similar-properties-grid {
  display: grid;
  gap: 24px;
  width: 100%;
}

.ads-similar-properties-grid--cols-1 {
  grid-template-columns: 1fr;
}

.ads-similar-properties-grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ads-similar-properties-grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ads-similar-properties-grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.ads-similar-properties-grid--cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.ads-similar-properties-grid__item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* TARJETA DE PROPIEDAD */

.ads-property-card {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ads-property-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.ads-property-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.ads-property-card__media {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.ads-property-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.ads-property-card:hover .ads-property-card__media img {
  transform: scale(1.05);
}

.ads-property-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ads-property-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
  color: #333;
  text-decoration: none;
}

.ads-property-card__location {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.ads-property-card__facts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #999;
  margin-top: auto;
}

.ads-property-card__facts span {
  display: inline-block;
}

.ads-property-card__facts span::before {
  content: '• ';
  margin-right: 4px;
}

.ads-property-card__facts span:first-child::before {
  content: '';
  margin-right: 0;
}

/* RESPONSIVE - TABLET */

@media (max-width: 1024px) {
  .ads-similar-properties-grid--cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .ads-similar-properties-grid--cols-6 {
    grid-template-columns: repeat(4, 1fr);
  }

  .ads-similar-properties-grid {
    gap: 18px;
  }

  .ads-property-card__media {
    height: 180px;
  }

  .ads-property-card__body {
    padding: 14px;
  }

  .ads-property-card__title {
    font-size: 15px;
  }

  .ads-property-card__price {
    font-size: 16px;
  }
}

/* RESPONSIVE - MOBILE */

@media (max-width: 768px) {
  .ads-similar-properties-grid--cols-2,
  .ads-similar-properties-grid--cols-3,
  .ads-similar-properties-grid--cols-4,
  .ads-similar-properties-grid--cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .ads-similar-properties-grid {
    gap: 16px;
  }

  .ads-property-card__media {
    height: 160px;
  }

  .ads-property-card__body {
    padding: 12px;
  }

  .ads-property-card__title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .ads-property-card__location {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .ads-property-card__price {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .ads-property-card__facts {
    gap: 8px;
    font-size: 11px;
  }
}

/* RESPONSIVE - MOBILE PEQUEÑO */

@media (max-width: 480px) {
  .ads-similar-properties-grid--cols-2,
  .ads-similar-properties-grid--cols-3,
  .ads-similar-properties-grid--cols-4,
  .ads-similar-properties-grid--cols-6 {
    grid-template-columns: 1fr;
  }

  .ads-similar-properties-grid {
    gap: 12px;
  }

  .ads-property-card__media {
    height: 140px;
  }

  .ads-property-card__body {
    padding: 10px;
  }

  .ads-property-card__title {
    font-size: 13px;
  }

  .ads-property-card__price {
    font-size: 14px;
  }
}