/* The «نسکافه طلایی» offer (partials/promo-popup.blade.php), on every page. The same lightbox as the
   50% credit card on the home page (home.css, .offer-modal): the page dimmed and softly blurred,
   the card fading and rising into place, a white × on its top left corner. Over the card's top edge
   a gold line runs down for the time it stays open. */

.promo-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  overflow: hidden;
  overscroll-behavior: contain;
}

.promo-modal[open] {
  display: grid;
  place-items: center;
}

.promo-modal::backdrop {
  background: rgba(10, 16, 34, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

.promo-modal.is-open::backdrop {
  opacity: 1;
  transition: opacity 0.28s ease-out;
}

.promo-modal__frame {
  position: relative;
  outline: none;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity 0.18s ease-in,
    transform 0.18s ease-in;
}

.promo-modal.is-open .promo-modal__frame {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* the card: the picture with the line over its top edge, both inside its rounded corners */
.promo-modal__card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background-color: #0a4a9c;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  /* Safari: keeps the picture inside the rounded corners while the card animates */
  isolation: isolate;
}

.promo-modal__call {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.promo-modal__call:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
  border-radius: 20px;
}

/* as large as the screen allows, never wider than 720px, always whole */
.promo-modal__image {
  display: block;
  width: auto;
  height: auto;
  /* 20px clear of the screen each side, so the × on its corner stays clear of the edge */
  max-width: min(calc(100vw - 40px), 720px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
}

/* The time left: a gold line across the top edge, running down from left to right, toward the
   start of the reading line. Drawn by promo-popup.js. */
.promo-modal__timer {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.promo-modal__timer-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0 0 0 6px;
  background: linear-gradient(90deg, #ffe58a 0%, #ffc928 45%, #f5a300 100%);
  box-shadow: 0 0 10px rgba(255, 201, 40, 0.75);
  transform-origin: right center;
  will-change: transform;
}

/* the ×: a white disc on the card's top corner, at the end of the reading line */
.promo-modal__close {
  position: absolute;
  top: -14px;
  left: -14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #fff;
  color: #1f2937;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* a 48px touch round the 40px disc */
.promo-modal__close::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.promo-modal__close:hover {
  transform: scale(1.08);
}

.promo-modal__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .promo-modal__frame,
  .promo-modal.is-open .promo-modal__frame {
    transform: none;
  }
}
