/* ===== RESET ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #1c1c1e; background: #fff; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
body { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ===== TOPBAR ===== */
.topbar { border-bottom: 1px solid #eee; background: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 14px 20px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; flex-shrink: 0; }
.logo span { color: #e91e63; }
.mainnav { display: flex; gap: 18px; font-size: 14px; color: #444; }
.mainnav a:hover { color: #e91e63; }
.topbar-search { margin-left: auto; display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; padding: 4px 8px; }
.topbar-search input { border: 0; outline: 0; width: 220px; font-size: 14px; background: transparent; }
.topbar-search button { border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #666; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { font-size: 18px; color: #666; }
.btn-login { background: #e91e63; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; border: 0; cursor: pointer; }
.burger { display: none; background: transparent; border: 0; font-size: 22px; color: #333; cursor: pointer; padding: 4px 8px; }

/* ===== BREADCRUMBS / TITLE ===== */
.crumbs { max-width: 1200px; margin: 20px auto 0; padding: 0 20px; font-size: 13px; color: #888; }
.crumbs a:hover { color: #e91e63; }
.page-title { max-width: 1200px; margin: 12px auto 4px; padding: 0 20px; font-size: 32px; line-height: 1.15; }
.page-meta { max-width: 1200px; margin: 0 auto 18px; padding: 0 20px; font-size: 13px; color: #888; }

/* ===== FILTERS ===== */
.filters { max-width: 1200px; margin: 0 auto 24px; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.filter-block { display: flex; flex-direction: column; gap: 4px; }
.filter-block label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }
.filter-block select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; background: #fff; min-width: 140px; }
.filter-chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 16px; font-size: 13px; background: #f4f4f6; color: #555; cursor: pointer; white-space: nowrap; }
.chip-active { background: #ffe4ee; color: #e91e63; font-weight: 600; }

/* ===== GRID ===== */
.section-head { max-width: 1200px; margin: 0 auto 14px; padding: 0 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; margin: 0; }
.sort { font-size: 13px; color: #888; }
.more { font-size: 13px; color: #e91e63; white-space: nowrap; }

.grid { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card { border: 1px solid #eee; border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.card-cover { height: 140px; background: linear-gradient(135deg, #ffe4ee, #ffd0e0); display: flex; align-items: center; justify-content: center; font-size: 36px; color: #e91e63; }
.card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 11px; color: #e91e63; text-transform: uppercase; font-weight: 600; letter-spacing: 0.4px; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.card-author { font-size: 12px; color: #888; line-height: 1.4; }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; }
.card-price b { font-size: 18px; }
.card-price s { color: #aaa; font-size: 13px; }
.card-rating { font-size: 12px; color: #888; }
.card-btn { margin-top: 8px; background: #e91e63; color: #fff; border: 0; padding: 11px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; }

/* ===== EXPERTS / SCHOOLS ===== */
.block { max-width: 1200px; margin: 40px auto 0; padding: 0 20px; }
.experts, .schools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.expert, .school { border: 1px solid #eee; border-radius: 12px; padding: 14px; }
.expert b, .school b { display: block; font-size: 15px; margin-bottom: 4px; }
.expert span, .school span { font-size: 13px; color: #888; line-height: 1.4; }

/* ===== SEO ===== */
.seo-block { padding-top: 12px; padding-bottom: 24px; color: #444; font-size: 15px; line-height: 1.65; }
.seo-block h2 { font-size: 22px; color: #1c1c1e; line-height: 1.2; }
.seo-block h3 { font-size: 18px; color: #1c1c1e; margin-top: 24px; }
.seo-block ul { padding-left: 20px; }
.seo-block li { margin: 8px 0; }
.seo-block p { margin: 10px 0; }

/* ===== FOOTER ===== */
.footer { border-top: 1px solid #eee; margin-top: 40px; padding: 32px 20px 16px; background: #fafafa; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-col b { display: block; margin-bottom: 10px; font-size: 14px; }
.footer-col a { display: block; font-size: 13px; color: #666; margin: 6px 0; }
.footer-col a:hover { color: #e91e63; }
.footer-logo { font-size: 20px; font-weight: 800; }
.footer-logo span { color: #e91e63; }
.footer-desc { font-size: 13px; color: #888; margin-top: 8px; line-height: 1.5; }
.footer-copy { max-width: 1200px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid #eee; font-size: 12px; color: #999; text-align: center; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 16px; padding: 28px 24px; width: 380px; max-width: 100%; position: relative; text-align: center; max-height: 92vh; overflow-y: auto; }
.modal-box .close { position: absolute; top: 10px; right: 12px; background: transparent; border: 0; font-size: 24px; cursor: pointer; color: #999; line-height: 1; padding: 4px; }
.modal-box h2 { margin: 0 0 8px; font-size: 20px; }
.modal-box .hint { font-size: 13px; color: #888; margin: 8px 0; line-height: 1.5; }
.modal-box .btn-wa { background: #25D366; color: #fff; border: 0; padding: 14px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 10px; }
.modal-box .qr-box { background: #f7f7f9; border-radius: 12px; padding: 16px; margin: 12px 0; display: flex; align-items: center; justify-content: center; }
.modal-box .qr-box img { width: 260px; height: 260px; max-width: 100%; height: auto; aspect-ratio: 1/1; }
.modal-box .err { color: #d32f2f; font-weight: 600; }
.modal-box .ok { color: #25a244; font-weight: 600; }
.modal-box .btn-mgr { background: #e91e63; color: #fff; border: 0; padding: 14px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .experts, .schools { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .mainnav { display: none; }
  .topbar-search { display: none; }
  .burger { display: block; }
  .topbar-inner { gap: 12px; padding: 12px 16px; }
  .page-title { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .experts, .schools { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .crumbs { font-size: 12px; padding: 0 16px; margin-top: 14px; white-space: nowrap; overflow-x: auto; }
  .page-title { font-size: 22px; padding: 0 16px; margin-top: 10px; }
  .page-meta { padding: 0 16px; margin-bottom: 14px; font-size: 12px; }

  .filters { padding: 0 16px; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  .filter-block { width: 100%; }
  .filter-block select { width: 100%; }
  .filter-chips { margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .filter-chips::-webkit-scrollbar { display: none; }

  .section-head { padding: 0 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .section-head h2 { font-size: 18px; }

  .grid { padding: 0 16px; grid-template-columns: 1fr; gap: 12px; }
  .card-cover { height: 160px; }
  .card-body { padding: 12px; }

  .block { padding: 0 16px; margin-top: 28px; }
  .experts, .schools { grid-template-columns: 1fr; }

  .seo-block { font-size: 14px; padding-left: 16px; padding-right: 16px; }
  .seo-block h2 { font-size: 19px; }
  .seo-block h3 { font-size: 16px; }

  .footer { padding: 24px 16px 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }

  .modal-box { padding: 22px 18px; }
  .modal-box .qr-box img { width: 220px; }
  .modal-box h2 { font-size: 18px; }
}

@media (max-width: 360px) {
  .logo { font-size: 19px; }
  .btn-login { padding: 7px 12px; font-size: 13px; }
  .page-title { font-size: 20px; }
  .modal-box .qr-box img { width: 180px; }
}

/* ===== CARD IMAGE ===== */
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.card-cover {
  overflow: hidden;
  background: linear-gradient(135deg, #ffe4ee, #ffd0e0);
}

/* ==== MODAL UPGRADE ==== */
.modal-box { max-width: 440px; }
.steps { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 10px 0; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.steps:last-of-type { border-bottom: 0; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: #00a884; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.step-text { font-size: 14px; color: #333; line-height: 1.4; padding-top: 4px; }
.btn-open-wa { display: block; margin: 12px auto; padding: 12px 20px; background: #25D366; color: #fff; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; text-align: center; width: 100%; }
.btn-open-wa:hover { background: #1da851; }
.progress-wrap { margin-top: 16px; }
.progress { width: 100%; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #00a884, #25D366); width: 0%; transition: width .4s ease; }
.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; margin: 0 auto 16px; }
.ok.big { font-size: 20px; font-weight: 700; color: #25a244; margin: 0 0 8px; }
.hint.small { font-size: 11px; color: #aaa; margin-top: 12px; }

/* ==== MODAL UPGRADE ==== */
.modal-box { max-width: 440px; }
.steps { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 10px 0; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.steps:last-of-type { border-bottom: 0; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: #00a884; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.step-text { font-size: 14px; color: #333; line-height: 1.4; padding-top: 4px; }
.btn-open-wa { display: block; margin: 12px auto; padding: 12px 20px; background: #25D366; color: #fff; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; text-align: center; width: 100%; }
.btn-open-wa:hover { background: #1da851; }
.progress-wrap { margin-top: 16px; }
.progress { width: 100%; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #00a884, #25D366); width: 0%; transition: width .4s ease; }
.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; margin: 0 auto 16px; }
.ok.big { font-size: 20px; font-weight: 700; color: #25a244; margin: 0 0 8px; }
.hint.small { font-size: 11px; color: #aaa; margin-top: 12px; }
.hidden { display: none !important; }

/* ==== SECURITY BADGES ==== */
.security-badges { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f0f0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sec-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #999; }
.sec-icon { font-size: 12px; }
