/* Qulay Makon — Design tokens (UI Redesign Faza 1)
 * Brend: UzCloud ko'k + AliExpress struktura
 * Eslatma: SiteSettings'dan kelgan --primary alohida namespace.
 *          Yangi qatlam butunlay --color-* prefiksi bilan.
 */
:root {
  /* === RANGLAR === */

  /* Brand — Deep navy (Qulay Makon premium B2B) */
  --color-primary: #023E8A;
  --color-primary-hover: #03306E;
  --color-primary-active: #022757;
  --color-primary-light: #E5EBF5;
  --color-primary-lighter: #F2F5FA;
  --color-primary-text: #023E8A;

  /* Accent (gold/sariq — kontrast) */
  --color-accent: #FFB703;

  /* Neutral / background — sof oq + ko'kka moyil tint */
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7F9FC;
  --color-bg-card: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-surface-2: #F7F9FC;

  /* Text — to'q ko'k-qora, kulrang o'rniga ko'kka moyil neytral */
  --color-text: #1A2332;
  --color-text-secondary: #4A5568;
  --color-text-muted: #718096;
  --color-text-subtle: #718096;

  /* Border */
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;

  /* Status */
  --color-success: #16A34A;
  --color-success-light: #D1FAE5;
  --color-warning: #F59E0B;
  --color-warning-light: #FFEDD5;
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;

  /* Narx */
  --color-price: #023E8A;
  --color-old-price: #94A3B8;
  --color-discount: #DC2626;

  /* === TIPOGRAFIYA === */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-size-3xl: 48px;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* === SPACING (4px grid) === */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* === RADIUS === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* === SHADOW === */
  --shadow-sm: 0 1px 2px rgba(2, 62, 138, 0.04);
  --shadow-md: 0 4px 12px rgba(2, 62, 138, 0.06);
  --shadow-lg: 0 8px 24px rgba(2, 62, 138, 0.08);
  --shadow-card-hover: 0 12px 32px rgba(2, 62, 138, 0.15);

  /* === LAYOUT === */
  --container-max: 1440px;
  --container-padding: 24px;
  --header-height: 72px;
  --subheader-height: 56px;
}

/* Box-sizing barchaga (main.css ham qo'yadi — idempotent) */
*, *::before, *::after { box-sizing: border-box; }


/* ============ POLISH (Faza 5) ============ */

/* Smooth scroll va prefers-reduced-motion */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Global focus state */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

/* Form elementlari (input/textarea/select) o'z border-radius'ini saqlaydi va
   global focus-visible outline'idan ozod — har bir form input'i o'z wrapper'ida
   focus halo'siga ega bo'lishi kerak (pill-shape search box'lar uchun muhim) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-radius: inherit;
}

/* Skip-to-content link — standard "visually hidden" pattern.
   Tab bosilganda fokuslangach ko'rinadi; aks holda tepada chiqib turmaydi
   (eski variantda `top: -40px` ishonchsiz edi — ko'k chiziqcha tepada
   chiqib turardi). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 9999;
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}
.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  overflow: visible;
}

/* Btn loading state — .btn, .btn-primary, .btn-submit (auth/contact formalar) */
.btn.is-loading,
.btn-primary.is-loading,
.btn-submit.is-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  color: transparent !important;
}
.btn.is-loading::after,
.btn-primary.is-loading::after,
.btn-submit.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  animation: qm-spin 0.6s linear infinite;
}
@keyframes qm-spin { to { transform: rotate(360deg); } }

/* Empty state utility */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-secondary);
}
.empty-state__icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: var(--space-3);
}
