/* ================================================
   MANARE RESIDENCE — Individual Residence Page
   Reference-based layout: Image carousel left + Info right
   ================================================ */

/* --- Full-Page Layout --- */
.residence-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f3f0; /* warm off-white matching reference */
  padding-top: 70px; /* space for sticky header */
}

@media (min-width: 900px) {
  .residence-page {
    flex-direction: row;
    min-height: calc(100vh - 70px);
  }
}

/* --- Left: Image Carousel --- */
.residence__gallery {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  background-color: var(--color-black);
}

@media (min-width: 900px) {
  .residence__gallery {
    width: 55%;
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
  }
}

.residence__gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.residence__gallery-slide.is-active {
  opacity: 1;
}

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

/* Carousel Controls */
.residence__gallery-controls {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 10;
}

.residence__gallery-counter {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  color: var(--color-white);
  letter-spacing: 0.1em;
  font-weight: 300;
}

.residence__gallery-btn {
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.3rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  font-family: var(--font-primary);
  font-weight: 300;
}

.residence__gallery-btn:hover {
  opacity: 1;
}

/* --- Right: Info Panel --- */
.residence__info {
  width: 100%;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 900px) {
  .residence__info {
    width: 45%;
    padding: 4rem 5rem;
    min-height: calc(100vh - 70px);
  }
}

.residence__info-title {
  font-family: var(--font-secondary);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--color-blue-dark);
  margin-bottom: 0.5rem;
}

.residence__info-subtitle {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--color-grey-warm);
  margin-bottom: 2.5rem;
}

.residence__info-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  font-weight: 300;
  color: var(--color-grey-warm);
  margin-bottom: 1.5rem;
  max-width: 450px;
}

.residence__info-desc strong {
  color: var(--color-blue-dark);
  font-weight: 600;
}

/* --- Amenities Icons Grid --- */
.residence__amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(40, 56, 90, 0.1);
}

.residence__amenity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 140px;
}

.residence__amenity-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(40, 56, 90, 0.15);
  flex-shrink: 0;
}

.residence__amenity-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-blue-dark);
  stroke-width: 1.5;
  fill: none;
}

.residence__amenity-label {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: var(--color-blue-dark);
  letter-spacing: 0.05em;
}

/* --- CTA Button --- */
.residence__cta {
  margin-top: 3rem;
}

.residence__cta .btn-sharp {
  padding: 0.9rem 2.5rem;
}

/* --- Back link --- */
.residence__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-grey-warm);
  margin-bottom: 2rem;
  transition: color 0.3s ease;
}

.residence__back:hover {
  color: var(--color-blue-dark);
}

.residence__back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --- Planta Técnica Button --- */
.residence__floorplan-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.8rem;
  background: transparent;
  border: 1px solid rgba(40, 56, 90, 0.2);
  color: var(--color-blue-dark);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 2rem;
}

.residence__floorplan-btn:hover {
  background: var(--color-blue-dark);
  color: var(--color-white);
  border-color: var(--color-blue-dark);
}

.residence__floorplan-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* --- Floorplan Lightbox --- */
.floorplan-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.floorplan-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.floorplan-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  cursor: pointer;
}

.floorplan-lightbox__container {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floorplan-lightbox__slide {
  display: none;
  max-width: 90vw;
  max-height: 85vh;
}

.floorplan-lightbox__slide.is-active {
  display: block;
}

.floorplan-lightbox__slide img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.floorplan-lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 5;
}

.floorplan-lightbox__close svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

.floorplan-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 5;
}

.floorplan-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.floorplan-lightbox__nav svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  stroke-width: 1.5;
  fill: none;
}

.floorplan-lightbox__nav--prev {
  left: -4rem;
}

.floorplan-lightbox__nav--next {
  right: -4rem;
}

/* Hide nav arrows if single floor plan */
.floorplan-lightbox[data-count="1"] .floorplan-lightbox__nav {
  display: none;
}

.floorplan-lightbox__counter {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* Hide counter if single image */
.floorplan-lightbox[data-count="1"] .floorplan-lightbox__counter {
  display: none;
}

@media (max-width: 768px) {
  .floorplan-lightbox__nav--prev { left: 0.5rem; }
  .floorplan-lightbox__nav--next { right: 0.5rem; }
}
