/* ============================================================
   «Ваш Доктор» — стоматологическая клиника
   Цветовая схема: зелёный + белый. Адаптив 320–1920+.
   ============================================================ */

:root {
    --green: #2E7D32;
    --green-dark: #1B5E20;
    --green-light: #4CAF50;
    --green-pale: #E8F5E9;
    --green-mint: #F1F8F2;
    --white: #FFFFFF;
    --text: #333333;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-soft: #f7faf7;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow: 0 6px 20px rgba(0, 0, 0, .08);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .12);
    --radius: 14px;
    --radius-sm: 10px;
    --header-h: 76px;
    --container: 1200px;
    --font: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: #1f2937; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

section { padding: clamp(48px, 7vw, 90px) 0; }

.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head .eyebrow {
    display: inline-block; color: var(--green); font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: 10px;
}
.section-head p { color: var(--text-muted); margin-top: 12px; font-size: 1.05rem; }

.bg-soft { background: var(--bg-soft); }
.bg-pale { background: var(--green-mint); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: 40px; font-weight: 600; font-size: 1rem;
    cursor: pointer; border: 2px solid transparent; transition: .2s ease; white-space: nowrap;
    line-height: 1;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-white { background: #fff; color: var(--green); }
.btn-white:hover { background: var(--green-pale); }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }

/* ---------- Хедер ---------- */
.header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 1000;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border); transition: box-shadow .2s;
}
.header.scrolled { box-shadow: var(--shadow); }
.header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--green); flex: none; white-space: nowrap; line-height: 1.05; }
.logo span { display: flex; flex-direction: column; justify-content: center; }
.logo img { height: 42px; width: auto; }
.logo .logo-mark {
    width: 40px; height: 40px; border-radius: 10px; background: var(--green);
    display: grid; place-items: center; color: #fff; flex: none;
}
.logo .logo-mark svg { width: 24px; height: 24px; stroke: #fff; }
.logo small { display: block; font-size: .6rem; font-weight: 500; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
    padding: 9px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; color: #374151;
    transition: .15s; white-space: nowrap;
}
.nav a:hover { color: var(--green); background: var(--green-pale); }
.nav a.active { color: var(--green); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.header-phone .icon { width: 20px; height: 20px; }

.burger { display: none; width: 44px; height: 44px; border: none; background: transparent; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2px; background: var(--green-dark); margin: 5px auto; transition: .3s; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

main { padding-top: var(--header-h); }

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(120deg, var(--green-mint), #fff); overflow: hidden; }
.hero-slide { display: none; }
.hero-slide.active { display: block; }
.hero-inner {
    display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px;
    padding: clamp(40px, 6vw, 80px) 0;
}
.hero-text h1 span { color: var(--green); }
.hero-text p { font-size: 1.15rem; color: var(--text-muted); margin: 20px 0 32px; max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-media { position: relative; }
.hero-media img { border-radius: 24px; box-shadow: var(--shadow-lg); width: 100%; aspect-ratio: 4/3.4; object-fit: cover; }
.hero-illus {
    border-radius: 24px; box-shadow: var(--shadow-lg); aspect-ratio: 4/3.4; width: 100%;
    background: linear-gradient(140deg, var(--green-light), var(--green-dark));
    display: grid; place-items: center;
}
.hero-illus svg { width: 45%; height: 45%; stroke: rgba(255,255,255,.9); }
.hero-badges { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }

.hero-dots { display: flex; gap: 8px; justify-content: center; padding-bottom: 24px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: #cbd5c9; cursor: pointer; }
.hero-dots button.active { background: var(--green); width: 26px; border-radius: 6px; }

/* ---------- Карточки-сетки ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px 24px; box-shadow: var(--shadow-sm); transition: .2s; height: 100%;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: #d6e6d7; }

.advantage .adv-icon {
    width: 60px; height: 60px; border-radius: 16px; background: var(--green-pale);
    display: grid; place-items: center; margin-bottom: 18px;
}
.advantage .adv-icon .icon { width: 30px; height: 30px; stroke: var(--green); stroke-width: 1.7; }
.advantage h3 { margin-bottom: 8px; }
.advantage p { color: var(--text-muted); font-size: .96rem; }

/* Услуги */
.service-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.service-card .s-img { aspect-ratio: 16/10; width: 100%; object-fit: cover; background: var(--green-pale); }
.service-card .s-imgph { aspect-ratio: 16/10; background: linear-gradient(140deg, var(--green-light), var(--green-dark)); display: grid; place-items: center; }
.service-card .s-imgph svg { width: 30%; stroke: rgba(255,255,255,.85); }
.service-card .s-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.service-card h3 { margin-bottom: 8px; }
.service-card p { color: var(--text-muted); font-size: .95rem; flex: 1; }
.service-card .s-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 12px; }
.service-card .price { font-weight: 700; color: var(--green-dark); font-size: 1.05rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.link-arrow .icon { width: 18px; height: 18px; }
.link-arrow:hover { gap: 10px; }

/* Врачи */
.doctor-card { padding: 0; overflow: hidden; text-align: center; }
.doctor-card .d-photo { aspect-ratio: 3/3.4; width: 100%; object-fit: cover; background: var(--green-pale); }
.doctor-card .d-photoph { aspect-ratio: 3/3.4; background: linear-gradient(160deg, var(--green-pale), #d3ead4); display: grid; place-items: center; }
.doctor-card .d-photoph svg { width: 40%; stroke: var(--green); opacity: .5; }
.doctor-card .d-body { padding: 20px; }
.doctor-card h3 { margin-bottom: 4px; }
.doctor-card .spec { color: var(--green); font-weight: 600; font-size: .95rem; }
.doctor-card .exp { color: var(--text-muted); font-size: .88rem; margin-top: 6px; }
.doctor-card .d-desc { color: var(--text-muted); font-size: .9rem; margin-top: 12px; }

/* Отзывы */
.review-card { display: flex; flex-direction: column; gap: 14px; }
.stars { color: #f5b301; letter-spacing: 2px; font-size: 1.1rem; }
.review-card .r-text { color: #444; font-style: italic; flex: 1; }
.review-card .r-name { font-weight: 700; color: var(--green-dark); }
.review-card .r-date { color: var(--text-muted); font-size: .85rem; }

.reviews-track { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.reviews-track .card { scroll-snap-align: start; min-width: min(360px, 82vw); }

/* ---------- Форма записи ---------- */
.appointment { background: linear-gradient(120deg, var(--green-dark), var(--green)); color: #fff; }
.appointment .section-head h2, .appointment .section-head p { color: #fff; }
.appointment .section-head .eyebrow { color: #c8e6c9; }
.form-card { background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-lg); max-width: 860px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; color: #374151; }
.field input, .field select, .field textarea {
    padding: 13px 15px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem; color: var(--text); background: #fff; transition: .15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green-light); box-shadow: 0 0 0 3px var(--green-pale); }
.field textarea { resize: vertical; min-height: 90px; }
.field .errorlist { list-style: none; color: #dc2626; font-size: .82rem; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-note { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Сообщения (flash) ---------- */
.messages { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash { padding: 14px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: .95rem; animation: slidein .3s ease; }
.flash.success { background: #ecfdf5; color: #065f46; border-left: 4px solid var(--green); }
.flash.error { background: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- О клинике блок ---------- */
.about-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-split img, .about-split .about-ph { border-radius: 20px; box-shadow: var(--shadow); width: 100%; }
.about-ph { aspect-ratio: 4/3; background: linear-gradient(140deg, var(--green-light), var(--green-dark)); display: grid; place-items: center; }
.about-ph svg { width: 30%; stroke: rgba(255,255,255,.85); }
.about-split .lead { font-size: 1.1rem; color: #444; }
.checklist { list-style: none; margin: 22px 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { width: 22px; height: 22px; stroke: var(--green); flex: none; margin-top: 2px; }

/* ---------- Прайс ---------- */
.price-block { margin-bottom: 40px; }
.price-block h3 { padding: 14px 20px; background: var(--green); color: #fff; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.price-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow-sm); border-radius: 0 0 var(--radius-sm) var(--radius-sm); overflow: hidden; }
.price-table tr { border-bottom: 1px solid var(--border); }
.price-table tr:last-child { border-bottom: none; }
.price-table td { padding: 15px 20px; }
.price-table td:last-child { text-align: right; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; margin-left: 8px; vertical-align: middle; }
.badge.sale { background: #fee2e2; color: #dc2626; }
.badge.discount { background: #fff7ed; color: #ea580c; }
.badge.new { background: var(--green-pale); color: var(--green-dark); }

/* ---------- Галерея / сертификаты ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery-grid img { aspect-ratio: 4/3; object-fit: cover; transition: .3s; width: 100%; }
.gallery-grid a:hover img { transform: scale(1.05); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.cert-grid figure { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm); }
.cert-grid img { aspect-ratio: 3/4; object-fit: contain; }
.cert-grid figcaption { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 8px; }

/* ---------- Хлебные крошки / page hero ---------- */
.page-hero { background: linear-gradient(120deg, var(--green-mint), #fff); padding: clamp(30px, 5vw, 56px) 0; border-bottom: 1px solid var(--border); }
.page-hero h1 { margin-bottom: 8px; }
.breadcrumbs { display: flex; gap: 8px; font-size: .88rem; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--green); }

/* ---------- Контакты ---------- */
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-list { display: grid; gap: 20px; }
.contact-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-item .ci-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--green-pale); display: grid; place-items: center; flex: none; }
.contact-item .ci-icon .icon { stroke: var(--green); }
.contact-item .ci-label { font-size: .82rem; color: var(--text-muted); }
.contact-item .ci-value { font-weight: 600; font-size: 1.05rem; }
.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 320px; }
.map-embed iframe { width: 100%; min-height: 360px; border: 0; display: block; }

/* ---------- Акции ---------- */
.promo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.promo-card .p-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.promo-card .p-imgph { aspect-ratio: 16/9; background: linear-gradient(130deg, var(--green-light), var(--green-dark)); display: grid; place-items: center; }
.promo-card .p-imgph svg { width: 22%; stroke: rgba(255,255,255,.85); }
.promo-card .p-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.promo-card .p-dates { font-size: .84rem; color: var(--text-muted); margin: 8px 0 12px; }

/* ---------- Футер ---------- */
.footer { background: #14311a; color: #cfe3d1; padding: 60px 0 26px; }
.footer a { color: #cfe3d1; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; margin-bottom: 40px; }
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 1.05rem; }
.footer .f-logo { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.footer ul { list-style: none; display: grid; gap: 9px; font-size: .95rem; }
.footer .f-contact { display: grid; gap: 12px; font-size: .95rem; }
.footer .f-contact div { display: flex; gap: 10px; align-items: flex-start; }
.footer .f-contact .icon { width: 20px; height: 20px; stroke: var(--green-light); flex: none; margin-top: 2px; }
.socials { display: flex; gap: 12px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; transition: .2s; }
.socials a:hover { background: var(--green); }
.socials .icon { width: 20px; height: 20px; stroke: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; text-align: center; font-size: .88rem; color: #9fbfa3; }

/* ---------- Плавающие кнопки + наверх ---------- */
.floats { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.float-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow-lg); cursor: pointer; border: none; transition: .2s; }
.float-btn:hover { transform: scale(1.08); }
.float-btn svg { width: 28px; height: 28px; }
.float-wa { background: #25D366; }
.float-wa svg { fill: #fff; }
.float-call { background: var(--green); }
.float-call svg { stroke: #fff; fill: none; }
.to-top { background: #fff; color: var(--green); border: 1px solid var(--border); width: 48px; height: 48px; opacity: 0; pointer-events: none; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { stroke: var(--green); }

/* ---------- Утилиты ---------- */
.text-center { text-align: center; }
.mt-32 { margin-top: 32px; }
.mono-cta { display: flex; justify-content: center; margin-top: 40px; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 992px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-cta { justify-content: center; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-media { max-width: 520px; margin: 0 auto; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .about-split, .contacts-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 1024px) {
    .nav, .header-phone { display: none; }
    .burger { display: block; }
    .nav {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; background: #fff;
        padding: 12px; gap: 2px; box-shadow: var(--shadow); border-bottom: 1px solid var(--border);
        transform: translateY(-120%); transition: transform .3s ease; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    }
    .nav.open { display: flex; transform: translateY(0); }
    .nav a { padding: 13px 16px; font-size: 1.05rem; white-space: normal; }
}

@media (max-width: 620px) {
    .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .messages { left: 12px; right: 12px; max-width: none; }
    .price-table td { padding: 12px 14px; font-size: .95rem; }
    .float-btn { width: 52px; height: 52px; }
}

/* На узких экранах убираем CTA-кнопку из шапки — её заменяют бургер и плавающие кнопки */
@media (max-width: 480px) {
    .header-actions .btn-primary { display: none; }
    .logo { font-size: 1.15rem; }
    .logo .logo-mark { width: 36px; height: 36px; }
}
