/* InnoPet first-visit refill promo modal (1:1 image — never crop) */
.innopet-promo-modal {
  --promo-pad: 72px;
  --promo-size: min(80vw, calc(100vh - var(--promo-pad)), calc(100dvh - var(--promo-pad)));
  position: fixed;
  inset: 0;
  z-index: 10070;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.innopet-promo-modal[hidden] {
  display: none !important;
}

.innopet-promo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.innopet-promo-modal__frame {
  position: relative;
  z-index: 1;
  width: var(--promo-size);
  max-width: 100%;
  animation: innopetPromoIn 0.32s ease-out;
}

/*
 * Size is always the smaller of width target vs available viewport height,
 * so the box stays 1:1 and never overflows (zoom / short screens / landscape).
 * Mobile target: 80vw. Desktop: 40vw.
 */
.innopet-promo-modal__dialog {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  background: #fff;
}

@media (min-width: 641px) {
  .innopet-promo-modal {
    --promo-size: min(40vw, calc(100vh - var(--promo-pad)), calc(100dvh - var(--promo-pad)));
  }
}

@keyframes innopetPromoIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.innopet-promo-modal__link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.innopet-promo-modal__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Close sits outside the image modal, top-right. */
.innopet-promo-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0b2b5a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.innopet-promo-modal__close:hover {
  background: #fff;
}

.innopet-promo-modal__close svg {
  display: block;
}

body.innopet-promo-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .innopet-promo-modal__frame {
    animation: none;
  }
}
