/* ==========================================================================
   Okazje zestawów — style ładowane WYŁĄCZNIE razem z zestawy-okazje.js
   (partials/footer.php, ten sam warunek: conversion.marketingPopupsEnabled
   i strona dozwolona). Popupy startują wyłączone, więc zwykły odwiedzający
   nie pobiera ani bajtu z tego pliku. Tokeny (--bg-elevated, --radius-lg…)
   pochodzą ze style.css, który zawsze ładuje się wcześniej.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Okazje zestawów (components/offer-host.php, zestawy-okazje.js): modal
   (bottom sheet poniżej 640 px, karta na środku powyżej) i cienki pasek na
   dole. Modal i Quick Add nigdy nie są otwarte naraz (ta sama warstwa 91).
   --------------------------------------------------------------------------- */
.offer-scrim {
  position: fixed;
  inset: 0;
  z-index: 91;
  background: rgba(4, 2, 12, 0.72);
}

.offer-panel {
  position: fixed;
  z-index: 91;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 26px 20px calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  /* Fioletowa i różowa łuna po przekątnej — jak neonowa karta pakietu w koszyku. */
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(145, 99, 255, 0.3), transparent 70%),
    radial-gradient(360px 240px at 100% 100%, rgba(232, 121, 249, 0.16), transparent 70%),
    var(--bg-elevated);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(145, 99, 255, 0.25);
  color: var(--text);
}

.offer-anim {
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.offer-off {
  transform: translateY(100%);
}

.offer-on {
  transform: translateY(0);
}

.offer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.offer-close:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.offer-close svg,
.offer-sticky-close svg {
  width: 20px;
  height: 20px;
}

/* ---- Wizytówka pakietu: zdjęcie, nazwa, duża neonowa oszczędność ----
   Pod przyciskiem „Zamknij" (margin-top), żeby go nie zasłaniała. Panel się
   przewija (overflow), więc blask ramki świeci do środka — zewnętrzny byłby
   ucięty w twardy pas (jak w oknie „Dodano do koszyka"). */
.offer-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding: 14px;
  border: 1px solid rgba(171, 139, 255, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(109, 40, 217, 0.3), rgba(232, 121, 249, 0.08)),
    rgba(9, 6, 15, 0.5);
}

.offer-hero.neon-frame:not(.is-done)::before,
.offer-hero.neon-frame:not(.is-done)::after {
  inset: 0;
}

.offer-hero.neon-frame:not(.is-done)::after {
  box-shadow: inset 0 0 18px rgba(145, 99, 255, 0.6), inset 0 0 44px rgba(232, 121, 249, 0.2);
}

.offer-media {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--violet-400);
  border-radius: 18px;
  box-shadow: 0 0 18px rgba(145, 99, 255, 0.55);
  animation: offer-float 3.2s ease-in-out infinite;
}

.offer-media img,
.offer-option-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offer-hero-text {
  min-width: 0;
}

.offer-kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--violet-300);
}

.offer-save {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #6ee7b7;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.75), 0 0 32px rgba(52, 211, 153, 0.4);
  font-variant-numeric: tabular-nums;
  animation: neon-flicker 5s linear 1.2s infinite;
}

.offer-save-note {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.offer-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}

/* Cena za sztukę: stara przekreślona, nowa duża ze świeceniem. */
.offer-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 12px;
}

.offer-price-old {
  font-size: 1rem;
  color: var(--text-dim);
  text-decoration-thickness: 2px;
}

.offer-price-new {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 18px rgba(196, 174, 255, 0.55);
}

.offer-price-unit {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* „Masz już 3 z 10 w koszyku" + ten sam neonowy pasek co na karcie koszyka (.pack-bar ze style.css). */
.offer-progress {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.offer-progress-text {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--violet-300);
}

.offer-progress .pack-bar {
  margin-top: 8px;
}

@keyframes offer-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.offer-body {
  margin-top: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.offer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.offer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.offer-option-media {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.offer-option-text {
  flex: 1 1 auto;
  min-width: 0;
}

.offer-option-save {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.offer-option-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.offer-option-line {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--violet-300);
}

.offer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

/* Drugi wybór zawsze na widoku: zamyka jak „×" (3 dni ciszy dla tego typu okazji). */
.offer-later {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 0.875rem;
  cursor: pointer;
}

.offer-later:hover {
  color: var(--text);
}

.offer-option .offer-option-cta {
  width: auto;
  min-height: 44px;
  margin-top: 0;
  flex-shrink: 0;
}

.offer-sticky {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px) 16px;
  border-top: 1px solid rgba(171, 139, 255, 0.35);
  background: rgba(20, 15, 34, 0.96);
  color: var(--text);
}

.offer-sticky-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
}

.offer-sticky-cta {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(171, 139, 255, 0.45);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--violet-300);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.offer-sticky-close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.offer-close:focus-visible,
.offer-cta:focus-visible,
.offer-later:focus-visible,
.offer-sticky-cta:focus-visible,
.offer-sticky-close:focus-visible {
  outline: 2px solid var(--violet-400);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .offer-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(460px, calc(100vw - 32px));
    padding: 28px 26px 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    transform: translate(-50%, -50%);
  }

  .offer-off {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 16px));
  }

  .offer-on {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .offer-anim {
    transition: opacity var(--dur-fast) linear;
  }

  .offer-media,
  .offer-save {
    animation: none;
  }

  .offer-off {
    opacity: 0;
    transform: none;
  }

  .offer-on {
    transform: none;
  }

  @media (min-width: 640px) {
    .offer-off,
    .offer-on {
      transform: translate(-50%, -50%);
    }
  }
}
