/* ==========================================================================
   Стоматология «Улыбка» — Redesign
   ========================================================================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --c-forest: #2d6a4f;
  --c-forest-deep: #1b4332;
  --c-forest-light: #d8f3dc;
  --c-forest-muted: #95d5b2;
  --c-warm: #f4845f;
  --c-warm-light: #fff1ec;
  --c-sand: #fefae0;
  --c-bg: #fafaf7;
  --c-surface: #fff;
  --c-text: #212529;
  --c-text-sec: #495057;
  --c-text-muted: #868e96;
  --c-border: #dee2e6;
  --c-border-light: #f1f3f5;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --radius: 10px;
  --container: 960px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Georgia', 'Times New Roman', serif;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ---- Focus ---- */
:focus-visible { outline: 3px solid var(--c-forest); outline-offset: 2px }
.skip-link {
  position: absolute; top: -100%; left: 16px; background: var(--c-forest-deep); color: #fff;
  padding: 8px 18px; border-radius: 0 0 6px 6px; font-size: .85rem; font-weight: 600;
  z-index: 9999; text-decoration: none; transition: top .15s var(--ease);
}
.skip-link:focus { top: 0 }

/* ---- Base ---- */
html { scroll-behavior: smooth }
body {
  font-family: var(--font); color: var(--c-text); background: var(--c-bg);
  line-height: 1.65; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--c-forest); transition: color .15s var(--ease) }
a:hover { color: var(--c-forest-deep) }
img { max-width: 100%; display: block }
ul, ol { padding-left: 1.4em }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px }

/* ---- Accessibility panel ---- */
.a11y-panel {
  background: var(--c-forest-deep); color: #fff;
  padding: 0; max-height: 0; overflow: hidden;
  transition: max-height .3s var(--ease), padding .3s var(--ease);
}
.a11y-panel.active { max-height: 120px; padding: 12px 0 }
.a11y-panel .container {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: .85rem;
}
.a11y-panel label { font-weight: 600 }

.a11y-sizes { display: flex; gap: 4px; align-items: center }
.a11y-sizes button {
  width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.5); border-radius: 6px;
  background: transparent; color: #fff; cursor: pointer; font-weight: 700; font-size: 1rem;
  transition: border-color .15s, background .15s;
}
.a11y-sizes button:hover { border-color: #fff; background: rgba(255,255,255,.15) }

.a11y-scheme { display: flex; gap: 6px; align-items: center }
.a11y-scheme button {
  width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.5); border-radius: 6px;
  cursor: pointer; font-weight: 700; font-size: .7rem; line-height: 1;
  transition: border-color .15s, transform .15s;
}
.a11y-scheme button:hover { border-color: #fff; transform: scale(1.08) }
.a11y-btn-bw { background: #fff; color: #000 }
.a11y-btn-wb { background: #000; color: #fff }
.a11y-btn-blue { background: #9dd1ff; color: #063462 }
.a11y-btn-normal { background: var(--c-forest); color: #fff }

.a11y-toggle {
  background: none; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--c-text-sec); transition: background .15s;
}
.a11y-toggle:hover { background: var(--c-forest-light) }
.a11y-toggle svg { width: 18px; height: 18px }

/* VI color overrides */
body.vi-bw { background: #fff !important; color: #000 !important }
body.vi-bw * { color: #000 !important; background-color: #fff !important; border-color: #000 !important }
body.vi-bw a { text-decoration: underline !important }
body.vi-bw img { filter: grayscale(1) }
body.vi-bw .footer { background: #222 !important }
body.vi-bw .footer, body.vi-bw .footer * { color: #fff !important; background-color: #222 !important }
body.vi-bw .hero { background: #eee !important }
body.vi-bw .hero * { color: #000 !important }

body.vi-wb { background: #000 !important; color: #fff !important }
body.vi-wb * { color: #fff !important; background-color: #000 !important; border-color: #555 !important }
body.vi-wb a { text-decoration: underline !important }
body.vi-wb img { filter: grayscale(1) brightness(1.2) }

body.vi-blue { background: #9dd1ff !important; color: #063462 !important }
body.vi-blue * { color: #063462 !important; background-color: #9dd1ff !important; border-color: #063462 !important }
body.vi-blue a { text-decoration: underline !important }
body.vi-blue .footer { background: #063462 !important }
body.vi-blue .footer, body.vi-blue .footer * { color: #9dd1ff !important; background-color: #063462 !important }

/* ---- Header ---- */
.header {
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
}
.header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--c-forest-deep); text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; color: var(--c-forest) }
.logo svg { width: 32px; height: 32px; flex-shrink: 0 }

.nav { display: flex; gap: 0; align-items: center }
.nav a {
  color: var(--c-text-sec); font-size: .84rem; font-weight: 500;
  padding: 6px 12px; border-radius: 4px; white-space: nowrap;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--c-forest-light); color: var(--c-forest-deep); text-decoration: none }
.nav a[aria-current="page"] {
  color: var(--c-forest-deep); font-weight: 700;
  border-bottom: 2px solid var(--c-forest);
  border-radius: 4px 4px 0 0;
}

.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0 }
.header-contacts { text-align: right; line-height: 1.4 }
.header-contacts a {
  color: var(--c-forest-deep); font-weight: 700; font-size: .85rem;
  display: block; text-decoration: none; letter-spacing: -.01em;
}

.burger {
  display: none; background: none; border: none; cursor: pointer; padding: 6px;
}
.burger span { display: block; width: 22px; height: 2px; background: var(--c-text); margin: 5px 0; border-radius: 1px; transition: .25s var(--ease) }
.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px,5px) }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0 }
.burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px) }

/* ---- Hero ---- */
.hero {
  background: var(--c-forest-deep); color: #fff;
  padding: 40px 0 32px;
}
.hero .container { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px }
.hero-text { max-width: 580px }
.hero h1 {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  color: #fff; margin-bottom: 12px; line-height: 1.25;
}
.hero .lead { font-size: .92rem; color: rgba(255,255,255,.8); line-height: 1.7; margin: 0 }
.hero-info {
  background: rgba(255,255,255,.1); border-radius: var(--radius);
  padding: 20px 24px; min-width: 220px; font-size: .88rem; line-height: 1.7;
  flex-shrink: 0;
}
.hero-info strong { display: block; color: #fff; margin-bottom: 4px }
.hero-info span { display: block; color: rgba(255,255,255,.75) }
.hero-info a { color: var(--c-forest-muted); font-weight: 700; text-decoration: none }
.hero-info a:hover { color: #fff }

/* ---- Main ---- */
main { flex: 1; padding: 32px 0 48px }
main:focus { outline: none }

h1 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: var(--c-forest-deep); margin-bottom: 8px; line-height: 1.3;
}
h2 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  color: var(--c-forest-deep); margin: 32px 0 14px;
  padding-bottom: 6px; border-bottom: 2px solid var(--c-forest-light);
}
h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--c-text); font-weight: 700 }
p { margin-bottom: 10px }
.lead { font-size: .95rem; color: var(--c-text-sec); line-height: 1.7 }
.text-small { font-size: .82rem; color: var(--c-text-muted) }

/* ---- Card ---- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 20px 24px; margin: 14px 0;
}
.card h3 { margin-top: 0; color: var(--c-forest-deep) }
.card ul, .card ol { margin: 6px 0 6px 1.4em; font-size: .88rem }
.card li { margin-bottom: 5px; line-height: 1.6 }

/* ---- Price table ---- */
.price-table {
  width: 100%; border-collapse: collapse; background: var(--c-surface);
  margin: 0 0 20px; font-size: .87rem;
}
.price-table caption {
  text-align: left; font-family: var(--font-display); font-weight: 700;
  padding: 12px 18px; background: var(--c-forest-deep); color: #fff; font-size: .95rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.price-table thead th {
  background: var(--c-forest-light); font-weight: 600; font-size: .72rem;
  color: var(--c-forest-deep); text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 18px; text-align: left;
}
.price-table td {
  padding: 9px 18px; text-align: left; border-bottom: 1px solid var(--c-border-light);
}
.price-table td:last-child { white-space: nowrap; text-align: right; font-weight: 600; color: var(--c-forest-deep) }
.price-table tbody tr:last-child td { border-bottom: none }
.price-table tbody tr:hover { background: var(--c-forest-light) }
/* Bottom corners */
.price-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--radius) }
.price-table tbody tr:last-child td:last-child { border-radius: 0 0 var(--radius) 0 }

/* ---- Contacts (simple) ---- */
.contacts-block { margin: 20px 0 }
.contacts-block dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; font-size: .9rem }
.contacts-block dt { font-weight: 700; color: var(--c-forest-deep) }
.contacts-block dd { margin: 0; color: var(--c-text-sec) }
.contacts-block a { color: var(--c-forest); font-weight: 600; text-decoration: none }
.contacts-block a:hover { text-decoration: underline }

/* ---- Contact grid (for map page etc) ---- */
.contact-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin: 16px 0 }
.contact-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 16px 20px;
}
.contact-card__icon { display: none }
.contact-card__label { display: block; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-forest-deep); margin-bottom: 4px }
.contact-card span, .contact-card a { font-size: .88rem; color: var(--c-text-sec); display: block; margin-top: 2px; line-height: 1.5 }

/* ---- Disclaimer ---- */
.disclaimer {
  background: var(--c-sand); border-left: 3px solid var(--c-warm);
  padding: 12px 16px; margin: 28px 0 0; font-size: .82rem; color: var(--c-text-sec);
  border-radius: 0 6px 6px 0; line-height: 1.5;
}

/* ---- Staff ---- */
.staff-member { margin-bottom: 36px }
.staff-member h2 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 2px; border-bottom: none; padding-bottom: 0 }
.staff-detail { color: var(--c-text-sec); font-size: .85rem; margin-bottom: 2px }
.staff-role { color: var(--c-text-sec); font-size: .88rem; margin-bottom: 2px }
.staff-schedule { color: var(--c-text-muted); font-size: .82rem; margin-bottom: 14px }
.cert-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 6px; margin: 10px 0;
}
.cert-grid a {
  display: block; border-radius: 4px; overflow: hidden; border: 1px solid var(--c-border);
  transition: transform .15s var(--ease);
}
.cert-grid a:hover { transform: scale(1.04) }
.cert-grid img { width: 100%; height: auto; display: block }

/* ---- Doc images ---- */
.doc-images { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 }
.doc-images a {
  display: block; border: 1px solid var(--c-border); border-radius: 6px;
  overflow: hidden; max-width: 180px; transition: transform .15s var(--ease);
}
.doc-images a:hover { transform: scale(1.03) }
.doc-images img { width: 100%; height: auto }

/* ---- Requisites ---- */
.requisites {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 16px 20px; margin: 14px 0;
  font-family: 'Courier New', monospace; font-size: .82rem; line-height: 1.8;
  white-space: pre-wrap;
}

/* ---- Map ---- */
.map-wrap {
  width: 100%; height: 420px; border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden; margin: 14px 0;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0 }

/* ---- Footer ---- */
.footer {
  background: var(--c-forest-deep); color: rgba(255,255,255,.8);
  padding: 28px 0 20px; font-size: .82rem; margin-top: auto;
}
.footer a { color: rgba(255,255,255,.85); text-decoration: none }
.footer a:hover { color: #fff; text-decoration: underline }
.footer .container {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 24px;
}
.footer-col { min-width: 160px }
.footer-col h4 {
  color: #fff; margin-bottom: 8px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.footer-col p, .footer-col a { display: block; margin-bottom: 4px; font-size: .8rem; line-height: 1.5 }
.footer-bottom {
  width: 100%; margin-top: 20px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .72rem; color: rgba(255,255,255,.4); text-align: center;
}

/* ---- Responsive ---- */
@media(max-width:768px) {
  .header .container { height: auto; padding: 8px 16px; flex-wrap: wrap }
  .logo { font-size: 1rem }
  .logo svg { width: 28px; height: 28px }
  .nav {
    display: none; width: 100%; flex-direction: column;
    padding: 8px 0; border-top: 1px solid var(--c-border); order: 10;
  }
  .nav.open { display: flex }
  .nav a { padding: 10px 12px; width: 100%; font-size: .92rem }
  .burger { display: block }
  .header-contacts { display: none }
  .hero { padding: 24px 0 20px }
  .hero .container { flex-direction: column; gap: 16px }
  .hero h1 { font-size: 1.3rem }
  .hero-info { min-width: auto; width: 100% }
  .contact-grid { grid-template-columns: 1fr }
  h1 { font-size: 1.2rem }
  h2 { font-size: 1.05rem }
  main { padding: 18px 0 28px }
  .price-table { font-size: .8rem }
  .price-table td { padding: 7px 12px }
  .price-table caption { padding: 10px 14px; font-size: .88rem }
  .card { padding: 14px 16px }
  .footer .container { flex-direction: column; gap: 16px }
  .footer-bottom { text-align: center }
  .map-wrap { height: 260px }
  .cert-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) }
  .a11y-panel .container { font-size: .78rem; gap: 12px }
  .container { padding: 0 16px }
}
@media(max-width:400px) {
  .price-table td { padding: 6px 8px; font-size: .76rem }
}

/* ---- High contrast ---- */
@media(prefers-contrast:high) {
  :root { --c-border: #868e96; --c-text-sec: #212529; --c-text-muted: #495057 }
}
/* ---- Reduced motion ---- */
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important }
  html { scroll-behavior: auto }
}
/* ---- Cookie banner ---- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--c-forest-deep); color: rgba(255,255,255,.9);
  padding: 14px 0; font-size: .82rem; line-height: 1.5;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.cookie-banner.visible { transform: translateY(0) }
.cookie-banner .container { display: flex; align-items: center; gap: 16px; flex-wrap: wrap }
.cookie-banner p { margin: 0; flex: 1; min-width: 200px }
.cookie-banner a { color: var(--c-forest-muted) }
.cookie-accept {
  background: var(--c-forest); color: #fff; border: none; border-radius: 6px;
  padding: 8px 20px; cursor: pointer; font-size: .82rem; font-weight: 600;
  white-space: nowrap; transition: background .15s;
}
.cookie-accept:hover { background: var(--c-forest-muted); color: var(--c-forest-deep) }

/* ---- Search toggle ---- */
.search-toggle {
  background: none; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; display: flex; align-items: center;
  color: var(--c-text-sec); transition: background .15s;
}
.search-toggle:hover { background: var(--c-forest-light) }
.search-toggle svg { width: 18px; height: 18px }

.search-overlay {
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  padding: 14px 0; box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.search-overlay .container { position: relative }
.search-overlay-close {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--c-text-muted);
  padding: 4px 8px;
}

/* ---- Search ---- */
.site-search { position: relative; margin: 0 }
.site-search input {
  width: 100%; padding: 10px 16px 10px 40px; border: 1px solid var(--c-border);
  border-radius: var(--radius); font-size: .88rem; background: var(--c-surface);
  font-family: var(--font); transition: border-color .15s;
}
.site-search input:focus { border-color: var(--c-forest); outline: none }
.site-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--c-text-muted); pointer-events: none;
}
.search-results { margin-top: 12px }
.search-results a {
  display: block; padding: 10px 14px; border: 1px solid var(--c-border);
  border-radius: 6px; margin-bottom: 6px; text-decoration: none;
  font-size: .88rem; transition: background .15s;
}
.search-results a:hover { background: var(--c-forest-light) }
.search-results .search-title { font-weight: 600; color: var(--c-forest-deep) }
.search-results .search-desc { font-size: .8rem; color: var(--c-text-sec); margin-top: 2px }
.search-no-results { font-size: .85rem; color: var(--c-text-muted); padding: 8px 0 }

/* ---- CTA button ---- */
.btn-cta {
  display: inline-block; background: var(--c-warm); color: #fff; border: none;
  border-radius: var(--radius); padding: 12px 28px; font-size: .92rem;
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s var(--ease), transform .15s;
}
.btn-cta:hover { background: #e6693f; color: #fff; text-decoration: none; transform: scale(1.03) }

/* ---- Print ---- */
@media print {
  .header, .footer, .burger, .skip-link, .a11y-panel, .a11y-toggle, .hero-info, .search-overlay, .cookie-banner { display: none }
  body { font-size: 11pt; background: #fff; color: #000 }
  .hero { background: none; color: #000; padding: 8px 0 }
  .hero h1, .hero .lead { color: #000 }
  .card, .price-table { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid }
  .price-table caption { background: #333; color: #fff }
  a { color: #000; text-decoration: underline }
  main { padding: 0 }
}
