/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #e8453c;
  --red-dark: #c73a31;
  --text: #222;
  --text-muted: #717171;
  --border: #ebebeb;
  --border-hover: #b0b0b0;
  --bg: #fff;
  --bg-gray: #f7f7f7;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow: 0 2px 12px rgba(0,0,0,.12);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ===== NAV ===== */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 26px; }

/* Поисковая пилюля */
.search-pill {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
  background: #fff;
  height: 48px;
}
.search-pill:focus-within {
  box-shadow: var(--shadow);
}
.sp-seg {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.sp-seg-wide { flex: 1 1 0; min-width: 0; }
.sp-seg:last-of-type { border-right: none; }
.sp-label {
  display: none;
}
.sp-city-sel, .sp-seg input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0;
  outline: none;
  width: 100%;
  cursor: pointer;
}
.sp-btn {
  background: var(--red);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.sp-btn:hover { background: var(--red-dark); }
.sp-btn svg { width: 16px; height: 16px; color: #fff; }

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.nav-link:hover { background: var(--bg-gray); }
.nav-messages { position: relative; }
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 4px;
}
.btn-login {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: box-shadow .15s;
  background: #fff;
}
.btn-login:hover { box-shadow: var(--shadow-sm); }

/* User dropdown */
.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 6px 10px 6px 14px;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s;
}
.nav-user-btn:hover { box-shadow: var(--shadow-sm); }
.nav-ava-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.nav-ava-placeholder {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.chevron { width: 10px; height: 6px; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 200px;
  padding: 8px 0;
  z-index: 200;
}
.nav-dropdown.open { display: block; }
.dropdown-name {
  padding: 8px 16px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.nav-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  transition: background .1s;
}
.nav-dropdown a:hover { background: var(--bg-gray); }
.nav-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-logout { color: var(--red) !important; }

/* ===== CATEGORY TABS ===== */
.cat-scroll-wrap {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 80px;
  z-index: 90;
}
.cat-scroll {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 56px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.cat-item:hover { border-bottom-color: var(--border); color: var(--text); }
.cat-item.active { border-bottom-color: var(--text); color: var(--text); }
.cat-icon { font-size: 18px; line-height: 1; }

/* ===== MAIN WRAP ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  flex: 1;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}
.section-title { font-size: 22px; font-weight: 600; }
.see-all {
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  color: var(--text);
}

/* ===== SERVICE CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
.svc-card { cursor: pointer; }
.card-img-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-gray);
  position: relative;
  margin-bottom: 10px;
  transition: transform .2s;
}
.svc-card:hover .card-img-wrap { transform: scale(1.01); }
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card-img-emoji {
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  width: 100%;
  height: 100%;
}
.promo-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.card-heart {
  position: absolute;
  top: 10px; right: 12px;
  font-size: 20px;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
  background: none;
  border: none;
  line-height: 1;
}
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; }
.card-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.card-rating { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.star { font-size: 11px; }
.card-price { font-size: 14px; font-weight: 600; margin-top: 6px; }
.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.author-ava {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.author-name { font-size: 12px; color: var(--text-muted); }
.badges-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.badge-pill {
  font-size: 10px;
  background: var(--bg-gray);
  border-radius: 4px;
  padding: 2px 6px;
  color: #555;
  font-weight: 500;
}

/* Широкая промо-карточка */
.svc-card.promo-wide { grid-column: span 2; }
.promo-wide .card-img-wrap { aspect-ratio: 2 / 1; }
.promo-wide .card-img { font-size: 80px; }

/* ===== NANNIES GRID ===== */
.nannies-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.nanny-card { cursor: pointer; text-align: center; }
.nanny-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg-gray);
  margin-bottom: 10px;
  transition: transform .2s;
}
.nanny-card:hover .nanny-photo { transform: scale(1.01); }
.nanny-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.nanny-photo-emoji {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
}
.verified-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  background: #fff;
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.nanny-heart {
  position: absolute;
  top: 10px; right: 12px;
  font-size: 18px;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
  background: none; border: none; line-height: 1;
}
.nanny-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.nanny-city { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.nanny-rating { font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 6px; }
.nanny-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.tag-pill { font-size: 11px; background: var(--bg-gray); border-radius: 20px; padding: 3px 10px; color: #555; }

/* ===== FORMS ===== */
.form-wrap {
  max-width: 480px;
  margin: 60px auto;
  padding: 0 24px;
}
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.form-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.form-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--text);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: #b91c1c;
  margin-bottom: 20px;
}
.form-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: #15803d;
  margin-bottom: 20px;
}
.btn-primary {
  width: 100%;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #444; }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.form-footer a { color: var(--text); font-weight: 600; text-decoration: underline; }
.tabs-auth { display: flex; gap: 0; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.tab-btn.active { background: var(--text); color: #fff; }

/* ===== ALERT ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 32px;
}
.footer-logo { font-size: 18px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.footer-col h4 { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; transition: color .15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links-bottom { display: flex; gap: 20px; }
.footer-links-bottom a:hover { color: var(--text); text-decoration: underline; }

/* ===== OVERLAY ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 50;
}
.overlay.show { display: block; }

/* ===== UTILS ===== */
.divider { height: 1px; background: var(--border); margin: 40px 0; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .nannies-grid { grid-template-columns: repeat(3, 1fr); }
  .svc-card.promo-wide { grid-column: span 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { padding: 0 12px; height: 60px; }
  .nav-inner { gap: 8px; }
  .search-pill { display: none; }
  .nav-link { display: none; }
  .btn-login { padding: 7px 14px; font-size: 13px; white-space: nowrap; }
  .logo-icon { display: none; }
  .logo { font-size: 16px; }
  .nav-right { gap: 6px; margin-left: auto; }
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .nannies-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px 40px; }
  .footer-inner { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px; }
  .svc-card.promo-wide { grid-column: span 2; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
  .case-section { grid-template-columns: 1fr; }
  .case-img { display: none; }
  .cta-banner { flex-direction: column; text-align: center; padding: 28px 20px; }
  h1 { font-size: 26px; }
  .hero { padding: 32px 0 24px; }
  .cat-scroll-wrap { top: 60px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .search-pill { max-width: 340px; }
  .sp-seg:first-child { min-width: 80px; }
  .nav-link { display: none; }
}