/* Diqqat: --text va --hint ATAYLAB Telegram'ning --tg-theme-* o'zgaruvchilariga
   bog'lanmagan. Ba'zi mijozlarda (masalan Telegram Desktop) bu qiymatlar qorong'i
   rejimda ham noto'g'ri (och fon uchun mo'ljallangan qora) rangni yuborib, matnni
   fonga singdirib yuborishi kuzatildi. Shu sababli fon, aksent va matn — barchasi
   o'zimizning fixed brend ranglarimiz orqali, faqat prefers-color-scheme /
   data-theme asosida boshqariladi. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f3fc;
  --bg-wash: #ece3fb;
  --text: #18151f;
  --hint: #6f6a7a;
  --accent-1: #6656e8;
  --accent-2: #e8569e;
  --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --accent-text: #ffffff;
  --link: var(--accent-1);
  --heart: #ef4577;
  --border: rgba(24, 16, 48, 0.07);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(102, 86, 232, 0.07), 0 14px 28px rgba(102, 86, 232, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1820;
    --bg-soft: #121016;
    --bg-wash: #1a1722;
    --text: #f5f3fa;
    --hint: #b3aec2;
    --accent-1: #8172f5;
    --accent-2: #d873ac;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 28px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f3fc;
  --bg-wash: #ece3fb;
  --text: #18151f;
  --hint: #6f6a7a;
  --accent-1: #6656e8;
  --accent-2: #e8569e;
  --border: rgba(24, 16, 48, 0.07);
  --shadow: 0 2px 6px rgba(102, 86, 232, 0.07), 0 14px 28px rgba(102, 86, 232, 0.12);
}

:root[data-theme="dark"] {
  --bg: #1a1820;
  --bg-soft: #121016;
  --bg-wash: #1a1722;
  --text: #f5f3fa;
  --hint: #b3aec2;
  --accent-1: #8172f5;
  --accent-2: #d873ac;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 28px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg-wash) 0%, var(--bg-soft) 380px, var(--bg-soft) 100%);
  color: var(--text);
  padding-bottom: 88px;
  overscroll-behavior-y: contain;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--hint);
  font-size: 14.5px;
  line-height: 1.55;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}

.bazis-services-bar {
  position: sticky;
  top: 51px;
  z-index: 19;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: var(--accent-gradient);
  color: var(--accent-text);
  font-family: inherit;
  font-weight: 700;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.bazis-services-bar svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.topbar-logo {
  height: 26px;
  object-fit: contain;
  border-radius: 7px;
  padding: 5px 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-icon-btn svg {
  width: 19px;
  height: 19px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Search */
.search-wrap {
  padding: 10px 16px 6px;
  background: var(--bg);
}

.search-close-btn {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px 4px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--hint);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  width: 100%;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--hint);
}

/* Banner carousel */
.banner-wrap {
  padding: 10px 16px 2px;
}

.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  border-radius: var(--radius-lg);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.banner-track::-webkit-scrollbar {
  display: none;
}

.banner-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.15s ease, width 0.15s ease;
}

.banner-dot.active {
  background: var(--accent-1);
  width: 16px;
  border-radius: 3px;
}

/* Category tabs */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  position: sticky;
  top: 63px;
  background: var(--bg);
  z-index: 18;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tab:active {
  transform: scale(0.96);
}

.tab.active {
  background: var(--accent-1);
  color: var(--accent-text);
  font-weight: 600;
}

/* Product grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 16px 12px;
}

.card {
  position: relative;
  background: var(--bg);
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:active {
  transform: scale(0.97);
}

.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--border);
  display: block;
}

.card-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.card-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #b0b0b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

@media (prefers-color-scheme: dark) {
  .card-fav-btn {
    background: rgba(20, 20, 26, 0.65);
  }
}

.card-fav-btn svg {
  width: 16px;
  height: 16px;
}

.card-fav-btn.active {
  color: var(--heart);
}

.card-fav-btn.active svg {
  fill: var(--heart);
}

.card-body {
  padding: 10px 12px 13px;
}

.card-name {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.card-price {
  font-size: 15px;
  color: var(--accent-1);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card-price-old {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hint);
  margin-right: 4px;
  text-decoration: line-through;
}

.card-discount-percent {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e6483f;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.card-discount-label {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.9;
}

.card-sold {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
}

/* Skeleton loading */
.skeleton {
  cursor: default;
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.shimmer {
  background: linear-gradient(90deg, var(--border) 25%, rgba(150, 150, 150, 0.18) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--hint);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.6;
}

/* Phone gate */
.phone-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 6px;
}

.phone-gate-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.phone-gate h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px;
}

.phone-gate .btn {
  margin-top: 18px;
  max-width: 320px;
}

.phone-gate-status {
  margin-top: 10px;
  font-size: 13px;
}

/* Detail view */
.detail {
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
}

.detail-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  opacity: 0.5;
}

.icon-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 26, 0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 5;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.detail-content {
  padding: 18px 16px 8px;
}

.detail-category {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-1);
}

.detail-content h2 {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.price {
  font-size: 21px;
  font-weight: 800;
  color: var(--accent-1);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.detail-sold {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hint);
  margin: -6px 0 12px;
}

.price-old {
  font-size: 15px;
  font-weight: 600;
  color: var(--hint);
  margin-right: 6px;
  text-decoration: line-through;
}

.detail-discount-percent {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6483f;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.detail-discount-label {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.detail-link-btn {
  margin: 0 0 14px;
}

.detail-spacer {
  height: 8px;
}

.icon-btn-static {
  position: static;
  background: var(--bg-soft);
  color: var(--text);
  backdrop-filter: none;
  flex-shrink: 0;
}

.icon-btn-right {
  left: auto;
  right: 14px;
}

.icon-btn.active {
  color: var(--heart);
}

.icon-btn.active svg {
  fill: var(--heart);
}

/* Cart view */
.cart-view {
  padding: 14px 16px 180px;
  animation: fadeIn 0.18s ease;
}

.cart-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cart-view-header h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.cart-clear-btn {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
  padding: 12px;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}

.cart-item-thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.cart-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item-top {
  min-width: 0;
}

.cart-item-name {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-unit-price {
  font-size: 13px;
  color: var(--hint);
  margin: 0;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-line-total {
  flex: 1;
  text-align: right;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--accent-1);
}

.cart-item-remove {
  border: none;
  background: var(--bg-soft);
  color: var(--hint);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cart-item-remove svg {
  width: 15px;
  height: 15px;
}

/* Quantity stepper */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px;
  flex-shrink: 0;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(20, 15, 40, 0.08);
}

.qty-value {
  min-width: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(20, 20, 26, 0.92);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 40;
  white-space: nowrap;
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Sticky buy bar */
.buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 25;
}

.buy-bar-stacked {
  /* Savatcha ko'rinishida pastki tab-panel ham bir vaqtda ko'rinadi — shu tugma
     undan ustiga tushib, uni bekitib qo'ymasligi uchun aynan tab-panel balandligicha
     yuqoriroqqa suriladi. */
  bottom: calc(64px + env(safe-area-inset-bottom));
  flex-direction: column;
  align-items: stretch;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 16px rgba(20, 15, 40, 0.08);
}

.buy-bar-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 2px;
}

.buy-bar-label {
  font-size: 13px;
  color: var(--hint);
  font-weight: 600;
}

.buy-bar-amount {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--accent-1);
}

.buy-bar-btn {
  flex: 1;
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--accent-text);
  box-shadow: 0 6px 16px rgba(102, 86, 232, 0.22);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
}

.full {
  width: 100%;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.45);
  z-index: 29;
  animation: fadeIn 0.15s ease;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 6px auto 14px;
}

.sheet h3 {
  margin: 0 0 14px;
  font-size: 17.5px;
  font-weight: 800;
  text-align: center;
}

.btn-option {
  width: 100%;
  background: var(--bg-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-option svg {
  width: 18px;
  height: 18px;
  color: var(--hint);
}

.card-instructions-amount {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-1);
  margin: 0 0 14px;
}

.card-instructions-box {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.card-instructions-number {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}

.card-instructions-holder {
  font-size: 13.5px;
  color: var(--hint);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-instructions-note {
  margin: 0 0 16px;
  text-align: center;
}

.category-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 6px;
}

.category-drawer-item {
  width: 100%;
  text-align: left;
  border: none;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.category-drawer-item.active {
  background: var(--accent-1);
  color: #ffffff;
  font-weight: 700;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--hint);
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 2px;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease;
}

.nav-item.active {
  color: var(--accent-1);
}

.nav-item.active svg {
  transform: translateY(-1px) scale(1.06);
}

.nav-icon-wrap {
  position: relative;
  display: flex;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #e05353;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings view */

.settings-admin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  border: none;
  margin-bottom: 10px;
  font-family: inherit;
  text-align: left;
}
