/* ==========================================================================
   ОГЛАВЛЕНИЕ (block-03.css) — Блок 3: Главный продающий раздел
   1. Секция и космический фон
   2. Сетка карточек — одинаковые размеры, больший gap
   3. Карточка: активная — статична; dimmed — лёгкое покачивание
   5. Фото-шапка: название и описание поверх изображения
   6. Текст под карточками
   7. Модалка «Подробнее» — двухколоночная
   8. Переход 2→3 (космическая волна — только перед блоком 3)
   ========================================================================== */

/* 1. Секция */
.block-03 {
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #1a1020 0%, #050508 45%, #0a0a0f 100%);
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  padding-top: calc(var(--gap-xl) * 1.25);
  padding-bottom: calc(var(--gap-xl) * 1.25 + 120px);
}

/* Низ блока 3 — ровный чёрный, без шва перед блоком 4 */
.block-03::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  background: #0a0a0f;
  pointer-events: none;
  z-index: 1;
}
.block-03 .cosmic-bg { opacity: 0.85; }

.block-03__eyebrow {
  text-align: center;
  font-size: var(--text-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  margin-bottom: var(--gap-sm);
}
.block-03 .section-title {
  text-align: center;
  margin-bottom: var(--gap-sm);
}
.block-03 .section-lead {
  text-align: center;
  margin-inline: auto;
  margin-bottom: calc(var(--gap-xl) * 1.1);
  max-width: 58ch;
}

/* 2. Три равные колонки */
.block-03__courses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem;
  align-items: stretch;
  position: relative;
  z-index: var(--z-content);
  padding-block: 16px;
}
@media (max-width: 1024px) {
  .block-03__courses {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
    gap: var(--gap-lg);
  }
  .block-03__card.is-dimmed { opacity: 1; transform: none; }
  .block-03__card.is-active { transform: none; }
}

/* 3. Карточка — масштаб и свечение на всей оболочке */
.block-03__card {
  position: relative;
  min-height: 100%;
  transition:
    transform 0.55s var(--ease-smooth),
    opacity 0.55s var(--ease-smooth),
    filter 0.55s var(--ease-smooth);
  transform: scale(0.94);
  opacity: 0.88;
  cursor: default;
}
.block-03__card.is-active {
  transform: scale(1.045);
  opacity: 1;
  z-index: 3;
}
.block-03__card.is-dimmed {
  transform: scale(0.9);
  opacity: 0.78;
  z-index: 1;
}

.block-03__card-shell {
  height: 100%;
}

/* Плавное покачивание — только у неактивных карточек */
.block-03__card.is-dimmed .block-03__card-shell {
  animation: block03CardFloat 8s ease-in-out infinite;
}
.block-03__card.is-active .block-03__card-shell {
  animation: none;
}
.block-03__courses .block-03__card:nth-child(2).is-dimmed .block-03__card-shell { animation-delay: -2.5s; }
.block-03__courses .block-03__card:nth-child(3).is-dimmed .block-03__card-shell { animation-delay: -5s; }

@keyframes block03CardFloat {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(-5px); }
}

.block-03__card-inner {
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #14141e 0%, #08080e 55%, #0f0a12 100%);
  border: 1px solid rgba(255, 159, 61, 0.18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition:
    border-color 0.55s var(--ease-smooth),
    box-shadow 0.55s var(--ease-smooth),
    background 0.55s var(--ease-smooth);
}
.block-03__card.is-active .block-03__card-inner {
  border-color: rgba(255, 180, 80, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 107, 26, 0.2),
    0 24px 60px rgba(255, 107, 26, 0.22),
    0 8px 32px rgba(0, 0, 0, 0.5);
  background: linear-gradient(165deg, #1a1420 0%, #0c0c14 50%, #120a10 100%);
}
.block-03__card.is-dimmed .block-03__card-inner {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* 4. Фото-шапка: название и описание поверх изображения */
.block-03__card-visual {
  position: relative;
  height: 132px;
  flex-shrink: 0;
  overflow: hidden;
}
.block-03__card-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(1.05) contrast(1.02) brightness(0.72);
  transition: transform 0.6s var(--ease-smooth), filter 0.55s var(--ease-smooth);
}
.block-03__card.is-active .block-03__card-visual img {
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05) brightness(0.78);
}
.block-03__card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(8, 8, 12, 0.92) 100%
  );
}

.block-03__card-visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px 14px;
  pointer-events: none;
}

.block-03__card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 0.3rem 0.65rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--color-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.45s, color 0.45s, border 0.45s;
}
.block-03__card.is-active .block-03__card-tag {
  background: var(--gradient-accent);
  color: #0a0a0f;
  border: none;
}

.block-03__card-visual .block-03__card-title {
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.3rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: color 0.45s;
}
.block-03__card.is-active .block-03__card-visual .block-03__card-title {
  background: linear-gradient(110deg, #fff 0%, #ffb347 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.block-03__card-visual .block-03__card-desc {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
  margin: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 5. Тело карточки — списки, цена, кнопки */
.block-03__card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--gap-md) var(--gap-md) var(--gap-lg);
  min-height: 0;
}

.block-03__card-body .block-03__card-title,
.block-03__card-body .block-03__card-desc {
  display: none;
}

.block-03__card-highlights-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 165px;
  margin-bottom: var(--gap-md);
}
.block-03__card-spacer {
  flex: 1;
  min-height: 1rem;
}

.block-03__card-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.block-03__card-highlights li {
  padding: 0.22rem 0 0.22rem 1rem;
  position: relative;
}
.block-03__card-highlights li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 8px;
  top: 0.48rem;
}
.block-03__card.is-active .block-03__card-highlights li::before {
  color: var(--color-accent-light);
}

.block-03__card-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: var(--gap-sm);
  flex-shrink: 0;
}
.block-03__card-price {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent-light);
  line-height: 1;
  transition: color 0.45s;
}
.block-03__card.is-active .block-03__card-price {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.block-03__card-price-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* 6. Кнопки — одинаковая ширина, одна строка */
.block-03__card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
  flex-shrink: 0;
}
.block-03__card-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 0.85rem 0.65rem;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.block-03__buy {
  background: #0a0a0f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  transition:
    background 0.45s var(--ease-smooth),
    color 0.45s var(--ease-smooth),
    border-color 0.45s var(--ease-smooth),
    box-shadow 0.45s var(--ease-smooth),
    transform 0.25s var(--ease-smooth);
}
.block-03__card.is-active .block-03__buy {
  background: var(--gradient-accent);
  color: #0a0a0f;
  border-color: transparent;
  box-shadow: 0 6px 28px rgba(255, 107, 26, 0.45);
}
.block-03__buy:hover {
  transform: translateY(-2px);
  background: var(--gradient-accent);
  color: #0a0a0f;
  border-color: transparent;
  box-shadow: 0 8px 32px rgba(255, 107, 26, 0.5);
}

.block-03__card-audience {
  margin-top: var(--gap-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
  font-style: italic;
  flex-shrink: 0;
  min-height: 2.6em;
}
.block-03__card.is-active .block-03__card-audience {
  color: rgba(255, 200, 140, 0.85);
}

/* 7. Текст под карточками */
.block-03__footer-note {
  text-align: center;
  max-width: 52ch;
  margin: calc(var(--gap-xl) * 1.1) auto 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* 8. Модалка — горизонтальная, без прокрутки, на весь viewport */
.block-03__detail {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(5, 5, 8, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal), visibility var(--duration-normal);
}
.block-03__detail.is-open { opacity: 1; visibility: visible; }

.block-03__detail-panel {
  width: min(1180px, 97vw);
  max-height: min(780px, 94vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem 1.5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--gradient-dark);
  border: 1px solid rgba(255, 159, 61, 0.35);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-normal);
  box-shadow: 0 24px 80px rgba(255, 107, 26, 0.18);
}
.block-03__detail.is-open .block-03__detail-panel {
  transform: scale(1) translateY(0);
}

.block-03__detail-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
}
.block-03__detail-header h3 {
  font-size: 1.2rem;
  margin: 0;
  background: linear-gradient(110deg, #fff, #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.block-03__detail-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.block-03__detail-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: calc(var(--z-modal) + 1);
  transition: background var(--duration-fast);
}
.block-03__detail-close:hover { background: rgba(255, 107, 26, 0.35); color: #fff; }

/* Горизонтальный layout внутри модалки */
.block-03__detail-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}
.block-03__detail-layout--compact {
  justify-content: center;
  gap: 1.15rem;
}

.block-03__detail-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.block-03__detail-lead {
  flex: 1;
  min-width: 200px;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}
.block-03__detail-layout--compact .block-03__detail-lead {
  text-align: center;
}

.block-03__detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}
.block-03__detail-badges span {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 107, 26, 0.12);
  border: 1px solid rgba(255, 159, 61, 0.3);
  color: var(--color-accent-light);
  white-space: nowrap;
}

.block-03__detail-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.block-03__detail-columns--2 {
  grid-template-columns: 1.2fr 1fr;
  max-width: 720px;
  margin-inline: auto;
  width: 100%;
}

.block-03__detail-col {
  padding: 0.85rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 0;
  overflow: hidden;
}
.block-03__detail-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-accent-gold);
  margin: 0 0 0.55rem;
}

.block-03__detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.block-03__detail-list li {
  padding: 0.2rem 0 0.2rem 1rem;
  position: relative;
}
.block-03__detail-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 0.6875rem;
  font-weight: 700;
  top: 0.28rem;
}

.block-03__detail-note {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding: 0.65rem 0.85rem;
  margin: 0;
  border-left: 3px solid var(--color-accent);
  background: rgba(255, 107, 26, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.block-03__detail-col .block-03__detail-note {
  border-left: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  height: 100%;
  display: flex;
  align-items: center;
}

.block-03__detail-compare {
  padding: 0.75rem 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 159, 61, 0.2);
}
.block-03__detail-compare h4 {
  font-size: 0.75rem;
  margin-bottom: 0.55rem;
  color: #fff;
}

.block-03__compare-row {
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
}
.block-03__compare-row:last-of-type { margin-bottom: 0; }
.block-03__compare-row--them {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.block-03__compare-row--us {
  background: rgba(255, 107, 26, 0.1);
  border: 1px solid rgba(255, 159, 61, 0.35);
}
.block-03__compare-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
}
.block-03__compare-row--us .block-03__compare-label { color: var(--color-accent-light); }
.block-03__compare-row ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.block-03__compare-row li { padding: 0.12rem 0; }

.block-03__detail-footer {
  flex-shrink: 0;
  margin-top: 1.15rem;
  padding: 1.15rem 0 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.block-03__detail-footer .btn {
  min-width: min(100%, 320px);
  padding: 0.9rem 1.5rem;
  font-size: 0.9375rem;
  box-shadow: 0 4px 20px rgba(255, 107, 26, 0.3);
}

@media (max-width: 900px) {
  .block-03__detail-panel {
    max-height: 94vh;
    overflow-y: auto;
  }
  .block-03__detail-body { overflow: visible; }
  .block-03__detail-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .block-03__detail-columns,
  .block-03__detail-columns--2 {
    grid-template-columns: 1fr;
  }
}

/* 9. Переход ПЕРЕД блоком 3 — космическая волна (без изменений) */
.section-divider--b3-enter {
  height: 100px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 107, 26, 0.04) 50%, rgba(255, 140, 40, 0.08) 100%);
  overflow: visible;
}
.section-divider--b3-enter .section-divider__line { display: none; }
.section-divider--b3-enter .section-divider__orb { display: none; }
.section-divider__cosmic-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath fill='%23ff6b1a' fill-opacity='0.12' d='M0 48V24c120-20 240 20 360 8s240-28 360-4 240 36 360 12 120-28 120-28v36H0z'/%3E%3Cpath fill='%23ffb347' fill-opacity='0.08' d='M0 48V32c80-12 160 16 240 8s160-24 240-8 160 20 240 4 160-16 240-8v20H0z'/%3E%3C/svg%3E") repeat-x bottom;
  background-size: 1200px 48px;
  animation: b3WaveScroll 14s linear infinite;
}
.section-divider__cosmic-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.section-divider__cosmic-sparks span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 8px #ff6b1a;
  animation: b3SparkFall 3s ease-in infinite;
}
.section-divider__cosmic-sparks span:nth-child(1) { left: 15%; animation-delay: 0s; }
.section-divider__cosmic-sparks span:nth-child(2) { left: 35%; animation-delay: 0.8s; }
.section-divider__cosmic-sparks span:nth-child(3) { left: 55%; animation-delay: 1.6s; }
.section-divider__cosmic-sparks span:nth-child(4) { left: 75%; animation-delay: 0.4s; }
.section-divider__cosmic-sparks span:nth-child(5) { left: 90%; animation-delay: 2.2s; }
@keyframes b3WaveScroll {
  from { background-position-x: 0; }
  to { background-position-x: 1200px; }
}
@keyframes b3SparkFall {
  0% { transform: translateY(-10px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(90px); opacity: 0; }
}
