/* ASV Installment Popup — Black Friday / campaign */

html.asv-inst-popup-lock,
html.asv-inst-popup-lock body {
  overflow: hidden;
}

.asv-inst-popup {
  --asv-inst-z: 99990;
  --asv-inst-gap: 14px;
  --asv-inst-panel-w: min(180px, calc(100vw - 48px));
  position: fixed;
  inset: 0;
  z-index: var(--asv-inst-z);
  pointer-events: none;
  font-family: inherit;
}

.asv-inst-popup.is-hidden {
  display: none !important;
}

/* Frosted glass backdrop — whole page except the GIF panel */
.asv-inst-popup__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(15, 15, 20, 0.28);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.asv-inst-popup.is-open .asv-inst-popup__backdrop {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.asv-inst-popup__panel {
  position: fixed;
  left: 20px;
  top: 50%;
  width: var(--asv-inst-panel-w);
  max-height: calc(100vh - 40px);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
  transform: translateY(-50%) translateX(-12px);
}

.asv-inst-popup.is-open .asv-inst-popup__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.asv-inst-popup__media {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  line-height: 0;
}

.asv-inst-popup__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 48px);
  object-fit: contain;
}

/* Close button — outside, top-right of panel */
.asv-inst-popup__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 2;
  padding: 0;
  transform-origin: center;
  transition: background 0.15s ease;
}

.asv-inst-popup__close:hover,
.asv-inst-popup__close:focus-visible {
  background: #e11d48;
  outline: none;
  animation: none;
  transform: scale(1.08);
}

/* Attention pulse after GIF appears — amateur-friendly close hint */
.asv-inst-popup.is-open .asv-inst-popup__close.is-attention {
  animation: asv-inst-close-attention 0.75s ease-in-out 0.35s 4;
}

@keyframes asv-inst-close-attention {

  0%,
  100% {
    transform: scale(1);
    background: #111;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  40% {
    transform: scale(1.28);
    background: #e11d48;
    box-shadow: 0 0 0 8px rgba(225, 29, 72, 0.28), 0 6px 18px rgba(0, 0, 0, 0.4);
  }

  70% {
    transform: scale(0.94);
    background: #111;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .asv-inst-popup.is-open .asv-inst-popup__close.is-attention {
    animation: none;
  }
}

/* Left-edge reopen tab (middle) */
.asv-inst-popup__tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 64px;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: #111;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.28);
  z-index: calc(var(--asv-inst-z) + 1);
  padding: 0;
  transition: background 0.15s ease, width 0.15s ease;
}

.asv-inst-popup.is-collapsed .asv-inst-popup__tab {
  display: flex;
}

.asv-inst-popup__tab:hover,
.asv-inst-popup__tab:focus-visible {
  background: #e11d48;
  width: 32px;
  outline: none;
}

.asv-inst-popup__tab-arrow {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  transform: translateX(1px);
}

@media (max-width: 575.98px) {
  .asv-inst-popup__panel {
    left: 12px;
    width: min(170px, calc(100vw - 52px));
    transform: translateY(-50%) translateX(-12px);
  }

  .asv-inst-popup.is-open .asv-inst-popup__panel {
    transform: translateY(-50%) translateX(0);
  }

  .asv-inst-popup__close {
    top: -14px;
    right: -8px;
  }

  .asv-inst-popup__backdrop {
    background: rgba(15, 15, 20, 0.34);
  }
}