/* ==========================================================================
   CSV STUDIO — PROMOTIONAL POPUP BANNER (RESPONSIVE DESKTOP & MOBILE)
   ========================================================================== */

body.csv-popup-open {
  overflow: hidden !important;
  touch-action: none;
}

.csv-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background-color: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.csv-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.csv-popup-overlay.is-closing {
  opacity: 0;
  visibility: hidden;
}

.csv-popup-dialog {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: scale(0.92) translateY(14px);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.csv-popup-overlay.is-visible .csv-popup-dialog {
  transform: scale(1) translateY(0);
}

.csv-popup-overlay.is-closing .csv-popup-dialog {
  transform: scale(0.92) translateY(14px);
}

/* Close Button [X] */
.csv-popup-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.22s ease;
  padding: 0;
  outline: none;
}

.csv-popup-close:hover {
  background: #f97316;
  border-color: #f97316;
  color: #ffffff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.csv-popup-close:active {
  transform: scale(0.95);
}

.csv-popup-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Banner Link & Media Container */
.csv-popup-link {
  display: block;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  background: #0b0f19;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.csv-popup-link:hover {
  filter: brightness(1.03);
}

.csv-popup-picture {
  display: block;
  width: 100%;
  height: auto;
}

.csv-popup-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
  max-height: 82dvh;
  object-fit: contain;
  border-radius: 20px;
  user-select: none;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .csv-popup-dialog {
    max-width: 360px;
    max-height: 85vh;
    max-height: 85dvh;
  }

  .csv-popup-close {
    top: -12px;
    right: -10px;
    width: 36px;
    height: 36px;
  }

  .csv-popup-link,
  .csv-popup-img {
    border-radius: 16px;
    max-height: 80vh;
    max-height: 80dvh;
  }
}
