/* =================== Compact service cards (mockup) + fixed modal =================== */
:root {
  --bg: #f7f8fc;
  --panel: #fff;
  --text: #0f1220;
  --muted: #5a647b;
  --line: rgba(10, 16, 40, 0.1);
  --line-soft: rgba(10, 16, 40, 0.06);
  --accent: #4d8bf0;
  --brand: #133670;
  --radius: 20px;
  --elev-1: 0 4px 12px rgba(6, 12, 38, 0.06);
  --elev-2: 0 10px 22px rgba(6, 12, 38, 0.1);
}

/* ===== Grid ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

/* ===== Card (compact) ===== */
.service-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel));
  border: 1px solid var(--line-soft);
  box-shadow: var(--elev-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.service-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
}

/* Icon: emoji in small rounded square with pastel bg */
.service-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: var(
    --ico-bg,
    color-mix(in oklab, var(--accent) 10%, transparent)
  );
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: inherit;
}
/* pastel variants (как в макете) */
.service-icon.ico--pink {
  --ico-bg: linear-gradient(180deg, #ffe9f4, #f2ebff);
}
.service-icon.ico--amber {
  --ico-bg: linear-gradient(180deg, #fff3da, #fde9c9);
}
.service-icon.ico--blue {
  --ico-bg: linear-gradient(180deg, #eaf3ff, #e6ecff);
}
.service-icon.ico--lilac {
  --ico-bg: linear-gradient(180deg, #f0eaff, #e8f0ff);
}
.service-icon.ico--yellow {
  --ico-bg: linear-gradient(180deg, #fff6d6, #fff0bd);
}
.service-icon.ico--rose {
  --ico-bg: linear-gradient(180deg, #ffe7ef, #f3e6ff);
}

/* Content */
.service-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.service-title {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
  color: var(--text);
}
.service-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

/* Chips */
.service-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  background: color-mix(in oklab, var(--panel) 90%, transparent);
}

/* Bottom row */
.service-bottom {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.service-price {
  font-weight: 900;
  font-size: 19px;
  color: var(--text);
  white-space: nowrap;
}
.service-btn {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel));
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--elev-1);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}
/* убираем «синий» ховер браузера */
.service-btn:hover,
.service-btn:focus {
  color: var(--text);
  background: linear-gradient(180deg, var(--panel), var(--panel));
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
  border-color: var(--line);
}
.service-btn:active {
  transform: translateY(0);
}

/* ===== Page title / subtitle (оставляю как было) ===== */
.page-title {
  justify-content: center;
  display: flex;
  font-weight: 800;
  font-size: 1.8rem;
  background: linear-gradient(145deg, #4d8bf0, #133670);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  text-align: center;
  margin: 0 0 18px;
}
.page-subtitle {
  font-size: 1rem;
  color: #555;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.4;
}

/* ===== Modal (FIX: center it, dark overlay, correct width) ===== */
.modal {
  display: none; /* базово скрыто */
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center; /* центрируем */
  padding: 24px; /* чтобы на маленьких экранах было поле */
  background: rgba(13, 18, 34, 0.55); /* тёмное затемнение, не белое */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal[style*="display: block"], /* если JS ставит display:block */
.modal.open, .modal.active {
  display: flex;
} /* дополнительные варианты включения */

/* Карточка модалки */
.modal-content {
  width: min(920px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  border: 1px solid rgba(10, 16, 40, 0.08);
  box-shadow: 0 20px 60px rgba(6, 12, 38, 0.2), 0 6px 18px rgba(6, 12, 38, 0.1);
  text-align: left;
  animation: fadeIn 0.25s ease;
}
.modal-content h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  color: #133670;
}

/* Текст и заметка */
#serviceDescription {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  margin-top: 6px;
}
.service-note {
  background: #f1f7ff;
  padding: 10px 12px;
  border-left: 4px solid #4d8bf0;
  border-radius: 8px;
  font-size: 14px;
  color: #2b2f3a;
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.service-note i {
  margin-top: 2px;
  font-size: 14px;
  color: #4d8bf0;
}

/* Кнопки модалки */
.modal-buttons {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-buttons button {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.modal-buttons .btn-confirm {
  background: linear-gradient(145deg, #4d8bf0, #133670);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--elev-1);
}
.modal-buttons .btn-confirm:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
  background: linear-gradient(145deg, #3f7bd1, #133670);
}
.modal-buttons .btn-cancel {
  background: #f3f4f7;
  color: #2b2f3a;
  border-color: #d8dbe3;
}
.modal-buttons .btn-cancel:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-1);
  background: #eceef3;
}

/* Anim */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}
@media (max-width: 640px) {
  .service-card {
    padding: 12px;
    border-radius: 18px;
  }
  .service-title {
    font-size: 16px;
  }
  .service-subtitle {
    font-size: 12.5px;
  }
  .service-icon {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border-radius: 9px;
  }
  .service-price {
    font-size: 18px;
  }
  .service-btn {
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 12px;
  }
  .modal-content {
    padding: 18px 16px;
    border-radius: 14px;
  }
}
