/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-light);
  box-shadow: var(--shadow-accent);
}
/* Hover-translate теперь обрабатывается через CSS-переменные --mx/--my в main.css —
   magnetic-эффект из JS складывается с обычным hover-сдвигом */

.btn--secondary {
  background: var(--text-dark);
  color: var(--text-light);
}
.btn--secondary:hover {
  background: #000;
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn--ghost:hover {
  border-color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.btn--ghost-dark {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border);
}
.btn--ghost-dark:hover {
  border-color: var(--text-dark);
  background: var(--bg-gray);
}

.btn--lg { padding: 18px 36px; font-size: 1.125rem; }
.btn--sm { padding: 10px 18px; font-size: 0.875rem; }
.btn--block { width: 100%; }

/* ============ Cards ============ */
.card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border);
  transition: all var(--t);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card--dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-dark);
  color: var(--text-light);
}
.card--dark:hover { background: rgba(255, 255, 255, 0.06); }

/* ============ Badge ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge--dark { background: var(--bg-dark); color: var(--text-light); }
.badge--hot { background: var(--accent); color: var(--text-light); }

/* ============ Forms ============ */
.form { display: flex; flex-direction: column; gap: var(--space-4); }

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  font-size: 1rem;
  transition: border-color var(--t), box-shadow var(--t);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field--dark input,
.form-field--dark select,
.form-field--dark textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-dark);
  color: var(--text-light);
}
.form-field--dark label { color: var(--text-muted-dark); }

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.form-consent input { margin-top: 2px; accent-color: var(--accent); }
.form-consent a { text-decoration: underline; }

.form-success {
  display: none;
  padding: var(--space-4);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  color: var(--success);
  font-weight: 500;
}
.form-success.is-visible { display: block; }

/* ============ Service cards ============ */
.service-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--t);
  height: 100%;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.service-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.service-card__icon svg { width: 28px; height: 28px; }
.service-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: var(--space-2);
}
.service-card__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
  flex-grow: 1;
}
.service-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.service-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-dark);
}
.service-card__link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.service-card__link::after {
  content: '→';
  transition: transform var(--t);
}
.service-card:hover .service-card__link::after { transform: translateX(4px); }

/* ============ Package cards ============ */
.package-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--t);
  position: relative;
  height: 100%;
}
.package-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.package-card--hot {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.package-card__hot-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  background: var(--accent);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.package-card__header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.package-card__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-2);
}
.package-card__sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
}
.package-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--text-dark);
}
.package-card__price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
.package-card__features {
  flex-grow: 1;
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.package-card__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.95rem;
}
.package-card__feature::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/12px no-repeat;
  margin-top: 1px;
}
.package-card__warranty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

/* ============ Stats ============ */
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-light);
  white-space: nowrap;            /* «25 000 ₽» — рубль не должен переносится отдельно */
}
.stat__label {
  font-size: 0.875rem;
  color: var(--text-muted-dark);
}

/* ============ Steps ============ */
.steps {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(6, 1fr); }
}

.step {
  position: relative;
  padding: var(--space-6);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}
.step__num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-3);
}
.step__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: var(--space-2);
  color: var(--text-light);
}
.step__desc {
  font-size: 0.875rem;
  color: var(--text-muted-dark);
  line-height: 1.5;
}

/* ============ Advantage tiles ============ */
.advantages {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .advantages { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .advantages { grid-template-columns: repeat(4, 1fr); }
}

.advantage {
  padding: var(--space-6);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--t);
}
.advantage:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.advantage__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.advantage__icon svg { width: 24px; height: 24px; }
.advantage__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: var(--space-2);
}
.advantage__desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ============ FAQ accordion ============ */
.faq-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}
@media (min-width: 768px) {
  .faq-list { grid-template-columns: repeat(2, 1fr); }
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  overflow: hidden;
  transition: border-color var(--t);
}
.faq-item.is-open { border-color: var(--accent); }
.faq-item__q {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.faq-item__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-gray);
  transition: all var(--t);
  font-size: 1.25rem;
  color: var(--text-muted);
}
.faq-item.is-open .faq-item__icon {
  background: var(--accent);
  color: var(--text-light);
  transform: rotate(45deg);
}
.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow);
}
.faq-item.is-open .faq-item__a { max-height: 500px; }
.faq-item__a-inner {
  padding: 0 var(--space-6) var(--space-6);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============ Carousel ============ */
.carousel {
  position: relative;
}
.carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel__viewport::-webkit-scrollbar { display: none; }
.carousel__track {
  display: flex;
  gap: var(--space-5);
  padding-bottom: var(--space-4);
}
.carousel__track > * {
  flex: 0 0 calc(85% - var(--space-4));
  scroll-snap-align: start;
}
@media (min-width: 768px) {
  .carousel__track > * { flex: 0 0 calc(50% - var(--space-3)); }
}
@media (min-width: 1024px) {
  .carousel__track > * { flex: 0 0 calc(33.333% - var(--space-4)); }
}
.carousel__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.carousel__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border);
  transition: all var(--t);
}
.carousel__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.carousel__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ Review card ============ */
.review-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 100%;
}
.review-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.review-card__avatar {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--text-light);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
}
.review-card__meta { display: flex; flex-direction: column; gap: 2px; }
.review-card__name {
  font-weight: 700;
  font-size: 0.95rem;
}
.review-card__car {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.review-card__stars { color: var(--warning); font-size: 0.95rem; }
.review-card__text {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
  flex-grow: 1;
}
.review-card__source {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============ Popup ============ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.popup-overlay.is-open { opacity: 1; visibility: visible; }

.popup {
  background: var(--bg-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--t);
  max-height: 90vh;
  overflow-y: auto;
}
.popup-overlay.is-open .popup { transform: scale(1); }

.popup__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-gray);
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all var(--t);
}
.popup__close:hover { background: var(--accent); color: var(--text-light); }
.popup__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}
.popup__sub {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* ============ Service: related ============ */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.related-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.related-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.related-card svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

/* Cookie-плашка: десктоп — слева снизу, мобилка — полосой снизу */
.cookie-bar {
  position: fixed;
  left: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform-origin: left center;
  animation: cookieBarCountdown 10s linear forwards;
}
@keyframes cookieBarCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-bar__progress { animation: none; }
}
.cookie-bar__text { margin: 0; color: var(--text-muted-dark); }
.cookie-bar__text a { color: var(--accent); text-decoration: underline; }
.cookie-bar__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  color: var(--text-muted-dark);
  border: 0;
  border-radius: var(--radius-full);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.cookie-bar__close:hover { color: var(--text-light); background: rgba(255, 255, 255, 0.1); }

@media (max-width: 640px) {
  .cookie-bar {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 11px;
  }
  .cookie-bar__close { width: 20px; height: 20px; }
}
