/* ==========================================================================
   Extra Discount Section + Modal — додаткова знижка -10% (блок 5)
   ========================================================================== */

/* === СЕКЦІЯ === */

.extra-discount-section {
  padding: var(--section-padding-desktop);
  margin-bottom: var(--section-spacing-desktop);
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  text-align: center;
}

.extra-discount__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 0.75rem 0;
  line-height: 1.2;
}

.extra-discount__subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 2rem 0;
  line-height: 1.5;
}

.extra-discount__subtitle strong {
  color: rgba(76, 175, 80, 0.95);
  font-weight: 700;
  font-size: 1.3rem;
}

.extra-discount__cta {
  padding: 0.875rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 52px;
}

/* === МОДАЛЬНЕ ВІКНО === */

.extra-discount-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal); /* 1050 — вище мобільної навігації (--z-menu-button: 1001) */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.extra-discount-modal--active {
  opacity: 1;
  visibility: visible;
}

.extra-discount-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.extra-discount-modal__content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 2.5rem;
  border-radius: 16px;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 200ms ease;
  -webkit-overflow-scrolling: touch;
}

.extra-discount-modal--active .extra-discount-modal__content {
  transform: translateY(0);
}

.extra-discount-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-normal) ease;
  min-height: 44px;
  min-width: 44px;
}

@media (hover: hover) and (pointer: fine) {
  .extra-discount-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

.extra-discount-modal__close:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.extra-discount-modal__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 2rem 0;
  text-align: center;
  padding-right: 2rem;
}

/* === КАРТКИ ПАКЕТІВ У МОДАЛЦІ === */

.extra-discount-modal__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.extra-discount-modal__card {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.extra-discount-modal__card--popular {
  border: 2px solid rgba(255, 193, 7, 0.6);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(255, 193, 7, 0.05) 100%);
}

.extra-discount-modal__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 193, 7, 1);
  color: rgba(0, 0, 0, 0.95);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.extra-discount-modal__card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0;
}

.extra-discount-modal__price-old {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
  margin: 0;
}

.extra-discount-modal__discount {
  font-size: 0.9rem;
  color: rgba(76, 175, 80, 0.9);
  font-weight: 600;
  margin: 0;
}

.extra-discount-modal__price-final {
  font-size: 1.75rem;
  font-weight: 800;
  color: rgba(76, 175, 80, 0.95);
  margin: 0.25rem 0;
}

.extra-discount-modal__pay-btn {
  margin-top: auto;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 48px;
  width: 100%;
}

/* === TABLET === */

@media (width >= 768px) and (width < 1024px) {
  .extra-discount__title {
    font-size: 1.85rem;
  }

  .extra-discount-modal__content {
    padding: 2rem;
  }

  .extra-discount-modal__cards {
    gap: 1rem;
  }
}

/* === MOBILE === */

@media (width < 768px) {
  .extra-discount-section {
    padding: var(--section-padding-mobile);
    margin-bottom: var(--section-spacing-mobile);
    max-width: calc(100vw - 2rem);
  }

  .extra-discount__title {
    font-size: 1.5rem;
  }

  .extra-discount__subtitle {
    font-size: 0.95rem;
  }

  .extra-discount__cta {
    width: 100%;
    min-height: 52px;
    font-size: 0.95rem;
    box-sizing: border-box;
  }

  .extra-discount-modal {
    padding: 1rem 0.75rem;
    box-sizing: border-box;
  }

  .extra-discount-modal__content {
    width: 100%;
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }

  .extra-discount-modal__title {
    font-size: 1.35rem;
  }

  .extra-discount-modal__cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .extra-discount-modal__card {
    padding: 1.25rem;
  }

  .extra-discount-modal__pay-btn {
    min-height: 52px;
  }
}

/* === VERY SMALL MOBILE === */

@media (width < 360px) {
  .extra-discount__title {
    font-size: 1.25rem;
  }

  .extra-discount-modal__content {
    padding: 1.25rem 0.75rem;
  }

  .extra-discount-modal__price-final {
    font-size: 1.5rem;
  }
}

/* === iOS Safari === */

@supports (-webkit-touch-callout: none) {
  .extra-discount-modal__content {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .extra-discount-modal__backdrop {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
}

/* === FALLBACK === */

@supports not (backdrop-filter: blur(20px)) {
  .extra-discount-modal__content {
    background: rgba(15, 15, 15, 0.98);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .extra-discount-modal__backdrop {
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* === REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
  .extra-discount-modal {
    transition: none;
  }

  .extra-discount-modal__content {
    transition: none;
    transform: none;
  }

  .extra-discount-modal__close {
    transition: none;
  }
}
