/* popup-engine.css — Smart notification popup banner */

.pe-popup {
  position: fixed;
  z-index: 99999;
  bottom: 1.25rem;
  max-width: 380px;
  width: calc(100vw - 2rem);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transform: translateY(30px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  pointer-events: none;
}
.pe-popup.pe-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.pe-popup.pe-bottom-right { right: 1.25rem; }
.pe-popup.pe-bottom-left  { left: 1.25rem;  }

.pe-popup-img {
  width: 110px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.pe-popup-body {
  flex: 1;
  padding: .75rem .9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
  min-width: 0;
}

.pe-popup-headline {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  word-break: break-word;
}

.pe-popup-text {
  font-size: .78rem;
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

.pe-popup-cta {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: .32rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: fit-content;
  margin-top: .1rem;
  transition: opacity .15s;
}
.pe-popup-cta:hover { opacity: .88; }

.pe-popup-close {
  position: absolute;
  top: .45rem;
  right: .55rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.18);
  border-radius: 50%;
  font-size: .65rem;
  color: #fff;
  cursor: pointer;
  border: none;
  padding: 0;
  line-height: 1;
  transition: background .15s;
}
.pe-popup-close:hover { background: rgba(0,0,0,.35); }

@media (max-width: 480px) {
  .pe-popup {
    max-width: calc(100vw - 1.5rem);
    bottom: .75rem;
  }
  .pe-popup.pe-bottom-right { right: .75rem; }
  .pe-popup.pe-bottom-left  { left: .75rem;  }
  .pe-popup-img { width: 88px; }
}


/* ===========================================================================
   Central popup / banner (position = center)
   Layers, bottom to top: background (image or colour) / tint / content / close.
   The image and the content share one grid cell, so the popup is as tall as the image at its
   natural ratio, and grows if the text needs more room.
   Desktop: centred modal over a dimmed page. Phones: a bottom sheet, which suits thumbs and
   keeps the page visible above it.
   =========================================================================== */
html.pe-lock { overflow: hidden; }

.pe-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.pe-overlay.pe-visible { opacity: 1; pointer-events: all; }

.pe-center {
  position: relative;
  display: grid;
  width: min(640px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .15);
  transform: translateY(18px) scale(.97);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.1);
  outline: none;
}
.pe-overlay.pe-visible .pe-center { transform: none; }

.pe-c-img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pe-c-tint { grid-area: 1 / 1; pointer-events: none; }

.pe-c-inner {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.25rem 1.75rem;
  text-align: center;
  min-width: 0;
}
.pe-c-inner > div:empty { display: none; }

.pe-c-headline {
  margin: 0;
  font-size: clamp(1.4rem, 4.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}
.pe-c-body {
  margin: .6rem 0 0;
  font-size: 1.02rem;
  line-height: 1.5;
  word-break: break-word;
}
.pe-c-bullets {
  list-style: none;
  margin: .9rem auto 0;
  padding: 0;
  display: inline-block;
  text-align: left;
  font-size: .98rem;
  line-height: 1.45;
}
.pe-c-bullets li { position: relative; padding-left: 1.5rem; margin: .35rem 0; }
.pe-c-bullets li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  font-weight: 800;
}

.pe-c-cta .pe-popup-cta {
  padding: .85rem 2rem;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

/* CTA placement */
.pe-place-center .pe-c-inner {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
}
.pe-place-center .pe-c-text  { grid-row: 1; align-self: start; }
.pe-place-center .pe-c-cta   { grid-row: 2; }
.pe-place-center .pe-c-timer { grid-row: 3; align-self: end; }
.pe-place-bottom .pe-c-inner { justify-content: flex-start; }
.pe-place-bottom .pe-c-cta   { margin-top: auto; padding-top: .6rem; }

/* Countdown */
.pe-c-timer-wrap { display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.pe-timer-label  { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pe-timer-boxes  { display: flex; gap: .5rem; }
.pe-tbox {
  min-width: 3.5rem;
  padding: .5rem .4rem .4rem;
  border-radius: 10px;
  background: rgba(17, 24, 39, .88);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.pe-tbox[hidden] { display: none; }
.pe-tbox b { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pe-tbox span { margin-top: .25rem; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }

.pe-c-close {
  top: .7rem;
  right: .7rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  font-size: .85rem;
  background: rgba(0, 0, 0, .5);
}
.pe-c-close:hover { background: rgba(0, 0, 0, .75); }
.pe-c-close:focus-visible, .pe-popup-cta:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* Phones: bottom sheet */
@media (max-width: 640px) {
  .pe-overlay { align-items: flex-end; padding: 0; }
  .pe-center {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform .34s cubic-bezier(.2, .9, .3, 1);
  }
  .pe-overlay.pe-visible .pe-center { transform: none; }
  .pe-c-inner { padding: 2rem 1.25rem 1.75rem; }
  .pe-c-cta .pe-popup-cta { width: 100%; justify-content: center; }
  .pe-tbox { min-width: 3.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pe-overlay, .pe-center, .pe-popup { transition: none; }
}
