/* =====================================================================
   OILA MARKET — Mini App v2 dizayni
   style.css dan keyin yuklanadi, mantiqqa (app.js) tegmaydi.
   Yorqin (iliq oq + yashil) standart; qorong'u mavzu ham saqlangan.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

/* ---------- Ranglar ---------- */
:root {
  --primary: #25805A;
  --primary-hover: #1F6B4A;
  --primary-light: rgba(63, 167, 117, 0.16);
  --primary-glow: rgba(37, 128, 90, 0.30);
  --accent: #E8772E;
  --accent-light: rgba(232, 119, 46, 0.16);
  --danger: #E05A5A;
  --danger-light: rgba(224, 90, 90, 0.16);
  --warning: #F2A03D;
  --warning-light: rgba(242, 160, 61, 0.18);

  --bg-desktop: #0A110E;
  --bg-main: #0F1A15;
  --bg-card: #16241D;
  --bg-card-hover: #1C2F26;
  --bg-card-glass: rgba(15, 26, 21, 0.94);
  --bg-input: #12201A;
  --text-main: #EEF4F0;
  --text-muted: #9FB2A8;
  --border: #25382E;
  --border-glass: rgba(37, 56, 46, 0.9);
  --bottom-nav-bg: rgba(15, 26, 21, 0.97);
  --tile: #1C2F26;
  --ok-text: #5FD39B;
  --warn-text: #F2B866;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

body.theme-light {
  --primary: #1F6B4A;
  --primary-hover: #17553A;
  --primary-light: #E3EFE8;
  --primary-glow: rgba(31, 107, 74, 0.28);

  --bg-desktop: #E7E3D6;
  --bg-main: #F6F4EE;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1EFE8;
  --bg-card-glass: rgba(255, 255, 255, 0.96);
  --bg-input: #FFFFFF;
  --text-main: #1B2420;
  --text-muted: #5A625C;
  --border: #E4E0D4;
  --border-glass: #E4E0D4;
  --bottom-nav-bg: #FFFFFF;
  --tile: #F3EAD3;
  --ok-text: #17553A;
  --warn-text: #9A4310;

  --shadow-sm: 0 1px 2px rgba(27, 36, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(27, 36, 32, 0.10);
  --shadow-lg: 0 16px 40px rgba(27, 36, 32, 0.14);
}

* { font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif; }

/* ---------- Sarlavha ---------- */
.app-header {
  padding: 16px 20px 12px;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg-main);
}
.header-top { margin-bottom: 0; }
.store-brand { gap: 12px; }
.brand-icon {
  width: 46px; height: 46px; border-radius: 16px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; box-shadow: none;
}
.brand-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.2px; color: var(--text-main); }
.brand-subtitle { font-size: 0.74rem; font-weight: 700; color: var(--ok-text); }
.status-dot { background: var(--primary); box-shadow: none; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 15px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main);
}
.badge { background: #E8772E; color: #2A1608; font-weight: 800; border: 2px solid var(--bg-main); }

/* ---------- Qidiruv ---------- */
.search-container-wrap { padding-top: 4px; }
.search-input {
  height: 52px; border-radius: 17px; background: var(--bg-card);
  border: 1px solid var(--border); font-weight: 600; font-size: 0.95rem;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ---------- Banner ---------- */
.hero-banner {
  margin: 14px 20px 6px; padding: 20px 18px; min-height: 140px;
  border-radius: 26px; background: #1F6B4A; box-shadow: none; overflow: hidden;
}
body:not(.theme-light) .hero-banner { background: #1B5E41; }
.hero-banner::before {
  top: -48px; right: -36px; width: 180px; height: 180px; background: #2A8059;
}
.hero-banner::after {
  content: ''; position: absolute; right: 14px; bottom: -52px;
  width: 140px; height: 140px; border-radius: 50%; background: #F2A03D; pointer-events: none;
}
.banner-content { position: relative; z-index: 2; max-width: 66%; }
.banner-content h2 { font-size: 1.22rem; line-height: 1.2; letter-spacing: -0.2px; color: #fff; margin-bottom: 6px; }
.banner-content p { font-size: 0.8rem; font-weight: 600; opacity: 1; color: #D4EBDF; }
.banner-badge {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,0.92);
  color: #1F6B4A; display: flex; align-items: center; justify-content: center;
  animation: none; font-size: 0;
}
.banner-badge svg { width: 32px; height: 32px; }

/* ---------- Kategoriyalar ---------- */
.categories-wrapper { padding: 16px 20px 6px; }
.section-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.2px; }
.cat-nav-btn { border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); }
.categories-scroll { gap: 8px; padding-bottom: 6px; }
.category-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.86rem; font-weight: 700; color: var(--text-main); box-shadow: none;
}
.category-chip img { width: 28px; height: 28px; margin-left: -8px; border: 2px solid var(--primary-light); }
.category-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }

/* ---------- Mahsulotlar ---------- */
.products-container { padding: 10px 20px 110px; }
.products-grid { gap: 12px; }
.product-card {
  padding: 10px; gap: 10px; border-radius: 22px; overflow: visible;
  background: var(--bg-card); border: 1px solid var(--border); box-shadow: none;
}
.product-card:hover { border-color: var(--primary); }
.product-image-wrap {
  height: 124px; border-radius: 15px; background: var(--tile);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-image { width: 100%; height: 100%; object-fit: cover; }
.unit-badge {
  left: 8px; bottom: 8px; top: auto; right: auto;
  padding: 4px 9px; border-radius: 999px; font-size: 0.66rem; font-weight: 800;
  background: rgba(255,255,255,0.94); color: #1B2420; backdrop-filter: none; border: 0;
}
.stock-tag {
  position: absolute; left: 8px; top: 8px; right: auto;
  padding: 4px 9px; border-radius: 999px; font-size: 0.66rem; font-weight: 800; border: 0;
}
.stock-tag.out-stock { background: #ECEAE3; color: #3E4540; }
.stock-tag.low-stock { background: #FCE9DA; color: #7A3409; }
.product-info { padding: 0 3px 2px; gap: 3px; }
.product-category { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.product-title { font-size: 0.95rem; font-weight: 800; line-height: 1.25; color: var(--text-main); }
.product-price-row { margin-top: 6px; align-items: center; }
.product-price { font-size: 0.92rem; font-weight: 800; color: var(--text-main); }
.product-price small { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.add-btn {
  width: 44px; height: 44px; margin: -6px -4px -6px 0; border-radius: 15px;
  background: var(--primary); color: #fff; font-size: 1.5rem; font-weight: 700; border: 0; box-shadow: none;
}
.add-btn.disabled { background: #B9BDB5; color: #fff; }
.product-card.is-out { opacity: 0.78; }
.product-card.is-out .product-image { filter: grayscale(1); opacity: 0.7; }

/* ---------- Pastki menyu ---------- */
.bottom-nav {
  height: 76px; padding: 6px 8px 10px; background: var(--bottom-nav-bg);
  border-top: 1px solid var(--border); border-radius: 24px 24px 0 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 -8px 24px rgba(27, 36, 32, 0.06);
}
.nav-item { flex: 1; min-height: 56px; padding: 6px 4px; gap: 4px; font-size: 0.72rem; font-weight: 700; border-radius: 16px; }
.nav-item.active { color: var(--primary); background: var(--primary-light); }
body:not(.theme-light) .nav-item.active { color: var(--ok-text); }
.nav-item.active svg { transform: none; }
.nav-badge { background: #E8772E; color: #2A1608; font-weight: 800; border: 2px solid var(--bottom-nav-bg); }

/* ---------- Pastdan chiquvchi oynalar ---------- */
.modal-overlay.active { background: rgba(27, 36, 32, 0.5); backdrop-filter: none; }
.bottom-sheet { border-radius: 30px 30px 0 0; background: var(--bg-card); border: 0; }
.sheet-handle { width: 44px; height: 5px; background: var(--border); }
.sheet-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.3px; }
.close-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--bg-main); border: 1px solid var(--border); }
.sheet-footer { border-top: 1px solid var(--border); background: var(--bg-card); }

.variants-title { font-size: 0.82rem; font-weight: 800; color: var(--text-muted); }
.variant-card {
  min-height: 56px; border-radius: 15px; background: var(--bg-card);
  border: 1px solid var(--border); padding: 10px 14px;
}
.variant-card.selected { border: 2px solid var(--primary); background: var(--primary-light); }
.variant-card.out-of-stock { background: var(--bg-main); opacity: 0.7; }
.variant-label { font-weight: 800; }
.variant-stock { font-weight: 700; color: var(--ok-text); }
.variant-stock.low { color: var(--warn-text); }

.weight-toggle-container { background: var(--bg-main); border-radius: 16px; padding: 4px; border: 0; }
.weight-tab { min-height: 44px; border-radius: 12px; font-weight: 800; color: var(--text-muted); }
.weight-tab.active, body.theme-light .weight-tab.active {
  background: var(--bg-card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.preset-chip, body.theme-light .preset-chip {
  min-height: 44px; border-radius: 12px; background: var(--bg-card);
  border: 1px solid var(--border); font-weight: 800; color: var(--text-main);
}
.preset-chip.active, body.theme-light .preset-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.custom-weight-input { border: 2px solid var(--primary); border-radius: 18px; background: var(--bg-card); }
.input-box { font-weight: 800; }
.calculation-note, body.theme-light .calculation-note { border-radius: 14px; background: var(--primary-light); color: var(--ok-text); border: 0; font-weight: 700; }

.quantity-stepper { background: var(--bg-main); border-radius: 18px; padding: 4px; border: 0; }
.step-btn { width: 48px; height: 48px; border-radius: 14px; background: var(--bg-card); border: 0; font-weight: 800; color: var(--text-main); }
.step-count { font-weight: 800; }

.btn-primary-block {
  min-height: 58px; border-radius: 20px; background: var(--primary); color: #fff;
  font-size: 1rem; font-weight: 800; border: 0; box-shadow: 0 10px 24px var(--primary-glow);
}
.btn-primary-block:disabled { background: #B9BDB5; box-shadow: none; color: #fff; }

/* ---------- Savat ---------- */
.view-header { padding: 16px 20px 8px; }
.view-header h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.3px; }
.view-content-body { padding: 8px 20px 120px; }
.cart-item {
  padding: 10px; border-radius: 20px; background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: none; gap: 12px;
}
.cart-item-img { width: 62px; height: 62px; border-radius: 15px; background: var(--tile); object-fit: cover; }
.cart-item-title { font-weight: 800; }
.cart-item-price { font-weight: 800; }
.mini-step-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--bg-main); border: 1px solid var(--border); font-weight: 800; }
.cart-sticky-checkout {
  border-radius: 26px 26px 0 0; background: var(--bg-card); border: 0;
  border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgba(27, 36, 32, 0.08);
}

/* ---------- Formalar ---------- */
.form-label { font-size: 0.78rem; font-weight: 800; color: var(--text-muted); }
.form-input {
  min-height: 50px; border-radius: 15px; background: var(--bg-input);
  border: 1px solid var(--border); font-weight: 600; color: var(--text-main);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: 0; }
.form-hint { font-weight: 600; color: var(--text-muted); }
.payment-card {
  min-height: 80px; border-radius: 18px; background: var(--bg-card);
  border: 1px solid var(--border); padding: 12px 14px;
}
.payment-card.active { border: 2px solid var(--primary); background: var(--primary-light); }
.payment-title { font-weight: 800; }
.payment-desc { font-weight: 600; color: var(--text-muted); }
.gps-btn { border-radius: 12px; min-height: 40px; font-weight: 800; }
.btn-theme-pill { min-height: 44px; border-radius: 14px; font-weight: 800; }
.btn-theme-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Profil, xabar ---------- */
.profile-card, .profile-form-card { border-radius: 22px; background: var(--bg-card); border: 1px solid var(--border); box-shadow: none; }
.profile-avatar { background: var(--primary); color: #fff; font-weight: 800; }
.badge-pill { border-radius: 999px; font-weight: 800; background: var(--primary-light); color: var(--ok-text); }
.toast { border-radius: 16px; font-weight: 700; background: var(--text-main); color: var(--bg-main); }
.success-box, .success-details { border-radius: 22px; }
.success-icon-wrap { background: var(--primary-light); color: var(--primary); }
