/* ===========================
   INTERFAZ MONTERREY — Sistema de Popups Premium v1
   =========================== */

/* ── Backdrop ────────────────────────────────────────────────── */
.im-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: imFadeIn 0.3s ease;
}
.im-popup-backdrop.im-exit { z-index: 3100; }

/* ── Panel ───────────────────────────────────────────────────── */
.im-popup-panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 360px;
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 50px 150px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: imScaleIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.im-exit-panel {
  max-width: 500px;
  grid-template-columns: 1fr;
}

/* ── Close ───────────────────────────────────────────────────── */
.im-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(10px);
}
.im-popup-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* ── Content ─────────────────────────────────────────────────── */
.im-popup-content {
  padding: 50px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.im-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 22px;
  width: fit-content;
  background: rgba(229, 9, 20, 0.13);
  border: 1px solid rgba(229, 9, 20, 0.26);
  color: #ff5060;
}
.im-popup-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: imBlink 2.2s ease-in-out infinite;
}

.im-popup-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.5vw, 56px);
  line-height: 1;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.im-popup-sub {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.48);
  margin-bottom: 34px;
  max-width: 360px;
}

.im-popup-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.im-popup-btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.im-popup-btn:active { transform: scale(0.97) !important; }

.im-popup-btn-primary {
  background: #e50914;
  color: #fff;
  box-shadow: 0 4px 20px rgba(229, 9, 20, 0.38);
}
.im-popup-btn-primary:hover {
  background: #ff1f2a;
  box-shadow: 0 6px 28px rgba(229, 9, 20, 0.55);
  transform: translateY(-1px);
  color: #fff;
}
.im-popup-btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.im-popup-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ── Visual (right column) ───────────────────────────────────── */
.im-popup-visual {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Themes */
.im-popup-visual[data-theme="corp"]       { background: linear-gradient(150deg, #07122a 0%, #0e2454 55%, #071428 100%); }
.im-popup-visual[data-theme="rent"]       { background: linear-gradient(150deg, #180406 0%, #3c0c12 55%, #180406 100%); }
.im-popup-visual[data-theme="shure"]      { background: linear-gradient(150deg, #090909 0%, #1a1a1a 55%, #090909 100%); }
.im-popup-visual[data-theme="enterprise"] { background: linear-gradient(150deg, #020d14 0%, #0b2538 55%, #020d14 100%); }

.im-pv-glow { position: absolute; inset: 0; }
.im-popup-visual[data-theme="corp"]       .im-pv-glow { background: radial-gradient(ellipse at 55% 40%, rgba(59,130,246,0.22) 0%, transparent 68%); }
.im-popup-visual[data-theme="rent"]       .im-pv-glow { background: radial-gradient(ellipse at 50% 40%, rgba(229,9,20,0.28) 0%, transparent 68%); }
.im-popup-visual[data-theme="shure"]      .im-pv-glow { background: radial-gradient(ellipse at 50% 40%, rgba(229,9,20,0.18) 0%, transparent 68%); }
.im-popup-visual[data-theme="enterprise"] .im-pv-glow { background: radial-gradient(ellipse at 50% 40%, rgba(6,182,212,0.18) 0%, transparent 68%); }

.im-pv-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ── Neón lines ──────────────────────────────────────────────── */
.im-pv-neon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.im-nl-1 { animation: imNeonPulse1 4s ease-in-out infinite; }
.im-nl-2 { animation: imNeonPulse2 4s ease-in-out infinite 0.8s; }
@keyframes imNeonPulse1 {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.55; }
}
@keyframes imNeonPulse2 {
  0%,100% { opacity: 0.7; }
  50%     { opacity: 1; }
}

/* ── Mic icon ─────────────────────────────────────────────────── */
.im-pv-icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.im-pv-icon.im-pv-fallback { display: none; }
.im-pv-mic-svg {
  width: 130px;
  height: 273px;
  filter:
    drop-shadow(0 0 18px rgba(0,0,0,0.9))
    drop-shadow(0 24px 40px rgba(0,0,0,0.8));
  animation: imMicIn 0.7s cubic-bezier(0.16,1,0.3,1) both 0.1s,
             imMicFloat 5s ease-in-out infinite 1s;
}
@keyframes imMicIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes imMicFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

/* ── Platform glow ───────────────────────────────────────────── */
.im-pv-platform {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 10px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  animation: imPlatformPulse 5s ease-in-out infinite 1s;
}
.im-popup-visual[data-theme="corp"]       .im-pv-platform { background: radial-gradient(ellipse, rgba(74,158,255,0.5) 0%, transparent 70%); }
.im-popup-visual[data-theme="rent"]       .im-pv-platform { background: radial-gradient(ellipse, rgba(255,59,59,0.5)  0%, transparent 70%); }
.im-popup-visual[data-theme="shure"]      .im-pv-platform { background: radial-gradient(ellipse, rgba(229,20,30,0.5)  0%, transparent 70%); }
.im-popup-visual[data-theme="enterprise"] .im-pv-platform { background: radial-gradient(ellipse, rgba(6,212,200,0.5)  0%, transparent 70%); }
@keyframes imPlatformPulse {
  0%,100% { opacity: 1;   transform: translateX(-50%) scaleX(1);    }
  50%     { opacity: 0.5; transform: translateX(-50%) scaleX(0.75); }
}

@keyframes imPvImgIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.im-pv-tagline {
  position: absolute;
  bottom: -12px;
  right: -4px;
  font-family: var(--font-display);
  font-size: 86px;
  line-height: 1;
  letter-spacing: -4px;
  color: #fff;
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ── Exit popup ──────────────────────────────────────────────── */
.im-exit-panel .im-popup-content {
  padding: 46px 42px 42px;
  align-items: center;
  text-align: center;
}
.im-exit-panel .im-popup-title  { font-size: clamp(30px, 5vw, 42px); }
.im-exit-panel .im-popup-sub    { text-align: center; max-width: 360px; margin-bottom: 28px; }
.im-exit-panel .im-popup-actions { justify-content: center; }

/* ── Product notification ────────────────────────────────────── */
.im-prod-notif {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  background: rgba(9, 9, 9, 0.97);
  border: 1px solid rgba(229, 9, 20, 0.2);
  border-radius: 100px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(229,9,20,0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  pointer-events: all;
}
.im-prod-notif.visible { transform: translateX(-50%) translateY(0); }

.im-pn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e50914;
  flex-shrink: 0;
  animation: imBlink 2s ease-in-out infinite;
}
.im-pn-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}
.im-pn-cta {
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.im-pn-cta:hover { background: #ff1f2a; }
.im-pn-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.28);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.im-pn-close:hover { color: rgba(255,255,255,0.65); }

/* ── WhatsApp tooltip ────────────────────────────────────────── */
.whatsapp-float { overflow: visible !important; }

.wa-tip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(8, 8, 8, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.28s ease, transform 0.28s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.wa-tip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: rgba(8, 8, 8, 0.97);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-top: 1px solid rgba(255,255,255,0.1);
  transform: translateY(-50%) rotate(45deg);
}
.whatsapp-float:hover .wa-tip,
.whatsapp-float.wa-tip-show .wa-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes imFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes imScaleIn {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes imBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
@keyframes imSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0);    }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  /* Welcome → bottom sheet */
  .im-popup-backdrop:not(.im-exit) {
    align-items: flex-end;
    padding: 0;
  }
  .im-popup-panel:not(.im-exit-panel) {
    grid-template-columns: 1fr;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    animation: imSlideUp 0.44s cubic-bezier(0.16, 1, 0.3, 1);
  }
  /* Visual on top */
  .im-popup-visual {
    order: -1;
    min-height: 148px;
  }
  .im-pv-tagline {
    font-size: 52px;
    letter-spacing: -2px;
    bottom: 4px;
    right: 12px;
  }
  /* Content */
  .im-popup-content { padding: 26px 22px 30px; }
  .im-popup-title   { font-size: clamp(32px, 8vw, 44px); margin-bottom: 12px; }
  .im-popup-sub     { font-size: 13px; margin-bottom: 22px; }
  .im-popup-btn     { padding: 10px 18px; font-size: 13px; }

  /* Exit stays centered */
  .im-popup-backdrop.im-exit { align-items: center; padding: 20px; }
  .im-exit-panel {
    max-width: 100%;
    border-radius: 16px;
    animation: imScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .im-exit-panel .im-popup-content { padding: 36px 24px 32px; }

  /* Product notif — full width strip above WA */
  .im-prod-notif {
    left: 12px;
    right: 12px;
    bottom: 84px;
    transform: translateX(0) translateY(calc(100% + 40px));
    border-radius: 14px;
    white-space: normal;
    flex-wrap: wrap;
    gap: 8px;
  }
  .im-prod-notif.visible { transform: translateX(0) translateY(0); }

  /* WA tooltip off on mobile */
  .wa-tip { display: none; }
}
