/* ============================================================
   YaqinJoy — qayta ishlatiladigan komponentlar.
   Har komponent mustaqil: birini o'zgartirish boshqasini buzmaydi.
   ============================================================ */

/* ── Tugmalar ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px;
  border-radius: var(--r-md);
  font-size: 15.5px; font-weight: 700;
  transition: transform 0.12s ease, opacity 0.15s ease;
  user-select: none;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost { background: var(--bg-input); color: var(--text); }
.btn-sm { padding: 10px 14px; font-size: 13.5px; border-radius: var(--r-sm); width: auto; }
.btn-danger { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.btn-green { background: var(--green); color: #fff; }

/* ── Inputlar (1-mockup uslubi) ── */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.field label .req { color: var(--red); }
.input, .textarea, .select {
  width: 100%; padding: 14px 15px;
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px; color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); }
.input.error { border-color: var(--red); }
.textarea { min-height: 104px; resize: vertical; }
.select-wrap { position: relative; }
.select { appearance: none; padding-right: 40px; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.char-count { text-align: right; font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field-err { color: var(--red); font-size: 12px; margin-top: 6px; display: none; }
.field-err.show { display: block; }

/* ── Toggle (1-mockup ish vaqti) ── */
.toggle { position: relative; width: 46px; height: 27px; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle .knob {
  position: absolute; inset: 0; background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full); transition: background 0.18s ease;
}
.toggle .knob::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 19px; height: 19px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.18s ease;
}
.toggle input:checked + .knob { background: var(--blue); border-color: var(--blue); }
.toggle input:checked + .knob::after { transform: translateX(18px); }

/* ── Chiplar ── */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-full);
  background: var(--bg-chip); color: var(--text);
  font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--border);
  white-space: nowrap; flex: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ── Status badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700;
}
.badge-open { background: var(--green-soft); color: var(--green); }
.badge-closed { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--orange); }

/* ── Reyting yulduzi ── */
.stars { color: var(--yellow); display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }

/* ── Karta (ro'yxat elementi, 3-mockup) ── */
.biz-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-card); border-radius: var(--r-lg);
  padding: 12px; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform 0.12s ease;
}
.biz-card:active { transform: scale(0.988); }
.biz-thumb {
  width: 74px; height: 74px; border-radius: var(--r-md);
  object-fit: cover; flex: none; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.biz-thumb svg { width: 30px; height: 30px; }

/* ── Gorizontal karusel kartasi (2-mockup) ── */
.pop-card {
  width: 168px; flex: none; border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-card); box-shadow: var(--shadow-card); cursor: pointer;
}
.pop-img { position: relative; height: 108px; background: var(--bg-input); }
.pop-img .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pop-img .ph svg { width: 36px; height: 36px; }
.pop-logo {
  position: absolute; left: 10px; bottom: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid #fff; overflow: hidden; background: var(--bg-navy);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 800;
}
.pop-open { position: absolute; right: 8px; bottom: 8px; }
.pop-heart {
  position: absolute; right: 8px; top: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.pop-heart.on { color: var(--red); }
.pop-body { padding: 10px 12px 12px; }

/* ── Kategoriya grid (3-mockup) ── */
.cat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 6px;
  background: var(--bg-card); border-radius: var(--r-lg);
  padding: 16px 10px; box-shadow: var(--shadow-card);
}
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.cat-item:active .cat-ic { transform: scale(0.92); }
.cat-ic {
  width: 50px; height: 50px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease;
}
.cat-ic svg { width: 24px; height: 24px; }
.cat-item span {
  font-size: 11px; font-weight: 600; color: var(--text);
  text-align: center; max-width: 64px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Pastki navigatsiya ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--page-max);
  height: var(--nav-h);
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 60;
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 10.5px; font-weight: 600;
}
.bn-item.active { color: var(--blue); }
.bn-fab-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.bn-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
  margin-top: -22px;
  transition: transform 0.12s ease;
}
.bn-fab:active { transform: scale(0.93); }

/* ── Top bar (ichki sahifalar) ── */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; position: sticky; top: 0; z-index: 40;
  background: var(--bg);
}
.topbar .title { flex: 1; text-align: center; font-size: 16.5px; font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); box-shadow: var(--shadow-card);
  color: var(--text); flex: none;
}
.icon-btn.plain { background: transparent; box-shadow: none; }

/* ── Toast xabarlar ── */
#toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 20px); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(92vw, 480px); pointer-events: none;
}
.toast {
  background: #1e293b; color: #fff;
  padding: 12px 18px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-float);
  animation: toastIn 0.25s ease;
  max-width: 100%; text-align: center;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ── Bottom sheet ── */
.sheet-back {
  position: fixed; inset: 0; background: rgba(4, 8, 20, 0.55);
  z-index: 150; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--page-max);
  background: var(--bg-card);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  z-index: 160; animation: sheetIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetIn { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-grip { width: 42px; height: 4.5px; border-radius: 3px; background: var(--border); margin: 4px auto 14px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 6px; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--border); text-align: left; color: var(--text);
}
.sheet-item:last-child { border-bottom: 0; }

/* ── Progress bar (wizard, 1-mockup) ── */
.wiz-progress { display: flex; align-items: center; gap: 8px; padding: 4px 16px 14px; }
.wiz-track { flex: 1; height: 4px; border-radius: 3px; background: var(--bg-input); position: relative; overflow: hidden; }
.wiz-fill { position: absolute; inset: 0 auto 0 0; background: var(--blue); border-radius: 3px; transition: width 0.3s ease; }
.wiz-step-label { font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; }

/* ── Bo'sh holat ── */
.empty-state { text-align: center; padding: 60px 30px; color: var(--text-2); }
.empty-state .ic { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--text-3); }

/* ── Verified belgisi ── */
.vcheck { color: var(--green); flex: none; }

/* ── Avatar / logo doira ── */
.logo-circle {
  border-radius: 50%; background: linear-gradient(135deg, #1e2b52, #0f1b3d);
  color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none;
}
.logo-circle img { width: 100%; height: 100%; object-fit: cover; }
