.offer-page {
  background: var(--paper);
  color: var(--ink);
}

.offer-hero {
  position: relative;
  min-height: 860px;
  padding: 154px max(24px, calc((100vw - 1420px) / 2)) 86px;
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr);
  align-items: center;
  gap: 80px;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy);
  color: var(--paper);
}

.offer-hero::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: 0 0 0 auto;
  width: 49%;
  background: var(--blue);
  border-bottom-left-radius: 48% 26%;
}

.offer-grid {
  position: absolute;
  z-index: -4;
  inset: 0;
  opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, black, transparent 76%);
}

.offer-hero__copy { position: relative; z-index: 2; max-width: 710px; }
.offer-hero__copy h1 {
  max-width: 760px;
  font-size: clamp(58px, 6.2vw, 96px);
}
.offer-hero__copy > p:not(.section-kicker) { max-width: 640px; margin: 32px 0 0; color: rgba(251,248,241,.74); font-size: 18px; line-height: 1.7; }
.offer-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.offer-math::before { content: "x²"; position: absolute; right: -20px; top: 30px; color: rgba(45,72,155,.04); font-family: var(--font-display); font-size: 270px; font-weight: 900; }

@media (max-width:1100px) {
  .offer-hero { gap: 42px; grid-template-columns: minmax(380px,.86fr) minmax(500px,1.14fr); }
}

@media (max-width:820px) {
  .offer-hero { min-height: auto; padding: 120px 20px 76px; grid-template-columns: 1fr; gap: 54px; }
  .offer-hero::before { width: 100%; height: 46%; top: auto; border-radius: 42% 42% 0 0 / 10% 10% 0 0; }
  .offer-hero__copy h1 { font-size: clamp(51px,12.5vw,72px); }
}

@media (max-width:520px) {
  .offer-hero__actions { display: grid; }
}

@media (prefers-reduced-motion:no-preference) {
  .offer-hero__copy > * { animation: rise .65s both; }
  .offer-hero__copy > *:nth-child(2) { animation-delay: .08s; }
  .offer-hero__copy > *:nth-child(3) { animation-delay: .16s; }
}

/* ============================================================
   OFERTA — ramka matematyki, karty, karuzela materiałów
   (przeniesione z „Dodatkowy CSS” w Customizerze)
   ============================================================ */


.offer-hero {
  position: relative;
  overflow: hidden;
}

.offer-hero .offer-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.offer-hero__copy,
.offer-picker {
  position: relative;
  z-index: 2;
}

/* --- Przyciski przedmiotów (jasne, bo hero jest granatowe) --- */

.offer-picker {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 100%;
  min-width: 0;
}

.offer-picker__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0e9df;
  opacity: 0.6;
  margin: 0;
}

.offer-picker__group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f0e9df;
  opacity: 0.8;
  margin: 0 0 10px 0;
}

.offer-picker__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-picker__row--compact {
  flex-direction: row;
  flex-wrap: wrap;
}

.subject-button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(240, 233, 223, 0.08);
  border: 1px solid rgba(240, 233, 223, 0.22);
  color: #f0e9df;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.subject-button strong {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.subject-button small {
  font-size: 0.75rem;
  color: rgba(240, 233, 223, 0.6);
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.subject-button i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(240, 233, 223, 0.45);
  font-style: normal;
  font-size: 0.8rem;
}

.subject-button--compact {
  flex: 1 1 0;
  min-width: 120px;
}

.subject-button--compact i {
  margin-left: auto;
}

.subject-button:hover,
.subject-button:focus-visible {
  background: var(--mint, #7adbd4);
  border-color: var(--mint, #7adbd4);
  color: var(--navy, #102f49);
}

.subject-button:hover small,
.subject-button:focus-visible small {
  color: rgba(16, 47, 73, 0.7);
}

.subject-button:hover i,
.subject-button:focus-visible i {
  border-color: rgba(16, 47, 73, 0.5);
  color: var(--navy, #102f49);
}

@media (max-width: 520px) {
  .subject-button {
  flex-wrap: wrap;
  }
  .subject-button small {
  margin-left: 0;
  width: 100%;
  text-align: left;
  }
}

/* --- Sekcje --- */

.offer-math {
  background: var(--navy, #102f49);
  color: #f0e9df;
  padding: 90px 0;
}

.offer-other {
  background: var(--cream, #f2ecde);
  color: var(--navy, #102f49);
  padding: 90px 0;
}

/* --- Ramka przedmiotu, z której wychodzą karty --- */

.subject-frame {
  border: 1px solid rgba(240, 233, 223, 0.28);
  border-radius: 26px;
  padding: clamp(28px, 4vw, 48px);
}

.subject-frame--light {
  border-color: rgba(16, 47, 73, 0.2);
}

.subject-frame__head {
  max-width: 620px;
  margin-bottom: 34px;
}

.subject-frame__head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
}

.subject-frame__head p {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.8;
  margin: 0;
}

.subject-frame__tracks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.subject-frame--light .subject-frame__tracks {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.track-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 540px;
  padding: 30px 26px;
  border-radius: 20px;
  background: rgba(240, 233, 223, 0.06);
  border: 1px solid rgba(240, 233, 223, 0.22);
  /* przewijamy wyżej, żeby widać było całą ramkę, a nie samą kartę */
  scroll-margin-top: 260px;
  outline: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.subject-frame--light .track-card {
  background: #ffffff;
  border-color: rgba(16, 47, 73, 0.14);
}

/* --- Podświetlenie karty po kliknięciu przycisku --- */

.track-card:target {
  border-color: var(--mint, #7adbd4);
  background: rgba(122, 219, 212, 0.12);
  box-shadow: 0 0 0 3px rgba(122, 219, 212, 0.3), 0 18px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px);
  animation: track-pulse 1.6s ease-out 1;
}

.subject-frame--light .track-card:target {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(122, 219, 212, 0.45), 0 18px 40px rgba(16, 47, 73, 0.12);
}

.track-card:target::after {
  content: "Wybrany";
  position: absolute;
  top: -12px;
  left: 30px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--mint, #7adbd4);
  color: var(--navy, #102f49);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes track-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(122, 219, 212, 0.55), 0 18px 40px rgba(0, 0, 0, 0.18); }
  60%  { box-shadow: 0 0 0 14px rgba(122, 219, 212, 0), 0 18px 40px rgba(0, 0, 0, 0.18); }
  100% { box-shadow: 0 0 0 3px rgba(122, 219, 212, 0.3), 0 18px 40px rgba(0, 0, 0, 0.18); }
}

@media (prefers-reduced-motion: reduce) {
  .track-card:target { animation: none; transform: none; }
}

/* --- Treść karty --- */

.track-card__stage {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 12px 0;
}

.track-card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 16px 0;
}

.track-card__body {
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.85;
  margin: 0 0 22px 0;
}

.track-card__points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.track-card__points li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.9;
}

.track-card__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint, #7adbd4);
}

/* --- Cennik w karcie --- */

.track-card__pricing {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(240, 233, 223, 0.22);
}

.subject-frame--light .track-card__pricing {
  border-top-color: rgba(16, 47, 73, 0.14);
}

.track-card__pricing-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0 0 12px 0;
}

.price-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.price-list__group {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 10px 0 2px 0;
}

.price-list__group:first-child {
  margin-top: 0;
}

.price-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price-list dt {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.7;
  margin: 0;
}

.price-list dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: var(--mint, #7adbd4);
}

.subject-frame--light .price-list dd {
  color: var(--navy, #102f49);
}

.track-card__pricing-note {
  margin: 12px 0 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.6;
}

@media (max-width: 1180px) {
  .subject-frame__tracks,
  .subject-frame--light .subject-frame__tracks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
  }
  .track-card {
  min-height: 0;
  scroll-margin-top: 140px;
  }
}

@media (max-width: 700px) {
  .subject-frame__tracks,
  .subject-frame--light .subject-frame__tracks {
  grid-template-columns: 1fr;
  padding-top: 0;
  }
  .track-card {
  min-height: 0;
  /* karty są jedna pod drugą, więc nie trzeba odsłaniać całej ramki */
  scroll-margin-top: 100px;
  }
}


/* ============================================================
   GALERIA — karuzela w proporcji A4
   ============================================================ */

.offer-gallery {
  background: var(--cream, #f2ecde);
  color: var(--navy, #102f49);
  padding: 70px 0;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.offer-gallery h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.gallery-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.gallery-nav__button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(16, 47, 73, 0.3);
  background: transparent;
  color: var(--navy, #102f49);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gallery-nav__button:hover,
.gallery-nav__button:focus-visible {
  background: var(--navy, #102f49);
  border-color: var(--navy, #102f49);
  color: #f0e9df;
}

.gallery-viewport {
  overflow: hidden;
}

.gallery-track {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  will-change: transform;
}

.gallery-item {
  flex: 0 0 calc((100% - 60px) / 4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  min-height: 0;
}

.gallery-item__media {
  display: block;
  /* proporcja kartki A4 w pionie */
  aspect-ratio: 210 / 297;
  background: #ffffff;
  border: 1px solid rgba(16, 47, 73, 0.12);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-item__media:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 47, 73, 0.3);
  box-shadow: 0 16px 34px rgba(16, 47, 73, 0.16);
}

.gallery-item__media img {
  display: block;
  width: 100%;
  height: 100%;
  /* cała kartka widoczna, bez przycinania */
  object-fit: contain;
  object-position: center;
  margin: 0;
  border-radius: 0;
}

.gallery-item__label {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.75;
  margin: 0;
}

@media (max-width: 1000px) {
  .gallery-item {
  flex: 0 0 calc((100% - 40px) / 3);
  }
}


@media (max-width: 760px) {
  .gallery-item {
  flex: 0 0 calc((100% - 20px) / 2);
  }
}

@media (max-width: 520px) {
  .gallery-item {
  flex: 0 0 72%;
  }
  .gallery-head {
  flex-direction: column;
  align-items: flex-start;
  }
}

