/* ============================================
   ДомОК — components.css
   Header, footer, buttons, cards, forms, modals, etc.
   ============================================ */

/* ============================================
   Header / Nav
   ============================================ */
.site-header {
  background: var(--c-bg);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.site-header.is-scrolled { border-bottom-color: var(--c-border); background: rgba(255, 250, 243, 0.95); backdrop-filter: blur(14px); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; color: var(--c-text); letter-spacing: -0.5px; }
.logo-icon { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--c-primary-soft), var(--c-primary)); display: flex; align-items: center; justify-content: center; color: var(--c-white); box-shadow: 0 6px 18px rgba(255,87,34,0.35); flex-shrink: 0; }
.logo-icon svg { width: 24px; height: 24px; }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--c-text-soft); font-size: 15px; font-weight: 600; transition: color var(--t-fast); padding: 6px 0; }
.nav-links a:hover, .nav-links a.is-active { color: var(--c-primary); }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; background: var(--c-soft-2); color: var(--c-text); align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* Телефон в шапке */
.header-phone {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 700; color: var(--c-text);
  white-space: nowrap; transition: color var(--t-fast);
  text-decoration: none;
}
.header-phone:hover { color: var(--c-primary); }
.header-phone svg { flex-shrink: 0; opacity: .65; }

/* Mobile menu */
@media (max-width: 900px) {
  .header-phone { display: none; }
  .nav-links { display: none; position: fixed; top: 78px; left: 0; right: 0; background: var(--c-bg); flex-direction: column; padding: 20px 24px; gap: 4px; box-shadow: var(--shadow-lg); border-top: 1px solid var(--c-border); }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--c-border-soft); }
  .nav-toggle { display: flex; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  padding: 14px 28px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all var(--t);
  white-space: nowrap;
  font-family: inherit;
  border: 2px solid transparent;
  text-align: center;
  justify-content: center;
}
.btn-lg { padding: 18px 34px; font-size: 16px; }
.btn-sm { padding: 10px 18px; font-size: 13px; }

.btn-primary { background: var(--c-primary); color: var(--c-white); box-shadow: 0 10px 25px rgba(255,87,34,0.3); }
.btn-primary:hover { background: var(--c-primary-dark); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,87,34,0.4); }

.btn-soft { background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-sm); }
.btn-soft:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-dark { background: var(--c-text); color: var(--c-bg); }
.btn-dark:hover { background: var(--c-primary); color: var(--c-white); }

.btn-block { width: 100%; }

/* ============================================
   Section heading
   ============================================ */
.section-head { text-align: center; margin-bottom: 56px; }
.section-head.is-left { text-align: left; }
.section-tag { display: inline-block; padding: 6px 16px; background: var(--c-soft-2); color: var(--c-primary); border-radius: var(--r-pill); font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.section-title { margin-bottom: 14px; }
.section-title em { font-style: normal; color: var(--c-primary); position: relative; }
.section-title em.underline::after { content: ''; position: absolute; bottom: 4px; left: 0; right: 0; height: 10px; background: var(--c-soft); z-index: -1; border-radius: 4px; }
.section-sub { font-size: 18px; color: var(--c-text-soft); max-width: 600px; margin: 0 auto; }
.section-head.is-left .section-sub { margin: 0; }

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 2px solid transparent;
  transition: all var(--t);
}
.card-hover:hover { transform: translateY(-6px); border-color: var(--c-primary); box-shadow: var(--shadow-md); }

/* Service card */
.service-card {
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 2px solid transparent;
  transition: all var(--t);
  cursor: pointer;
  display: block;
}
.service-card:hover { transform: translateY(-6px) rotate(-0.5deg); border-color: var(--c-primary); box-shadow: 0 16px 40px rgba(255,87,34,0.15); }
.service-icon { width: 64px; height: 64px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.service-icon svg { width: 30px; height: 30px; }
.svc-1 { background: #fff0e6; color: #ff5722; }
.svc-2 { background: #e6f7ff; color: #06b6d4; }
.svc-3 { background: #f0e6ff; color: #7c3aed; }
.svc-4 { background: #ffe6e6; color: #ef4444; }
.svc-5 { background: #e6f0ff; color: #2563eb; }
.svc-6 { background: #fff7e6; color: #d97706; }
.svc-7 { background: #e6ffe9; color: #16a34a; }
.svc-8 { background: #ffe6f4; color: #db2777; }
.service-card h3, .service-card h4 { font-size: 18px; margin-bottom: 8px; font-weight: 800; color: var(--c-text); letter-spacing: -0.3px; }
.service-card p { font-size: 14px; color: var(--c-text-muted); margin-bottom: 14px; }
.service-price { display: inline-block; padding: 6px 14px; background: var(--c-soft-2); color: var(--c-primary); border-radius: var(--r-pill); font-size: 13px; font-weight: 700; }

/* Step card */
.step-card { background: var(--c-white); padding: 30px 24px; border-radius: var(--r-lg); text-align: center; position: relative; }
.step-num { width: 50px; height: 50px; border-radius: var(--r-circle); background: linear-gradient(135deg, var(--c-primary-soft), var(--c-primary)); color: var(--c-white); font-size: 20px; font-weight: 900; display: flex; align-items: center; justify-content: center; margin: -50px auto 18px; box-shadow: var(--shadow-md); }
.step-icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--c-primary); }
.step-icon svg { width: 100%; height: 100%; }
.step-card h4 { font-size: 17px; margin-bottom: 8px; color: var(--c-text); font-weight: 800; }
.step-card p { font-size: 14px; color: var(--c-text-muted); }

/* Review card */
.review-card { background: var(--c-white); border-radius: var(--r-lg); padding: 28px; }
.review-card .stars { font-size: 18px; color: var(--c-stars); margin-bottom: 14px; }
.review-card p { font-size: 15px; color: var(--c-text-soft); margin-bottom: 20px; line-height: 1.6; }
.reviewer { display: flex; align-items: center; gap: 12px; }
.reviewer-avatar { width: 44px; height: 44px; border-radius: var(--r-circle); background: linear-gradient(135deg, #ffb88c, var(--c-primary-soft)); display: flex; align-items: center; justify-content: center; color: var(--c-white); font-weight: 800; }
.reviewer-name { font-weight: 800; color: var(--c-text); font-size: 14px; }
.reviewer-sub { font-size: 12px; color: var(--c-text-muted); }

/* Stat block */
.stat-block { text-align: center; padding: 20px; }
.stat-num { font-size: 42px; font-weight: 900; color: var(--c-primary); letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 14px; color: var(--c-text-muted); margin-top: 8px; font-weight: 600; }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--c-text-soft); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--c-border-soft);
  border-radius: var(--r-sm);
  font-size: 15px;
  background: var(--c-white);
  color: var(--c-text);
  font-family: inherit;
  transition: border-color var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); }
.textarea { resize: vertical; min-height: 100px; }
.input.is-error, .select.is-error, .textarea.is-error,
.input.err, .select.err, .textarea.err { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12); }
.form-error { color: var(--c-danger); font-size: 12px; font-weight: 600; margin-top: 4px; display: none; }
.form-error.is-visible { display: block; }
.crm-form-status { margin-top: 10px; font-size: 14px; font-weight: 700; text-align: center; min-height: 1.4em; }
.form-note { font-size: 12px; color: var(--c-text-muted); text-align: center; margin-top: 12px; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(45, 36, 24, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--t);
}
.modal-overlay.is-open { display: flex; opacity: 1; }
.modal {
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: 36px 32px 30px;
  max-width: 460px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: var(--r-circle); background: var(--c-soft-2); color: var(--c-text); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--c-primary); color: var(--c-white); }
.modal-close svg { width: 18px; height: 18px; }
.modal h3 { font-size: 24px; margin-bottom: 16px; letter-spacing: -0.5px; }
.modal-sub { font-size: 14px; color: var(--c-text-muted); margin-bottom: 22px; }

/* Блок «Позвонить» в модале */
.modal-phone-cta {
  display: flex; align-items: center; gap: 14px;
  background: #fff5ee; border: 2px solid #ffd9c2;
  border-radius: var(--r-md); padding: 14px 18px;
  text-decoration: none; margin-bottom: 6px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.modal-phone-cta:hover { border-color: var(--c-primary); background: #fff0e6; }
.modal-phone-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(255,87,34,.3);
}
.modal-phone-label { font-size: 12px; color: var(--c-text-muted); font-weight: 600; margin-bottom: 2px; }
.modal-phone-num { font-size: 20px; font-weight: 900; color: var(--c-text); letter-spacing: -0.5px; }
.modal-or {
  text-align: center; font-size: 13px; color: var(--c-text-muted);
  margin: 20px 0 18px; position: relative;
}
.modal-or::before, .modal-or::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 36px); height: 1px; background: var(--c-border);
}
.modal-or::before { left: 0; }
.modal-or::after { right: 0; }

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--c-text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--c-text-muted); }
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs .sep { color: var(--c-text-faded); }

/* ============================================
   Accordion (FAQ)
   ============================================ */
.accordion-item { background: var(--c-white); border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden; border: 2px solid transparent; transition: border-color var(--t); }
.accordion-item.is-open { border-color: var(--c-primary); }
.accordion-trigger { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 22px 24px; text-align: left; font-weight: 800; font-size: 17px; color: var(--c-text); }
.accordion-trigger:hover { color: var(--c-primary); }
.accordion-icon { width: 28px; height: 28px; border-radius: var(--r-circle); background: var(--c-soft-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--c-primary); transition: transform var(--t); }
.accordion-icon svg { width: 16px; height: 16px; }
.accordion-item.is-open .accordion-icon { transform: rotate(45deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height var(--t); }
.accordion-body-inner { padding: 0 24px 22px; color: var(--c-text-soft); font-size: 15px; line-height: 1.65; }
.accordion-item.is-open .accordion-body { max-height: 500px; }

/* ============================================
   Footer
   ============================================ */
.site-footer { background: var(--c-text); color: #d4c5b0; padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h5 { color: var(--c-white); margin-bottom: 16px; font-size: 15px; font-weight: 800; }
.site-footer a { color: #a89980; display: block; font-size: 14px; padding: 4px 0; transition: color var(--t-fast); }
.site-footer a:hover { color: var(--c-primary-soft); }
.site-footer .footer-logo { color: var(--c-white); margin-bottom: 14px; display: flex; }
.site-footer p { color: #a89980; font-size: 14px; }
.footer-bottom { border-top: 1px solid #443625; padding-top: 24px; font-size: 13px; color: #8a7a60; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   CTA Block
   ============================================ */
.cta-block { background: linear-gradient(135deg, var(--c-primary-soft), var(--c-primary)); color: var(--c-white); padding: 70px 50px; border-radius: var(--r-xl); text-align: center; box-shadow: var(--shadow-xl); margin: 40px 0 70px; }
.cta-block h2 { color: var(--c-white); margin-bottom: 14px; }
.cta-block p { font-size: 18px; margin-bottom: 30px; opacity: 0.95; max-width: 540px; margin-left: auto; margin-right: auto; color: rgba(255,255,255,0.95); }
.cta-block .btn-primary { background: var(--c-white); color: var(--c-primary); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.cta-block .btn-primary:hover { background: var(--c-text); color: var(--c-white); }

@media (max-width: 600px) {
  .cta-block { padding: 50px 24px; }
}

/* ============================================
   Grid utilities
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================
   Badge / Tag
   ============================================ */
.badge { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.badge-soft { background: var(--c-soft-2); color: var(--c-primary); }
.badge-success { background: #dcfce7; color: var(--c-success); }

/* Back-to-top button */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; border-radius: var(--r-circle); background: var(--c-primary); color: var(--c-white); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(20px); transition: all var(--t); z-index: 90; pointer-events: none; }
.scroll-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top:hover { background: var(--c-primary-dark); }
.scroll-top svg { width: 22px; height: 22px; }
