/* ==========================================================
   Клиника доброго стоматолога — главная страница, v2.0
   ========================================================== */

:root {
    --bg:        #F5F8F7;   /* фарфор */
    --surface:   #FFFFFF;
    --tint:      #D9ECE7;   /* морское стекло */
    --tint-soft: #EAF4F1;
    --ink:       #17323A;   /* хвоя */
    --muted:     #54707A;
    --line:      #D3E1DD;
    --teal:      #1E6B67;
    --teal-dark: #144F4C;
    --sun:       #F4C04E;
    --danger:    #B3261E;

    --font: "Onest", "Segoe UI", Roboto, Arial, sans-serif;

    --wrap: 1180px;
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --header-h: 76px;

    --r-lg: 28px;
    --r-md: 16px;
    --r-sm: 10px;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 2000;
    background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm);
}
.skip-link:focus { top: 1rem; }

section[id], #map { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 52px; padding: 0 1.6rem;
    font-weight: 600; font-size: 1rem; text-decoration: none;
    border-radius: 999px; border: 2px solid transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-small { min-height: 42px; padding: 0 1.15rem; font-size: .95rem; }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(245, 248, 247, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; fill: var(--teal); }
.brand-name { font-weight: 700; font-size: .95rem; line-height: 1.15; }

.navbar { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: .15rem; }
.nav-list > li { position: relative; }
.nav-list > li > a,
.dropdown-toggle {
    display: flex; align-items: center; gap: .35rem;
    padding: .55rem .8rem; border-radius: 999px;
    font-size: .97rem; font-weight: 500; text-decoration: none; color: var(--ink);
    transition: background-color .15s ease;
}
.nav-list > li > a:hover,
.dropdown-toggle:hover,
.dropdown.open > .dropdown-toggle { background: var(--tint); }

.dropdown-toggle::after {
    content: ""; width: 7px; height: 7px; margin-top: -3px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s ease;
}
.dropdown.open > .dropdown-toggle::after { transform: rotate(-135deg); margin-top: 3px; }

.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: .4rem; box-shadow: 0 18px 40px -18px rgba(23, 50, 58, .35);
}
.dropdown-menu--right { left: auto; right: 0; }
.dropdown-menu a {
    display: block; padding: .6rem .8rem; border-radius: var(--r-sm);
    text-decoration: none; font-size: .95rem;
}
.dropdown-menu a:hover { background: var(--tint-soft); }
.dropdown.open > .dropdown-menu { display: block; }
@media (hover: hover) and (min-width: 1025px) {
    .dropdown:hover > .dropdown-menu { display: block; }
    .dropdown:hover > .dropdown-menu::before { /* мостик, чтобы меню не закрывалось */
        content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px;
    }
}

.menu-toggle { display: none; width: 46px; height: 46px; border-radius: 50%; margin-left: auto; position: relative; }
.menu-toggle:hover { background: var(--tint); }
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    position: absolute; left: 50%; width: 22px; height: 2px; margin-left: -11px;
    background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle-bars { top: 50%; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; left: 0; margin-left: 0; }
.menu-toggle-bars::before { top: -7px; }
.menu-toggle-bars::after  { top:  7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after  { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Первый экран ---------- */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}

.status {
    display: inline-flex; align-items: center; gap: .55rem;
    font-size: .95rem; font-weight: 500; color: var(--muted);
}
.status::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%;
    background: #9AAFB3; flex-shrink: 0;
}
.status.is-open { color: var(--teal-dark); }
.status.is-open::before { background: #2FA36B; box-shadow: 0 0 0 4px rgba(47, 163, 107, .18); }

.hero-title {
    margin-top: 1.1rem;
    font-size: clamp(2.4rem, 5.6vw, 4.4rem);
    font-weight: 300; line-height: 1.04; letter-spacing: -.025em;
    text-wrap: balance;
}
.hero-lead {
    margin-top: 1.4rem; max-width: 30ch;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.45; color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.rating {
    display: inline-flex; align-items: center; gap: .9rem;
    margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
    text-decoration: none;
}
.rating-score { display: flex; align-items: center; gap: .3rem; font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.rating-star { color: var(--sun); font-size: 1.6rem; }
.rating-text { font-size: .9rem; line-height: 1.3; color: var(--muted); }
.rating:hover .rating-text { color: var(--ink); text-decoration: underline; }

/* ---------- Слайдер ---------- */
.hero-slider {
    position: relative; border-radius: var(--r-lg); overflow: hidden;
    background: var(--tint); box-shadow: 0 30px 60px -35px rgba(23, 50, 58, .55);
}
.slides { position: relative; aspect-ratio: 4 / 3.3; }
.mySlides {
    position: absolute; inset: 0; opacity: 0; visibility: hidden;
    transition: opacity .7s ease, visibility .7s;
}
.mySlides.is-active { opacity: 1; visibility: visible; }
.mySlides img { width: 100%; height: 100%; object-fit: cover; }
.mySlides .text {
    position: absolute; left: 1.1rem; top: 1.1rem;
    padding: .45rem .9rem; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: var(--ink);
    font-size: .92rem; font-weight: 600;
}

.slider-bar {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 1rem .85rem 1.3rem; background: var(--surface);
}
.slider-title { font-weight: 600; font-size: .98rem; }
.divdots { display: flex; gap: .45rem; margin-left: auto; }
.dot {
    width: 10px; height: 10px; border-radius: 999px; background: var(--line);
    transition: width .3s ease, background-color .3s ease;
}
.dot:hover { background: var(--muted); }
.dot.active { width: 26px; background: var(--teal); }
.slider-arrows { display: flex; gap: .35rem; }
.arrow {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--line); font-size: 1.5rem; line-height: 1;
    display: grid; place-items: center; padding-bottom: 3px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.arrow:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Режим работы ---------- */
.hours { background: var(--ink); color: #fff; }
.hours-grid {
    display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center;
    padding-top: 1.8rem; padding-bottom: 1.8rem;
}
.hours-title { font-size: 1.35rem; font-weight: 700; }
.hours-list { display: grid; grid-template-columns: repeat(3, 1fr); }
.hours-item { padding: .2rem 1.5rem; border-left: 1px solid rgba(255, 255, 255, .18); }
.hours-item dt { font-size: .88rem; color: rgba(255, 255, 255, .65); }
.hours-item dd { font-size: 1.12rem; font-weight: 600; margin-top: .15rem; }

/* ---------- Секции ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--tint { background: var(--tint-soft); }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
    margin-bottom: clamp(1.8rem, 4vw, 3rem);
}
.section-title {
    font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800;
    letter-spacing: -.03em; line-height: 1.05;
}
.section-note { max-width: 38ch; color: var(--muted); }

/* ---------- Услуги ---------- */
.usservice {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 2px solid var(--ink);
}
.poch {
    padding: 1.6rem 1.6rem 2rem 0;
    border-bottom: 1px solid var(--line);
}
.poch:not(:nth-child(3n + 1)) { padding-left: 1.6rem; border-left: 1px solid var(--line); }
.pochhead { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.pochcontent { margin-top: .6rem; color: var(--muted); max-width: 34ch; }

/* ---------- Врачи ---------- */
.doctors {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 2rem 1.5rem;
}
.doctor { display: flex; flex-direction: column; }
.pic {
    aspect-ratio: 4 / 5; border-radius: var(--r-md); overflow: hidden; background: var(--tint);
}
.pic img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.doc { margin-top: 1rem; font-size: 1.12rem; font-weight: 700; line-height: 1.25; }
.proff { margin-top: .3rem; color: var(--muted); font-size: .97rem; }
.doctors-empty { grid-column: 1 / -1; color: var(--muted); }

.statistika {
    display: grid; grid-template-columns: repeat(4, 1fr);
    margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.8rem;
    border-top: 1px solid var(--line);
}
.experi { display: flex; flex-direction: column; padding-right: 1rem; }
.one { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--teal-dark); }
.two { margin-top: .4rem; color: var(--muted); }

/* ---------- Контакты ---------- */
.contacts-grid {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.contacts-name { margin-top: 1.4rem; font-size: 1.25rem; font-weight: 700; }
.contacts-legal { color: var(--muted); font-size: .95rem; margin-top: .2rem; }
.contacts-list { margin: 1.6rem 0; border-top: 1px solid var(--line); }
.contacts-list > div {
    display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
    padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.contacts-list dt { color: var(--muted); font-size: .95rem; }
.contacts-list dd { font-weight: 500; }
.contacts-list a { color: var(--teal-dark); }
.contacts .status { display: flex; margin-bottom: 1.2rem; }

.map-card {
    border-radius: var(--r-lg); overflow: hidden; background: var(--tint);
    min-height: 420px;
}
#idmapver, #idmapver > * { width: 100% !important; }

/* ---------- Форма записи (сейчас отключена в разметке) ---------- */
.wrapper { position: relative; }
.form {
    max-width: 640px; margin: 0 auto; position: relative;
    background: var(--surface); border-radius: var(--r-lg); padding: clamp(1.5rem, 4vw, 2.75rem);
}
.form__title { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.6rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__item { margin-bottom: 1.1rem; }
.form__label { display: block; font-size: .92rem; font-weight: 500; margin-bottom: .4rem; }
.form__input {
    width: 100%; min-height: 50px; padding: .75rem 1rem;
    font: inherit; color: var(--ink);
    background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.form__input { min-height: 110px; resize: vertical; }
.form__input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(30, 107, 103, .15); }
.form__input._error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 38, 30, .12); }
input::placeholder, textarea::placeholder { color: #93A7AB; }
.form__captcha { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; align-items: end; }
#capT { width: 10rem; height: 50px; border-radius: var(--r-sm); object-fit: contain; background: var(--bg); }
.form__button { width: 100%; margin-top: .4rem; }
.form__body._sending { opacity: .5; pointer-events: none; }
.form__consent { margin-top: 1.2rem; font-size: .8rem; line-height: 1.5; color: var(--muted); }

.dialog-box {
    display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(22rem, 90%); padding: 1.4rem;
    background: var(--surface); border-radius: var(--r-md);
    box-shadow: 0 30px 60px -20px rgba(23, 50, 58, .45); z-index: 5;
}
.dialog-box .title { font-size: 1.15rem; font-weight: 700; }
.dialog-box .message { margin-top: .4rem; color: var(--muted); }
.dialogok { margin-top: 1rem; padding: .55rem 1.2rem; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .8); padding: 3rem 0 2.2rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; }
.footer-brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.footer-note { margin-top: .4rem; max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-content: start; justify-content: end; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy {
    grid-column: 1 / -1; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .85rem; color: rgba(255, 255, 255, .6);
}

/* ---------- Кнопка «Наверх» ---------- */
.scroll-up {
    position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 900;
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); color: var(--teal); border: 1.5px solid var(--line);
    font-size: 1.3rem; font-weight: 700; text-decoration: none;
    box-shadow: 0 10px 25px -12px rgba(23, 50, 58, .45);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background-color .15s ease;
}
.scroll-up.is-visible { opacity: 1; visibility: visible; transform: none; }
.scroll-up:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ==========================================================
   Адаптив
   ========================================================== */
@media (max-width: 1024px) {
    :root { --header-h: 66px; }

    .menu-toggle { display: block; }
    .navbar {
        position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0;
        flex-direction: column; align-items: stretch; gap: 1.2rem;
        padding: 1rem var(--gutter) 2rem; background: var(--bg);
        overflow-y: auto; display: none;
    }
    .navbar.responsive { display: flex; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-list > li { border-bottom: 1px solid var(--line); }
    .nav-list > li > a, .dropdown-toggle {
        width: 100%; justify-content: space-between; padding: 1rem .2rem;
        border-radius: 0; font-size: 1.15rem;
    }
    .nav-list > li > a:hover, .dropdown-toggle:hover, .dropdown.open > .dropdown-toggle { background: none; }
    .dropdown-menu, .dropdown-menu--right {
        position: static; box-shadow: none; border: 0; padding: 0 0 .8rem; background: none; min-width: 0;
    }
    .dropdown-menu a { padding: .55rem .2rem; color: var(--muted); }
    .navbar .btn { width: 100%; min-height: 52px; font-size: 1rem; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-lead { max-width: 40ch; }

    .hours-grid { grid-template-columns: 1fr; gap: 1rem; }
    .hours-item:first-child { padding-left: 0; border-left: 0; }

    .usservice { grid-template-columns: repeat(2, 1fr); }
    .poch:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
    .poch:nth-child(2n) { padding-left: 1.6rem; border-left: 1px solid var(--line); }

    .contacts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }
    .brand-name { font-size: .88rem; }

    .hero { padding-top: 1.5rem; }
    .hero-actions .btn { flex: 1 1 100%; }
    .slides { aspect-ratio: 4 / 3.6; }
    .slider-title { display: none; }
    .divdots { margin-left: 0; }
    .slider-arrows { margin-left: auto; }

    .hours-list { grid-template-columns: 1fr; }
    .hours-item { padding: .7rem 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .18); }
    .hours-item:first-child { border-top: 0; }

    .usservice { grid-template-columns: 1fr; }
    .poch, .poch:nth-child(2n) { padding: 1.3rem 0 1.5rem; border-left: 0; }

    .doctors { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
    .doc { font-size: 1rem; }
    .proff { font-size: .9rem; }

    .statistika { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }

    .contacts-list > div { grid-template-columns: 1fr; gap: .15rem; }
    .map-card { min-height: 340px; border-radius: var(--r-md); }

    .form__row, .form__captcha { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; }
    .footer-links { justify-content: start; }
}
