/* ================================================================
   Torre B Promotional Popup — Immersive Real Estate Design
   ================================================================ */

/* ── Overlay backdrop ── */
.tower-b-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tower-b-popup.is-visible {
  display: flex;
  opacity: 1;
}

/* ── Dialog card ── */
.tower-b-popup__dialog {
  position: relative;
  width: min(1020px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 28px;
  background: #0b1023;
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 80px rgba(27, 111, 88, 0.08);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition:
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tower-b-popup.is-visible .tower-b-popup__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Grid layout: image + content ── */
.tower-b-popup__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 540px;
}

/* ── Image panel ── */
.tower-b-popup__media {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.tower-b-popup__media img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
  display: block;
  transform: scale(1.12);
  transition: transform 6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tower-b-popup.is-visible .tower-b-popup__media img {
  transform: scale(1);
}

/* Cinematic gradient over image */
.tower-b-popup__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 40%, #0b1023 100%),
    linear-gradient(180deg, rgba(11, 16, 35, 0.1) 0%, rgba(11, 16, 35, 0.5) 100%);
  pointer-events: none;
}

/* ── Discount tag ── */
.tower-b-popup__discount-tag {
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f96305 0%, #ff8534 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 28px rgba(249, 99, 5, 0.45);
  opacity: 0;
  transform: translateY(-10px);
}

.tower-b-popup.is-visible .tower-b-popup__discount-tag {
  animation: tbPopFadeDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both,
    tbDiscountGlow 2.5s ease-in-out 1s infinite alternate;
}

@keyframes tbDiscountGlow {
  0% {
    box-shadow: 0 8px 28px rgba(249, 99, 5, 0.45);
  }
  100% {
    box-shadow: 0 8px 40px rgba(249, 99, 5, 0.7), 0 0 20px rgba(249, 99, 5, 0.2);
  }
}

/* ── Construction badge ── */
.tower-b-popup__badge {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(15px);
}

.tower-b-popup.is-visible .tower-b-popup__badge {
  animation: tbPopFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.tower-b-popup__badge:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Content panel ── */
.tower-b-popup__content {
  position: relative;
  padding: 54px 48px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #0b1023;
  overflow: hidden;
}

/* Decorative accent line */
.tower-b-popup__content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #1b6f58 0%, #f96305 50%, transparent 100%);
  opacity: 0;
}

.tower-b-popup.is-visible .tower-b-popup__content::before {
  animation: tbAccentLine 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes tbAccentLine {
  0% {
    opacity: 0;
    height: 0;
  }
  100% {
    opacity: 1;
    height: 100%;
  }
}

/* Subtle glow in content area */
.tower-b-popup__content::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 111, 88, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Eyebrow label ── */
.tower-b-popup__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #1b6f58;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
}

.tower-b-popup__eyebrow i {
  font-size: 10px;
}

.tower-b-popup.is-visible .tower-b-popup__eyebrow {
  animation: tbPopFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

/* ── Title ── */
.tower-b-popup__content h2 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  opacity: 0;
}

.tower-b-popup.is-visible .tower-b-popup__content h2 {
  animation: tbPopFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* ── Paragraph ── */
.tower-b-popup__content p {
  margin: 0 0 32px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  line-height: 1.65;
  max-width: 340px;
  opacity: 0;
}

.tower-b-popup.is-visible .tower-b-popup__content p {
  animation: tbPopFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both;
}

/* ── Action buttons ── */
.tower-b-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0;
}

.tower-b-popup.is-visible .tower-b-popup__actions {
  animation: tbPopFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.52s both;
}

.tower-b-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tower-b-popup__btn:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

/* Primary button */
.tower-b-popup__btn--primary {
  background: linear-gradient(135deg, #1b6f58 0%, #22896c 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(27, 111, 88, 0.35);
}

.tower-b-popup__btn--primary:hover {
  background: linear-gradient(135deg, #22896c 0%, #28a07d 100%);
  color: #fff;
  box-shadow: 0 14px 40px rgba(27, 111, 88, 0.5);
}

/* Ghost button */
.tower-b-popup__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
}

.tower-b-popup__btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Secondary button (unused now, keep for flexibility) */
.tower-b-popup__btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tower-b-popup__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ── Close button ── */
.tower-b-popup__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.tower-b-popup.is-visible .tower-b-popup__close {
  animation: tbPopFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.tower-b-popup__close:hover {
  transform: rotate(90deg) scale(1.08);
  background: rgba(249, 99, 5, 0.15);
  border-color: rgba(249, 99, 5, 0.3);
  color: #f96305;
}

/* ── Scroll lock ── */
body.tower-b-popup-open {
  overflow: hidden !important;
}

/* ── Shared keyframes ── */
@keyframes tbPopFadeUp {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tbPopFadeDown {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 991px) {
  .tower-b-popup__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tower-b-popup__media::after {
    background:
      linear-gradient(180deg, transparent 30%, #0b1023 100%);
  }
}

@media (max-width: 767px) {
  .tower-b-popup {
    padding: 12px;
  }

  .tower-b-popup__dialog {
    border-radius: 22px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .tower-b-popup__media,
  .tower-b-popup__media img {
    min-height: 280px;
    height: 280px;
  }

  .tower-b-popup__content {
    padding: 32px 28px 32px;
  }

  .tower-b-popup__content::before {
    display: none;
  }

  .tower-b-popup__content h2 {
    font-size: 2.2rem;
  }

  .tower-b-popup__content p {
    max-width: 100%;
  }

  .tower-b-popup__actions {
    flex-direction: column;
  }

  .tower-b-popup__btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tower-b-popup__media,
  .tower-b-popup__media img {
    min-height: 220px;
    height: 220px;
  }

  .tower-b-popup__content {
    padding: 26px 22px 28px;
  }

  .tower-b-popup__content h2 {
    font-size: 1.85rem;
  }
}
