/* =========================================================
   E07QAZ — Автоэлектрик в Астане
   Аккуратный дизайн со сменой темы: Light (default) ↔ Dark
   ========================================================= */

:root,
[data-theme="light"] {
  --bg:         #F8FAFC;
  --bg-alt:     #EEF2F7;
  --surface:    #FFFFFF;
  --border:     #DCE3EE;
  --text:       #0F172A;
  --muted:      #526075;
  --accent:     #2563EB;
  --accent-h:   #1D4ED8;
  --accent-bg:  rgba(37, 99, 235, 0.1);
  --wa:         #10B981;
  --wa-h:       #059669;
  --shadow:     0 10px 30px rgba(15, 23, 42, 0.06);
  --header-bg:  rgba(248, 250, 252, 0.92);
}

[data-theme="dark"] {
  --bg:         #0B0F17;
  --bg-alt:     #101622;
  --surface:    #151D2C;
  --border:     #243047;
  --text:       #F8FAFC;
  --muted:      #94A3B8;
  --accent:     #38BDF8;
  --accent-h:   #7DD3FC;
  --accent-bg:  rgba(56, 189, 248, 0.12);
  --wa:         #10B981;
  --wa-h:       #14CA8E;
  --shadow:     0 12px 34px rgba(0, 0, 0, 0.38);
  --header-bg:  rgba(11, 15, 23, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, sans-serif;
  line-height: 1.55;
  overflow-x: clip;
  transition: background-color 240ms ease, color 240ms ease;
}
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; }
h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

.container { max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 0.92rem;
  white-space: nowrap; border: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease, transform 160ms ease;
}
.btn:active { transform: scale(0.98); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 0.85rem; border-radius: 10px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 0.96rem; }
.btn__ic { width: 16px; height: 16px; color: var(--accent); }
.btn--primary { background: var(--accent); color: #FFF; }
[data-theme="dark"] .btn--primary { color: #0B0F17; }
.btn--primary:hover { background: var(--accent-h); }
.btn--wa { background: var(--wa); color: #FFF; }
[data-theme="dark"] .btn--wa { color: #051911; }
.btn--wa:hover { background: var(--wa-h); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 240ms ease, border-color 240ms ease;
}
.header__inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand__badge { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #FFF; display: inline-grid; place-items: center; }
[data-theme="dark"] .brand__badge { color: #0B0F17; }
.brand__badge svg { width: 18px; height: 18px; }

.nav { display: none; gap: 28px; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.nav a:hover { color: var(--accent); }
@media (min-width: 900px) { .nav { display: flex; } }

.header__actions { display: flex; align-items: center; gap: 8px; }
.header__tel-text { display: none; }
@media (min-width: 1100px) { .header__tel-text { display: inline; } }

/* Theme Toggle */
.theme-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-grid; place-items: center;
  transition: border-color 180ms ease, transform 200ms ease;
}
.theme-btn:hover { border-color: var(--accent); transform: rotate(12deg); }
.theme-btn svg { width: 18px; height: 18px; }
[data-theme="light"] .theme-btn__sun { display: none; }
[data-theme="dark"] .theme-btn__moon { display: none; }

/* 2-Column Split Hero + Background Photo */
.hero { position: relative; padding-block: clamp(36px, 6vw, 76px); overflow: hidden; }
.hero__bg { position: absolute; inset: -6% 0; z-index: 0; pointer-events: none; }
.hero__bg-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.is-ready .hero__bg-img { transform: scale(1.02); }
.hero__bg-overlay { position: absolute; inset: 0; transition: background 240ms ease; }
[data-theme="light"] .hero__bg-overlay {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.84) 0%, rgba(248, 250, 252, 0.78) 55%, rgba(248, 250, 252, 0.96) 100%);
}
[data-theme="dark"] .hero__bg-overlay {
  background: linear-gradient(180deg, rgba(11, 15, 23, 0.82) 0%, rgba(11, 15, 23, 0.74) 55%, rgba(11, 15, 23, 0.96) 100%);
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.08fr 0.92fr; gap: 48px; } }

/* Masked Hero Text & Entrance Animations */
.line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.js .line > span { display: block; transform: translateY(115%); transition: transform 820ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--d, 0) * 95ms); }
.is-ready .line > span { transform: translateY(0); }
.js .hero-enter { opacity: 0; transform: translateY(18px); transition: opacity 680ms ease, transform 680ms cubic-bezier(0.22, 1, 0.36, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.is-ready .hero-enter { opacity: 1; transform: translateY(0); }

.js .anim-in { opacity: 0; transform: translateY(22px) scale(0.98); transition: opacity 620ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--st, 0) * 70ms); }
.js .anim-in.is-in { opacity: 1; transform: translateY(0) scale(1); }

.hero__pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.84rem; font-weight: 600; color: var(--muted); margin-bottom: 18px;
}
.hero__stars { color: #F59E0B; font-weight: 700; }
.hero__title { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.06; }
.hero__title span { color: var(--accent); }
.hero__lead { margin-top: 18px; font-size: 1.04rem; color: var(--muted); max-width: 52ch; }
.hero__cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero__stats {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.hero__stats strong { display: block; font-size: clamp(1.2rem, 2.5vw, 1.9rem); font-weight: 800; color: var(--text); }
.hero__stats span { font-size: 0.76rem; color: var(--muted); line-height: 1.3; display: block; }

.hero__media { position: relative; }
.hero__photo { aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__float {
  margin-top: 12px; padding: 14px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.hero__float svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.hero__float strong { display: block; font-size: 0.96rem; }
.hero__float span { font-size: 0.84rem; color: var(--muted); }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 92px); scroll-margin-top: 76px; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.eyebrow { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
.sec-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 32px; }
@media (min-width: 860px) { .sec-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.sec-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.028em; line-height: 1.1; }
.sec-lead { max-width: 46ch; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn { padding: 8px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.filter-btn.is-active { background: var(--accent); border-color: var(--accent); color: #FFF; }
[data-theme="dark"] .filter-btn.is-active { color: #0B0F17; }

/* Services Grid */
.srv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .srv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .srv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.srv-card {
  padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: transform 220ms ease, border-color 180ms ease;
}
.srv-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.srv-card[hidden] { display: none; }
.srv-card__ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); display: inline-grid; place-items: center; }
.srv-card__ic svg { width: 20px; height: 20px; }
.srv-card h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.srv-card p { font-size: 0.88rem; color: var(--muted); }
.srv-card__btn { margin-top: auto; padding-top: 8px; width: fit-content; font-size: 0.86rem; font-weight: 700; color: var(--accent); }

/* Quick Booking Box */
.booking {
  margin-top: 28px; padding: clamp(22px, 4vw, 34px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; scroll-margin-top: 88px;
}
@media (min-width: 860px) { .booking { grid-template-columns: 0.9fr 1.1fr; gap: 36px; } }
.booking__title { font-size: 1.45rem; font-weight: 800; }
.booking__desc { margin-top: 8px; color: var(--muted); font-size: 0.94rem; }

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.form__input {
  width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; font-size: 0.94rem; color: var(--text);
}
.form__input:focus { outline: none; border-color: var(--accent); }

/* Photos */
.photo-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 768px) { .photo-row { grid-template-columns: repeat(2, 1fr); } }
.photo-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.photo-box img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.photo-box figcaption { padding: 14px 18px; font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--border); }

/* Reviews */
.rev-nav { display: inline-flex; gap: 8px; }
.rev-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 1.1rem; display: grid; place-items: center; }
.rev-btn:hover { border-color: var(--accent); color: var(--accent); }
.rev-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: none; }
.rev-track::-webkit-scrollbar { display: none; }
.rev-card {
  flex: 0 0 min(85vw, 370px); scroll-snap-align: start; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.rev-card__top { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.stars { color: #F59E0B; letter-spacing: 1px; }
.rev-card blockquote { font-size: 0.95rem; line-height: 1.58; }
.rev-card figcaption { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.94rem; }

/* Contacts & Map */
.contacts-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
@media (min-width: 900px) { .contacts-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
.dl { margin-top: 18px; border-top: 1px solid var(--border); }
.dl > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--border); }
.dl dt { font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.dl dd { font-size: 0.96rem; font-weight: 500; }
.soc-links { display: flex; flex-wrap: wrap; gap: 10px; }
.soc-links a { color: var(--accent); font-weight: 600; }
.contacts-cta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }

.map-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.map-canvas { width: 100%; height: 340px; z-index: 1; }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.86) contrast(1.08) saturate(0.32); }
.map-bar { padding: 14px 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.88rem; border-top: 1px solid var(--border); }
.map-bar a { color: var(--accent); font-weight: 700; }

.footer { padding-block: 24px; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
