/**
 * Telegram Favorites Popup — Egoist Estate
 * Mobile-first: bottom-sheet on mobile, centered card on desktop.
 * Brand tokens: navy #14345b, orange #E8953A, bg #f7f9fa.
 * @since 2026-06-08
 */

/* ── Backdrop ────────────────────────────────────────────── */
.tg-popup__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 52, 91, 0.55); /* navy @ 55% */
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.28s ease;
  /* Prevent tap-through on iOS */
  -webkit-tap-highlight-color: transparent;
}

.tg-popup__backdrop--visible {
  opacity: 1;
}

/* ── Card — mobile-first (bottom-sheet) ──────────────────── */
.tg-popup__card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: #ffffff;
  border-radius: 18px 18px 0 0;
  padding: 28px 24px 32px;
  box-shadow: 0 -6px 32px rgba(20, 52, 91, 0.18);

  /* Slide-up enter animation */
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity   0.28s ease;

  /* Cap width on very wide mobile screens */
  max-width: 540px;
  margin: 0 auto;
}

.tg-popup__card--visible {
  transform: translateY(0);
  opacity: 1;
}

/* ── Close button ────────────────────────────────────────── */
.tg-popup__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f3f7;
  color: #5a6475;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.tg-popup__close:hover,
.tg-popup__close:focus-visible {
  background: #e2e8f0;
  color: #14345b;
  outline: 2px solid #14345b;
  outline-offset: 2px;
}

/* ── Title ───────────────────────────────────────────────── */
.tg-popup__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #14345b;
  line-height: 1.3;
  margin-bottom: 10px;
  padding-right: 28px; /* clear the × button */
}

/* ── Body copy ───────────────────────────────────────────── */
.tg-popup__body {
  font-size: 0.92rem;
  color: #5a6475;
  line-height: 1.55;
  margin-bottom: 20px;
}

/* ── CTA button ──────────────────────────────────────────── */
.tg-popup__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px 20px;
  background: #E8953A;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
  text-align: center;
}

.tg-popup__cta:hover {
  background: #cf5e2a;
}

.tg-popup__cta:active {
  transform: scale(0.98);
}

.tg-popup__cta:focus-visible {
  outline: 3px solid #14345b;
  outline-offset: 3px;
}

/* ── Telegram icon inside CTA ────────────────────────────── */
.tg-popup__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-block;
  /* Override global img rule that sets display:block */
  vertical-align: middle;
}

/* ── Reassurance note ────────────────────────────────────── */
.tg-popup__note {
  font-size: 0.78rem;
  color: #8a95a3;
  text-align: center;
  margin-top: 12px;
  line-height: 1.4;
}

/* ── Desktop overrides (≥ 640px) ─────────────────────────── */
@media (min-width: 640px) {
  .tg-popup__card {
    /* Centered, floating card */
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translate(-50%, calc(-50% + 24px));
    opacity: 0;
    border-radius: 18px;
    padding: 0;
    width: 660px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(20, 52, 91, 0.22);
    /* Re-declare transition for desktop enter */
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity   0.28s ease;
  }

  .tg-popup__card--visible {
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  .tg-popup__title {
    font-size: 1.25rem;
  }

  .tg-popup__body {
    font-size: 0.95rem;
  }
}

/* ── Reduced-motion override ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tg-popup__backdrop,
  .tg-popup__card {
    transition: opacity 0.15s ease;
  }

  .tg-popup__card {
    transform: translateY(0) !important;
  }

  @media (min-width: 640px) {
    .tg-popup__card {
      transform: translate(-50%, -50%) !important;
    }
  }
}

/* 08.06.2026 — scenic photo LEFT + content RIGHT on desktop (premium); mobile stays text-only bottom-sheet */
.tg-popup__img { display: none; }
@media (min-width: 640px) {
  .tg-popup__img {
    display: block;
    width: 46%;
    min-width: 230px;
    object-fit: cover;
    align-self: stretch;
    margin: 0;
    border-radius: 0;
  }
  .tg-popup__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    padding: 32px 32px 28px;
  }
}
