/* ============================================================
   Creative Popup - style wlasne
   Popup "PUFFasy XL!"  (projekt: Figma "Pop-up na sklep")

   Ten plik jest ladowany AUTOMATYCZNIE na froncie i w edytorze
   (patrz base/cp/scripts.php -> views/css/custom.css).

   Cala grafika (pies, zielone kolo, gryzaki, badge "Nowosc w
   Prozoo!") siedzi w jednym obrazku tla:
       views/img/puffasy-popup-bg.jpg   (1600x1200)
   Tekst + przycisk sa nakladane HTML-em (warstwa HTML w popupie).

   Wymiary popupu 800x600 sa ustawione w BO (canvas), a tekst jest
   pozycjonowany w stalych px wzgledem projektu 800x600.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Asap:wght@400;600;700&family=Calistoga&display=swap');

.puffasy-popup,
.puffasy-popup * {
  box-sizing: border-box;
}

.puffasy-popup {
  position: relative;
  width: 800px;
  height: 600px;
  margin: 0 auto;
  background: #f2e9e3 url("../img/puffasy-popup-bg.jpg") center / cover no-repeat;
  font-family: 'Asap', -apple-system, "Segoe UI", Arial, sans-serif;
  color: #000;
  -webkit-font-smoothing: antialiased;
  white-space: normal;          /* nadpisuje nowrap z .cp-wrapper > .cp-layer */
}

/* ---- blok tekstowy po prawej stronie ---- */
.puffasy-popup__content {
  position: absolute;
  top: 197px;
  left: 412px;
  width: 388px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

/* ---- naglowek: PUFFasy XL! ---- */
.puffasy-popup__title {
  margin: 0;
  font-family: 'Calistoga', Georgia, serif;
  font-weight: 400;
  font-size: 60px;
  line-height: 1.2;             /* 72px */
  color: #000;
  white-space: nowrap;
}

/* ---- opis + smaki ---- */
.puffasy-popup__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 325px;
}

.puffasy-popup__text {
  margin: 0;
  width: 325px;                 /* sekcja tekstu jak w projekcie -> wymusza lamanie */
}

.puffasy-popup__lead {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;             /* 33.6px */
  color: #000;
}

/* pomaranczowe podkreslenie pod "30 cm" */
.puffasy-popup__hl {
  font-weight: 600;
  background: linear-gradient(#fe5602, #fe5602) no-repeat left bottom / 100% 4px;
  padding-bottom: 3px;
}

/* lista smakow (Rabbit / Beef) - wysrodkowana, wypunktowana od lewej */
.puffasy-popup__flavors {
  list-style: disc;
  display: inline-block;
  margin: 8px 0 0;
  padding: 0 0 0 12px;
  text-align: left;
}
.puffasy-popup__flavors li {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.5;            /* Rabbit: 150% */
  color: #000;
}
.puffasy-popup__flavors li:last-child {
  line-height: 1.1;           /* Beef: 110% */
}

/* ---- przycisk: SPRAWDZ ---- */
.puffasy-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 10px 60px;
  background: #fe5602;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;            /* 33.6px */
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.puffasy-popup__btn:hover,
.puffasy-popup__btn:focus {
  background: #e64d00;
  color: #fff;
  transform: translateY(-1px);
}

/* ============================================================
   Przycisk zamkniecia (X) - moduluje domyslny .cp-popup-close-button
   Chcemy czysty bialy X 24x24 w prawym gornym rogu, bez ciemnego kolka.
   ============================================================ */
.cp-popup-close-button {
  left: auto !important;
  right: 0 !important;
  top: -30px !important;        /* POZA popupem - nad prawym gornym rogiem (jak w Figmie) */
  width: 24px !important;
  height: 24px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
.cp-popup-close-button:before,
.cp-popup-close-button:after {
  width: 30px !important;
  height: 3px !important;
  top: 10.5px !important;
  left: -3px !important;
  background: #fff !important;
  border-radius: 2px !important;
}

/* ============================================================
   RESPONSYWNOSC - 2 popupy przelaczane progiem 992px

   WAZNE: celujemy przez klasy z NASZEGO HTML (.puffasy-popup / .puffasy-m),
   ktore zostaja w srodku popupu nawet po przebudowie przez silnik JS.
   (Klasa na .cp-popup bywa gubiona przy przebudowie -> nie uzywamy jej.)
   Dzieki temu NIE trzeba ustawiac zadnej klasy CSS w BO.

   Overlay (przyciemnienie) jest wstawiany tuz przed .cp-popup,
   wiec chowamy go razem z popupem przez :has(+ ...).
   ============================================================ */

/* ekrany <=991px: pokaz tylko MOBILE -> chowamy DESKTOP + jego overlay.
   UWAGA: :has() nie moze byc zagniezdzony, wiec overlay celujemy przez
   :has(+ .cp-popup .puffasy-popup) (pojedynczy :has z relatywnym potomkiem).
   Reguly rozdzielone, by ew. blad jednego selektora nie psul drugiego. */
@media (max-width: 991px) {
  .cp-popup:has(.puffasy-popup) { display: none !important; }
  .cp-popup-overlay:has(+ .cp-popup .puffasy-popup) { display: none !important; }
}

/* ekrany >=992px: pokaz tylko DESKTOP -> chowamy MOBILE + jego overlay */
@media (min-width: 992px) {
  .cp-popup:has(.puffasy-m) { display: none !important; }
  .cp-popup-overlay:has(+ .cp-popup .puffasy-m) { display: none !important; }
}

/* ============================================================
   TLO WOKOL POPUPU (przyciemnienie)

   STARE PODEJSCIE przez .cp-popup-overlay nie dziala, bo GSAP
   (silnik animacji modulu) ciagle nadpisuje inline style overlaya
   (opacity, display), wiec nawet !important w CSS miga i znika.

   NOWE PODEJSCIE: pseudo-element ::before na .cp-popup-visible.
   JavaScript NIE MOZE manipulowac pseudo-elementami, wiec GSAP
   nie jest w stanie tego nadpisac. ::before siedzi w tym samym
   stacking-context co popup (z-index: 9999999 na rodzicu), ale
   z z-index: -1 jest PONIZEJ zawartosci popupu a POWYZEJ strony.

   Klikniecie w przyciemniony obszar nie zamknie popupu (bo
   pseudo-element nie moze miec handlera JS) - uzytkownik
   zamyka X-em lub ESC. Jesli chcesz click-to-close na tle,
   mozesz wlaczyc overlay w panelu admina (Popup -> Overlay).
   ============================================================ */
@media (min-width: 992px) {
  .cp-popup-visible:has(.puffasy-popup)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.40);
    z-index: -1;
    pointer-events: auto;
  }
}
@media (max-width: 991px) {
  .cp-popup-visible:has(.puffasy-m)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.40);
    z-index: -1;
    pointer-events: auto;
  }
}

/* Chowamy oryginalny overlay modulu - nie jest juz potrzebny
   i moze powodowac miganie. */
.cp-popup-overlay {
  display: none !important;
}

/* ============================================================
   POPUP MOBILE - karta pionowa (grafika u gory + tekst pod spodem)
   Canvas w BO: 340 x 505. Reuzywa ten sam obrazek tla.
   ============================================================ */
.puffasy-m,
.puffasy-m * {
  box-sizing: border-box;
}

.puffasy-m {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f2e9e3;
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Asap', -apple-system, "Segoe UI", Arial, sans-serif;
  color: #000;
  white-space: normal;              /* nadpisuje nowrap z .cp-layer */
  -webkit-font-smoothing: antialiased;
}

.puffasy-m__img {
  width: 100%;
  aspect-ratio: 800 / 600;          /* pelna grafika, bez kadrowania */
  background: #f2e9e3 url("../img/puffasy-popup-bg.jpg") center / cover no-repeat;
  flex: none;
}

.puffasy-m__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 22px;
  text-align: center;
}

.puffasy-m__title {
  margin: 0;
  font-family: 'Calistoga', Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: #000;
}

.puffasy-m__text {
  margin: 0;
}

.puffasy-m__lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  text-wrap: balance;
}

.puffasy-m__hl {
  font-weight: 600;
  background: linear-gradient(#fe5602, #fe5602) no-repeat left bottom / 100% 3px;
  padding-bottom: 2px;
}

.puffasy-m__flavors {
  list-style: disc;
  display: inline-block;
  text-align: left;
  margin: 6px 0 0;
  padding: 0 0 0 10px;
}
.puffasy-m__flavors li {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
}
.puffasy-m__flavors li:last-child {
  line-height: 1.2;
}

.puffasy-m__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 0;
  padding: 10px 40px;
  background: #fe5602;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.puffasy-m__btn:hover,
.puffasy-m__btn:focus {
  background: #e64d00;
  color: #fff;
}
