/* ===== VARIABLES ===== */
:root {
  --primary: #1a6e4a;
  --primary-light: #27a367;
  --primary-dark: #0f4a31;
  --accent: #f59e0b;
  --vip: #8b5cf6;
  --heart: #e11d48;
  --bg: #f0f4f2;
  --bg2: #e4ede8;
  --text: #1a2e24;
  --text2: #4a6558;
  --text3: #8aaa99;
  --border: #d1e0d8;
  --shadow: 0 4px 20px rgba(26,110,74,0.12);
  --shadow-sm: 0 2px 8px rgba(26,110,74,0.08);
  --radius: 16px;
  --topbar-h: 60px;
  --bottom-h: 70px;
  --sidebar-w: 260px;
  --font: 'Nunito', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); }
body { overflow: hidden; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }
a { text-decoration: none; }
.hidden { display: none !important; }

/* ══════════════════════════════
   ONBOARDING
══════════════════════════════ */
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: flex; flex-direction: column; }

#onboarding-screen {
  background: linear-gradient(145deg, #0f4a31 0%, #1a6e4a 55%, #27a367 100%);
  align-items: center; justify-content: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.onboard-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ob-circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05); }
.ob-circle.c1 { width: 380px; height: 380px; top: -100px; right: -80px; }
.ob-circle.c2 { width: 240px; height: 240px; bottom: 15%; left: -70px; }
.ob-circle.c3 { width: 180px; height: 180px; bottom: -40px; right: 25%; }

.onboard-content { position: relative; z-index: 1; width: 100%; max-width: 480px; padding: 32px 20px 60px; margin: auto; }
.logo-wrap { text-align: center; margin-bottom: 36px; color: white; }
.logo-icon {
  width: 88px; height: 88px; background: rgba(255,255,255,0.15);
  border-radius: 26px; display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 18px; backdrop-filter: blur(12px);
  border: 2px solid rgba(255,255,255,0.25); box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.logo-text { font-size: 36px; font-weight: 900; letter-spacing: -1px; }
.logo-sub { font-size: 14px; opacity: 0.8; margin-top: 6px; }

.onboard-card { background: white; border-radius: 28px; padding: 32px 28px; box-shadow: 0 24px 64px rgba(0,0,0,0.28); }
.onboard-card h2 { font-size: 19px; font-weight: 800; color: var(--primary); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }

.policy-text { font-size: 13px; line-height: 1.75; color: var(--text2); max-height: 220px; overflow-y: auto; padding-right: 6px; margin-bottom: 18px; }
.policy-text p { margin-bottom: 10px; }
.policy-text ul { padding-left: 20px; }
.policy-text li { margin-bottom: 5px; }

.policy-check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 22px; user-select: none; }
.policy-check input { display: none; }
.checkmark { width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.policy-check input:checked + .checkmark { background: var(--primary); border-color: var(--primary); }
.policy-check input:checked + .checkmark::after { content: '✓'; color: white; font-size: 14px; font-weight: 900; }

.btn-primary { width: 100%; padding: 15px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border: none; border-radius: 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 9px; transition: all 0.2s; box-shadow: 0 4px 16px rgba(26,110,74,0.35); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,110,74,0.4); }
.btn-primary:not(:disabled):active { transform: scale(0.98); }

.input-group { margin-bottom: 18px; }
.input-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 7px; }
.input-group input, .input-group select { width: 100%; padding: 13px 15px; background: var(--bg); border: 2px solid var(--border); border-radius: 12px; font-family: var(--font); font-size: 14px; color: var(--text); transition: border-color 0.2s; outline: none; }
.input-group input:focus, .input-group select:focus { border-color: var(--primary); background: white; }

/* ══════════════════════════════
   APP SCREEN — MOBILE (default)
══════════════════════════════ */
#app-screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
#app-screen.active { display: flex; }

/* TOPBAR */
.topbar {
  height: var(--topbar-h); background: var(--primary);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  flex-shrink: 0; z-index: 100; box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}
.burger-btn { width: 42px; height: 42px; background: rgba(255,255,255,0.15); border: none; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px; flex-shrink: 0; transition: background 0.2s; }
.burger-btn:hover { background: rgba(255,255,255,0.25); }
.burger-btn span { display: block; width: 20px; height: 2px; background: white; border-radius: 2px; transition: all 0.3s; }
.burger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.topbar-logo { flex: 1; font-size: 20px; font-weight: 900; color: white; letter-spacing: -0.5px; display: flex; align-items: center; gap: 9px; }
.topbar-search-btn { width: 42px; height: 42px; background: rgba(255,255,255,0.15); border: none; border-radius: 11px; color: white; font-size: 17px; flex-shrink: 0; transition: background 0.2s; }
.topbar-search-btn:hover { background: rgba(255,255,255,0.25); }

/* SIDEBAR */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.52); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

.sidebar { position: fixed; left: -280px; top: 0; bottom: 0; width: 260px; background: white; z-index: 300; display: flex; flex-direction: column; transition: left 0.32s cubic-bezier(0.4,0,0.2,1); box-shadow: 4px 0 24px rgba(0,0,0,0.16); }
.sidebar.open { left: 0; }

.sidebar-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); padding: 22px 16px; display: flex; align-items: center; gap: 13px; flex-shrink: 0; }
.sidebar-avatar { width: 50px; height: 50px; background: rgba(255,255,255,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: white; flex-shrink: 0; }
.sidebar-username { font-size: 15px; font-weight: 700; color: white; }
.sidebar-role { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 3px; }
.sidebar-close { margin-left: auto; background: rgba(255,255,255,0.15); border: none; width: 34px; height: 34px; border-radius: 9px; color: white; font-size: 16px; flex-shrink: 0; transition: background 0.2s; }
.sidebar-close:hover { background: rgba(255,255,255,0.28); }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 12px; color: var(--text2); font-size: 14px; font-weight: 600; text-decoration: none; transition: all 0.18s; margin-bottom: 2px; }
.nav-item i { width: 18px; text-align: center; color: var(--primary); }
.nav-item:hover, .nav-item.active { background: var(--bg); color: var(--primary); }
.nav-item.active { font-weight: 700; }
.nav-badge { margin-left: auto; background: var(--heart); color: white; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; min-width: 20px; text-align: center; }
.nav-divider { border: none; border-top: 1px solid var(--border); margin: 8px 6px; }
.sidebar-footer { padding: 16px; text-align: center; color: var(--text3); font-size: 12px; }

/* SEARCH BAR */
.search-bar-wrap { background: var(--primary-dark); padding: 10px 16px 14px; flex-shrink: 0; }
.search-bar { background: white; border-radius: 12px; display: flex; align-items: center; padding: 10px 14px; gap: 10px; border: 2px solid transparent; transition: border-color 0.2s; }
.search-bar:focus-within { border-color: var(--primary-light); }
.search-bar i { color: var(--text3); font-size: 15px; flex-shrink: 0; }
.search-bar input { flex: 1; border: none; outline: none; font-family: var(--font); font-size: 14px; color: var(--text); background: transparent; }
#search-close { background: none; border: none; color: var(--text3); font-size: 16px; flex-shrink: 0; }

/* ── MAIN SCROLL AREA ── */
.page-content {
  flex: 1;
  min-height: 0;          /* ← калиди асосӣ барои flex scroll */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--bottom-h);
}

.page { display: none; }
.page.active { display: block; }

/* HERO */
.hero-section { background: linear-gradient(135deg, var(--primary), var(--primary-light)); padding: 24px 20px; display: flex; align-items: center; justify-content: space-between; color: white; }
.hero-text h2 { font-size: 22px; font-weight: 900; }
.hero-text p { font-size: 13px; opacity: 0.85; margin-top: 5px; }
.hero-img { font-size: 52px; opacity: 0.28; }

/* SECTION TITLE */
.section-title { font-size: 15px; font-weight: 800; color: var(--text); padding: 16px 16px 10px; }

/* CATEGORIES */
.categories-section { background: white; border-bottom: 1px solid var(--border); overflow: visible; }
.categories-scroll {
  display: flex; gap: 8px; padding: 0 16px 14px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  will-change: scroll-position;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn { scroll-snap-align: start; }
.cat-btn { white-space: nowrap; padding: 8px 15px; background: var(--bg); border: 2px solid transparent; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--text2); transition: all 0.2s; flex-shrink: 0; }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.cat-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* CITY */
.city-section { padding-bottom: 4px; }
.city-scroll {
  display: flex; gap: 6px; padding: 0 16px 12px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  will-change: scroll-position;
}
.city-scroll::-webkit-scrollbar { display: none; }
.city-btn { scroll-snap-align: start; }
.city-btn { white-space: nowrap; padding: 6px 13px; background: white; border: 1.5px solid var(--border); border-radius: 16px; font-size: 12px; font-weight: 600; color: var(--text2); transition: all 0.2s; flex-shrink: 0; }
.city-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* MASTERS GRID */
.masters-section { padding: 0 0 8px; }
.masters-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 12px 12px; }

/* MASTER CARD */
.master-card { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; transition: transform 0.2s, box-shadow 0.2s; border: 2px solid transparent; }
.master-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.master-card.vip-card { border-color: var(--vip); }

.card-top { position: relative; background: linear-gradient(135deg, var(--bg2), var(--bg)); padding-top: 62%; }
.master-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.master-avatar-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; color: white; }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background: white; border: none; border-radius: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text3); box-shadow: 0 2px 8px rgba(0,0,0,0.16); transition: all 0.2s; }
.fav-btn.active { color: var(--heart); }
.fav-btn:hover { transform: scale(1.15); }
.vip-badge { position: absolute; top: 8px; left: 8px; background: var(--vip); color: white; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }

.card-body { padding: 10px; cursor: pointer; }
.master-name { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 3px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.master-prof { font-size: 11px; color: var(--primary); font-weight: 700; background: rgba(26,110,74,0.08); display: inline-block; padding: 2px 7px; border-radius: 6px; margin-bottom: 4px; }
.master-meta { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.master-meta i { font-size: 10px; color: var(--primary-light); }
.stars { display: flex; gap: 2px; margin: 4px 0; }
.star { font-size: 11px; color: #ddd; }
.star.filled { color: var(--accent); }

.card-actions { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid var(--bg); }
.act-btn { flex: 1; padding: 7px 6px; border: none; border-radius: 9px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; transition: all 0.2s; }
.act-btn.phone { background: rgba(26,110,74,0.1); color: var(--primary); }
.act-btn.whatsapp { background: rgba(37,211,102,0.1); color: #25d366; }
.act-btn:active { transform: scale(0.96); }

/* EMPTY */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text3); }
.empty-state i { font-size: 52px; margin-bottom: 14px; display: block; }
.empty-state p { font-size: 15px; font-weight: 600; }

/* INNER PAGES */
.inner-page { padding: 20px 16px; }
.page-heading { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.page-heading i { color: var(--primary); }

/* ABOUT */
.about-card { background: white; border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.about-icon { width: 68px; height: 68px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: white; margin: 0 auto 16px; }
.about-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.about-card p { font-size: 14px; line-height: 1.75; color: var(--text2); }
.about-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-item { background: white; border-radius: 14px; padding: 18px; text-align: center; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 26px; font-weight: 900; color: var(--primary); }
.stat-item span:last-child { font-size: 12px; color: var(--text3); font-weight: 600; }
.about-mission { background: white; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.about-mission h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.about-mission p { font-size: 14px; line-height: 1.75; color: var(--text2); }
.contact-info { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.contact-info h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.contact-btn { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; margin-bottom: 8px; transition: all 0.2s; }
.contact-btn.whatsapp { background: rgba(37,211,102,0.1); color: #1a7a40; }
.contact-btn.email { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.contact-btn:hover { opacity: 0.8; }

/* BANNERS */
.weekly-banner { background: linear-gradient(135deg, #f59e0b, #d97706); border-radius: var(--radius); padding: 22px; text-align: center; margin-bottom: 20px; color: white; }
.weekly-crown { font-size: 40px; margin-bottom: 8px; }
.weekly-banner p { font-size: 13px; opacity: 0.9; font-weight: 600; }
.vip-banner { background: linear-gradient(135deg, var(--vip), #6d28d9); border-radius: var(--radius); padding: 22px; text-align: center; margin-bottom: 20px; color: white; }
.vip-banner i { font-size: 40px; display: block; margin-bottom: 8px; }
.vip-banner p { font-size: 13px; opacity: 0.9; font-weight: 600; }

/* REGISTER */
.reg-info { font-size: 13px; color: var(--text2); line-height: 1.65; background: rgba(26,110,74,0.06); padding: 13px 15px; border-radius: 12px; margin-bottom: 20px; border-left: 4px solid var(--primary); }
.reg-form { background: white; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.location-row { display: flex; gap: 8px; }
.location-row input { flex: 1; }
.btn-loc { width: 46px; height: 46px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 17px; flex-shrink: 0; transition: background 0.2s; }
.btn-loc:hover { background: var(--primary-dark); }
#location-status { display: block; font-size: 11px; color: var(--text3); margin-top: 5px; }
.reg-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-send { flex: 1; padding: 14px; border: none; border-radius: 12px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 7px; transition: all 0.2s; }
.btn-send.whatsapp { background: #25d366; color: white; }
.btn-send.email { background: #3b82f6; color: white; }
.btn-send:hover { opacity: 0.9; }
.btn-send:active { transform: scale(0.97); }

/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-h); background: white; display: flex; border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(0,0,0,0.08); z-index: 50; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: none; color: var(--text3); font-size: 10px; font-weight: 600; transition: color 0.2s; position: relative; }
.bn-item i { font-size: 20px; }
.bn-item.active { color: var(--primary); }
.bn-item.active::after { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 3px; background: var(--primary); border-radius: 0 0 4px 4px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 500; align-items: flex-end; backdrop-filter: blur(4px); }
.modal-overlay:not(.hidden) { display: flex; }
.modal-card { background: white; width: 100%; max-height: 90vh; border-radius: 26px 26px 0 0; overflow-y: auto; position: relative; padding-bottom: 32px; animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-close { position: sticky; top: 0; float: right; clear: both; margin: 14px 14px 0 0; width: 36px; height: 36px; background: var(--bg); border: none; border-radius: 50%; font-size: 16px; color: var(--text2); z-index: 10; }
.modal-close:hover { background: var(--border); }

.modal-master-hero { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); padding: 70px 22px 30px; color: white; display: flex; gap: 18px; align-items: center; }
.modal-avatar { width: 92px; height: 92px; border-radius: 22px; object-fit: cover; border: 3px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.modal-avatar-ph { width: 92px; height: 92px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 900; color: white; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.modal-name { font-size: 20px; font-weight: 900; }
.modal-prof { font-size: 13px; opacity: 0.85; margin-top: 3px; }
.modal-stars { display: flex; gap: 3px; margin-top: 7px; }
.modal-star { font-size: 14px; color: rgba(255,255,255,0.3); }
.modal-star.filled { color: var(--accent); }
.modal-body { padding: 20px; }
.modal-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.modal-info-item { background: var(--bg); border-radius: 12px; padding: 13px; }
.modal-info-item .label { font-size: 11px; color: var(--text3); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.modal-info-item .value { font-size: 14px; font-weight: 700; color: var(--text); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 14px; border: none; font-size: 15px; font-weight: 700; transition: all 0.2s; }
.modal-btn.phone { background: var(--primary); color: white; }
.modal-btn.whatsapp { background: #25d366; color: white; }
.modal-btn:hover { opacity: 0.9; }
.modal-btn:active { transform: scale(0.98); }

/* RATING */
.rating-section { margin-bottom: 20px; }
.rating-section h4 { font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.rate-stars { display: flex; gap: 6px; }
.rate-star { font-size: 30px; color: #ddd; cursor: pointer; transition: color 0.15s, transform 0.15s; }
.rate-star.hover, .rate-star.selected { color: var(--accent); transform: scale(1.12); }

/* TOAST */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(15,74,49,0.94); color: white; padding: 11px 22px; border-radius: 22px; font-size: 13px; font-weight: 600; z-index: 9999; white-space: nowrap; pointer-events: none; animation: fadeInOut 2.5s ease forwards; }
@keyframes fadeInOut { 0% { opacity: 0; transform: translateX(-50%) translateY(12px); } 15% { opacity: 1; transform: translateX(-50%) translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; } }

/* SCROLLBAR */
.page-content::-webkit-scrollbar { width: 4px; }
.page-content::-webkit-scrollbar-track { background: transparent; }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════
   TABLET  ≥ 600px
══════════════════════════════ */
@media (min-width: 600px) {
  .masters-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px 16px 16px; }
  .about-stats { grid-template-columns: repeat(4, 1fr); }
  .hero-text h2 { font-size: 26px; }
  .hero-img { font-size: 64px; }
  .modal-card { max-width: 520px; margin: auto; border-radius: 26px; }
  .modal-overlay { align-items: center; }
  .inner-page { padding: 24px; }
}

/* ══════════════════════════════
   DESKTOP  ≥ 960px
   Sidebar доимӣ, bottom-nav нест
══════════════════════════════ */
@media (min-width: 960px) {
  :root { --topbar-h: 64px; --bottom-h: 0px; }

  /* Sidebar ҳамеша кушода */
  .sidebar {
    position: fixed;
    left: 0; top: var(--topbar-h); bottom: 0;
    width: var(--sidebar-w);
    transition: none;
    box-shadow: none;
    border-right: 1px solid var(--border);
    z-index: 10;
  }
  .sidebar-close { display: none; }
  .sidebar-overlay { display: none !important; }
  .burger-btn { display: none; }

  /* App screen — topbar + content side by side */
  #app-screen {
    display: none; /* default — JS .active кор мекунад */
    flex-direction: column;
  }
  #app-screen.active {
    display: flex;
    flex-direction: column;
  }

  /* Page content дар тарафи рост аз sidebar */
  .page-content {
    margin-left: var(--sidebar-w);
    padding-bottom: 24px;
  }

  /* Topbar пурра */
  .topbar { padding: 0 28px; }
  .topbar-logo { font-size: 22px; }

  /* Search bar */
  .search-bar-wrap { margin-left: var(--sidebar-w); }

  /* Bottom nav пинҳон */
  .bottom-nav { display: none; }

  /* Grid */
  .masters-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 8px 24px 24px; }

  /* Hero */
  .hero-section { padding: 36px 32px; }
  .hero-text h2 { font-size: 28px; }
  .hero-img { font-size: 72px; }

  .categories-scroll { padding: 0 24px 16px; }
  .city-scroll { padding: 0 24px 14px; }
  .section-title { padding: 18px 24px 12px; font-size: 16px; }
  .inner-page { padding: 28px 32px; }
  .about-stats { grid-template-columns: repeat(4, 1fr); }

  /* Modal */
  .modal-overlay { align-items: center; }
  .modal-card { max-width: 600px; width: 90%; border-radius: 28px; margin: auto; max-height: 88vh; animation: fadeScale 0.28s cubic-bezier(0.4,0,0.2,1); }
  @keyframes fadeScale { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

  .toast { bottom: 32px; }
}

/* ══════════════════════════════
   WIDE DESKTOP  ≥ 1280px
══════════════════════════════ */
@media (min-width: 1280px) {
  :root { --sidebar-w: 280px; }
  .masters-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 10px 28px 28px; }
  .hero-section { padding: 44px 40px; }
  .hero-text h2 { font-size: 32px; }
  .hero-img { font-size: 88px; }
  .categories-scroll { padding: 0 28px 18px; }
  .city-scroll { padding: 0 28px 16px; }
  .inner-page { padding: 32px 40px; }
}

/* ══════════════════════════════
   ULTRA WIDE  ≥ 1600px
══════════════════════════════ */
@media (min-width: 1600px) {
  :root { --sidebar-w: 300px; }
  .masters-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }
}

/* ══════════════════════════════
   SMALL PHONE  ≤ 380px
══════════════════════════════ */
@media (max-width: 380px) {
  :root { --topbar-h: 54px; --bottom-h: 62px; }
  .topbar-logo { font-size: 17px; }
  .hero-text h2 { font-size: 18px; }
  .masters-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 4px 8px 8px; }
  .master-name { font-size: 12px; }
  .cat-btn { font-size: 12px; padding: 7px 11px; }
  .bn-item i { font-size: 18px; }
  .bn-item { font-size: 9px; }
}