/* ==========================================================================
   IMTEX 2027 – Popup + Floating Tab  |  UPTECH PRECISION PVT LTD
   Every selector is prefixed .imtex-2027- so nothing clashes with the site CSS.
   ========================================================================== */

.imtex-2027-overlay,
.imtex-2027-floating-tab { font-family: inherit; }
.imtex-2027-overlay *, .imtex-2027-floating-tab * { box-sizing: border-box; }

/* ---------- Background scroll lock ---------- */
html.imtex-2027-lock, body.imtex-2027-lock { overflow: hidden !important; }
body.imtex-2027-lock { padding-right: var(--imtex-2027-sbw, 0px); }

/* ---------- Dark transparent overlay ---------- */
.imtex-2027-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 14, 0.78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.imtex-2027-overlay.is-open    { display: flex; }
.imtex-2027-overlay.is-visible { opacity: 1; }

/* ---------- Popup (poster) ----------
   Width never exceeds: 820px, the screen width, or what fits the screen height
   (poster ratio 690 : 467 = 1.477) – so it is never cut off, on any device. */
.imtex-2027-modal {
  position: relative;
  width: min(750px, 100%, calc((100vh - 32px) * 1.5));
  width: min(750px, 100%, calc((100vh - 32px) * 1.5));

  margin: 0;
  opacity: 0;
  transform: scale(0.9) translateY(14px);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}
.imtex-2027-overlay.is-visible .imtex-2027-modal { opacity: 1; transform: scale(1) translateY(0); }
.imtex-2027-overlay.is-closing .imtex-2027-modal {
  opacity: 0;
  transform: scale(0.95) translateY(8px);
  transition-duration: 0.22s;
}
.imtex-2027-overlay.is-closing { transition-duration: 0.22s; }

.imtex-2027-content {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  /* soft premium shadow that follows the rounded poster */
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(30, 130, 200, 0.25));
}

/* ---------- Close button (transparent hit-area over the × in the poster) ---------- */
.imtex-2027-close {
  position: absolute;
  left: 93.9%;
  top: 3.3%;
  width: max(44px, 6%);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.imtex-2027-close:hover { background: rgba(255, 255, 255, 0.18); box-shadow: 0 0 0 3px rgba(242, 107, 33, 0.7); }
.imtex-2027-close:focus-visible { outline: none; box-shadow: 0 0 0 3px #ffc928; }

/* ---------- Floating tab (image) – LEFT side ---------- */
.imtex-2027-floating-tab {
  position: fixed;
  top: 50%;
  left: 4px;
  z-index: 2147482000;               /* above the site, below the popup */
  width: 74px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.25s ease, filter 0.25s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(3px 5px 8px rgba(0, 0, 0, 0.35));
  animation: imtex-2027-tab-in 0.6s ease 0.4s both, imtex-2027-nudge 4s ease-in-out 3s infinite;
}
.imtex-2027-floating-tab img { display: block; width: 100%; height: auto; pointer-events: none; }
.imtex-2027-floating-tab:hover,
.imtex-2027-floating-tab:focus-visible {
  transform: translateY(-50%) translateX(5px) scale(1.06);
  filter: drop-shadow(6px 8px 12px rgba(0, 0, 0, 0.45));
  animation-play-state: paused;
  outline: none;
}
.imtex-2027-floating-tab:focus-visible { filter: drop-shadow(0 0 0 #000) drop-shadow(0 0 5px #ffc928); }

@keyframes imtex-2027-tab-in {
  from { opacity: 0; transform: translateY(-50%) translateX(-30px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
/* tiny periodic nudge to draw the eye without being distracting */
@keyframes imtex-2027-nudge {
  0%, 88%, 100% { transform: translateY(-50%) translateX(0); }
  92%           { transform: translateY(-50%) translateX(5px); }
  96%           { transform: translateY(-50%) translateX(0); }
}

/* ---------- Tablet ---------- */
@media (min-width: 601px) and (max-width: 1024px) {
  .imtex-2027-floating-tab { width: 64px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .imtex-2027-overlay { padding: 12px; }
  .imtex-2027-floating-tab {
    width: 46px;
    top: 42%;                          /* clear of header, hamburger and bottom chat/WhatsApp buttons */
    left: max(2px, env(safe-area-inset-left, 0px));
  }
}
@media (max-height: 480px) and (orientation: landscape) {
  .imtex-2027-floating-tab { top: 50%; width: 42px; }
}

/* ---------- Accessibility / print ---------- */
@media (prefers-reduced-motion: reduce) {
  .imtex-2027-overlay, .imtex-2027-modal, .imtex-2027-floating-tab, .imtex-2027-close {
    transition: none !important; animation: none !important;
  }
}
@media print { .imtex-2027-overlay, .imtex-2027-floating-tab { display: none !important; } }
