/* src/styles/components/starter-offer.css */
/* Стартовый пакет: полоска в шапке, всплывающее окно, карточка на /buy.
   Акцент — тёплый жёлто-оранжевый: на тёмной шапке и среди зелёных/синих
   кнопок сервиса он единственный такой и читается как «спецпредложение».
   В последние 12 часов (.urgent) акцент становится красным. */
:root {
  --starter-accent: #f5b301;
  --starter-accent-dark: #e08e00;
  --starter-urgent: #e74c3c;
}

/* ============================================
   ПОЛОСКА В ШАПКЕ
   ============================================ */
.starter-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: -4px auto 12px;
  padding: 7px 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(245, 179, 1, 0.22), rgba(245, 179, 1, 0.08));
  border: 1px solid rgba(245, 179, 1, 0.55);
  color: #fff;
  font-size: 0.88em;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.2s;
}

.starter-strip:hover {
  background: linear-gradient(90deg, rgba(245, 179, 1, 0.32), rgba(245, 179, 1, 0.14));
}

.starter-strip-text {
  flex: 1;
  min-width: 0;
}

.starter-strip-details {
  opacity: 0.85;
}

.starter-strip-timer {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

.starter-strip-timer-label {
  opacity: 0.75;
  font-size: 0.9em;
}

.starter-strip-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--starter-accent);
  letter-spacing: 0.02em;
}

.starter-strip-cta {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--starter-accent);
  color: #2c3e50;
  font-weight: 700;
  white-space: nowrap;
}

.starter-strip.urgent {
  border-color: rgba(231, 76, 60, 0.75);
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.28), rgba(231, 76, 60, 0.1));
}

.starter-strip.urgent .starter-strip-time {
  color: #ff8a7a;
}

/* ============================================
   ОБЩИЙ ТАЙМЕР (окно и карточка)
   ============================================ */
.starter-timer-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 8px 6px 6px;
  border-radius: 10px;
  background: #2c3e50;
  color: #fff;
}

.starter-timer-seg span {
  font-size: 1.7em;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.starter-timer-seg small {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.starter-timer-sep {
  font-size: 1.5em;
  font-weight: 700;
  color: #2c3e50;
  align-self: center;
  padding-bottom: 14px;
}

.urgent .starter-timer-seg {
  background: var(--starter-urgent);
}

.urgent .starter-timer-sep {
  color: var(--starter-urgent);
}

/* ============================================
   ВСПЛЫВАЮЩЕЕ ОКНО
   ============================================ */
body.starter-modal-open {
  overflow: hidden;
}

.starter-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500; /* выше карты Leaflet (1000), ниже тостов (3000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 30, 40, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.starter-modal-overlay.visible {
  opacity: 1;
}

.starter-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 24px 20px;
  border-radius: 16px;
  background: #fff;
  color: #2c3e50;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-top: 5px solid var(--starter-accent);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.starter-modal-overlay.visible .starter-modal {
  transform: none;
}

.starter-modal:focus {
  outline: none;
}

.starter-modal-cta:focus-visible,
.starter-card-btn:focus-visible {
  outline: 3px solid rgba(39, 174, 96, 0.4);
  outline-offset: 2px;
}

.starter-modal.urgent {
  border-top-color: var(--starter-urgent);
}

.starter-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.6em;
  line-height: 1;
  color: #95a5a6;
  cursor: pointer;
  border-radius: 50%;
}

.starter-modal-close:hover {
  background: #f2f4f5;
  color: #2c3e50;
}

.starter-modal-gift {
  font-size: 2.4em;
  line-height: 1;
  margin-bottom: 8px;
}

.starter-modal h2 {
  margin: 0 0 6px;
  font-size: 1.35em;
  line-height: 1.25;
}

.starter-modal-sub {
  margin: 0 0 16px;
  font-size: 0.9em;
  color: #7f8c8d;
}

.starter-modal-timer,
.starter-card-timer {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.starter-modal-timer {
  margin-bottom: 18px;
}

.starter-modal-list,
.starter-card-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  text-align: left;
}

.starter-modal-list li,
.starter-card-list li {
  position: relative;
  padding: 4px 0 4px 26px;
  line-height: 1.4;
}

.starter-modal-list li::before,
.starter-card-list li::before {
  content: '✓';
  position: absolute;
  left: 4px;
  top: 4px;
  color: #27ae60;
  font-weight: 700;
}

.starter-modal-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.starter-price-new {
  font-size: 2em;
  font-weight: 800;
  color: #27ae60;
  line-height: 1;
}

.starter-price-hint {
  font-size: 0.78em;
  color: #7f8c8d;
  text-align: left;
  line-height: 1.35;
}

.starter-modal-cta,
.starter-card-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  font-family: inherit;
  font-size: 1.08em;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.starter-modal-cta:hover,
.starter-card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.45);
}

.starter-card-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.starter-modal-later {
  margin-top: 8px;
  padding: 10px;
  border: none;
  background: none;
  color: #7f8c8d;
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
}

.starter-modal-later:hover {
  color: #2c3e50;
  text-decoration: underline;
}

/* ============================================
   КАРТОЧКА НА /buy
   ============================================ */
.starter-card {
  position: relative;
  margin: 8px 0 28px;
  padding: 26px 24px 22px;
  border: 2px solid var(--starter-accent);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8e1 0%, #fff 60%);
  box-shadow: 0 6px 24px rgba(245, 179, 1, 0.2);
  color: #2c3e50;
  scroll-margin-top: 24px; /* бейдж выступает над карточкой на 13px */
}

.starter-card.urgent {
  border-color: var(--starter-urgent);
  box-shadow: 0 6px 24px rgba(231, 76, 60, 0.18);
}

.starter-card-badge {
  position: absolute;
  top: -13px;
  left: 20px;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--starter-accent), var(--starter-accent-dark));
  color: #2c3e50;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.starter-card.urgent .starter-card-badge {
  background: var(--starter-urgent);
  color: #fff;
}

.starter-card-body {
  display: grid;
  grid-template-columns: 1.3fr auto 1fr;
  gap: 24px;
  align-items: center;
}

.starter-card h2 {
  margin: 0 0 8px;
  font-size: 1.4em;
}

.starter-card-list {
  margin: 0;
}

.starter-card-timer-label {
  margin-bottom: 8px;
  font-size: 0.85em;
  color: #7f8c8d;
  text-align: center;
}

.starter-card-buy {
  text-align: center;
}

.starter-card-price {
  font-size: 2.2em;
  font-weight: 800;
  color: #27ae60;
  line-height: 1;
}

.starter-card-price-hint {
  margin: 6px 0 12px;
  font-size: 0.8em;
  color: #7f8c8d;
  line-height: 1.35;
}

/* ============================================
   📱 ПЛАНШЕТ И ТЕЛЕФОН
   ============================================ */
@media screen and (max-width: 900px) {
  .starter-card-body {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .starter-card-info {
    text-align: left;
  }
}

@media screen and (max-width: 768px) {
  /* В мобильной шапке всё в колонку — полоска идёт первой строкой
     и сжимается до одной строки: цена, таймер, стрелка */
  .starter-strip {
    margin: 0 0 10px;
    padding: 8px 10px;
    gap: 8px;
    font-size: 0.85em;
  }

  .starter-strip-details,
  .starter-strip-timer-label {
    display: none;
  }

  .starter-strip-cta {
    padding: 5px 10px;
  }
}

@media screen and (max-width: 576px) {
  /* Окно на телефоне — «шторка» снизу: ближе к большому пальцу */
  .starter-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .starter-modal {
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 24px 18px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
}

@media screen and (max-width: 480px) {
  .starter-strip-cta {
    font-size: 0;
    padding: 5px 10px;
  }

  .starter-strip-cta::after {
    content: '→';
    font-size: 14px;
  }

  .starter-timer-seg {
    min-width: 52px;
  }

  .starter-timer-seg span {
    font-size: 1.5em;
  }

  .starter-card {
    padding: 24px 16px 18px;
  }

  .starter-modal h2 {
    font-size: 1.2em;
  }
}

@media screen and (max-width: 360px) {
  .starter-strip {
    font-size: 0.8em;
  }

  .starter-timer-seg {
    min-width: 46px;
    padding: 6px 4px 4px;
  }

  .starter-timer-seg span {
    font-size: 1.3em;
  }
}

/* Горизонтальный телефон — экран низкий, шторка займёт всё; центрируем окно */
@media screen and (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .starter-modal-overlay {
    align-items: center;
    padding: 8px;
  }

  .starter-modal {
    max-width: 420px;
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starter-modal-overlay,
  .starter-modal {
    transition: none;
  }
}
