/* ============================
   CAYEZ — Онлайн Склад Грозный
   Design System & Styles
   ============================ */

/* ---- Tokens ---- */
:root {
  --bg-base:       #0a0d12;
  --bg-surface:    #111620;
  --bg-card:       #161c28;
  --bg-hover:      #1e2638;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(99,179,237,0.25);

  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --accent-glow:   rgba(59,130,246,0.15);
  --green:         #10b981;
  --amber:         #f59e0b;

  --text-primary:  #f0f4ff;
  --text-secondary:#94a3b8;
  --text-muted:    #4a5568;

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);

  --trans: 0.2s ease;
  --trans-slow: 0.4s ease;

  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; color: inherit; }

/* ---- HEADER ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--trans);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.header-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--trans);
}
.header-phone:hover { color: var(--accent-light); }

.header-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #25d366;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 50%;
  transition: all var(--trans);
  flex-shrink: 0;
}
.header-whatsapp:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.5);
  transform: scale(1.1);
}

/* ---- HERO ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 50%, rgba(129,140,248,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 24px;
  letter-spacing: 0.03em;
  animation: fadeInDown 0.6s ease both;
}

.hero-title {
  font-size: clamp(32px, 6vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s 0.1s ease both;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 40px;
  animation: fadeInDown 0.6s 0.2s ease both;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 40px;
  animation: fadeInUp 0.6s 0.3s ease both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- MAIN ---- */
.main {
  padding: 48px 0 80px;
}

/* ---- CONTROLS ---- */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.categories-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}

.tab:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--accent-glow);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(59,130,246,0.3);
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 42px 10px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--trans);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--trans);
}
.search-clear:hover { color: var(--text-primary); }

/* ---- RESULTS META ---- */
.results-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 20px;
}

.results-meta strong {
  color: var(--accent-light);
  font-weight: 600;
}

/* ---- TABLE ---- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  color: var(--text-secondary);
  gap: 12px;
}

.empty-icon { font-size: 48px; }
.empty-state p { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.empty-state span { font-size: 14px; color: var(--text-muted); }

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.price-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.price-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--trans);
  animation: rowFadeIn 0.3s ease both;
}

.price-table tbody tr:last-child { border-bottom: none; }

.price-table tbody tr:hover {
  background: var(--bg-hover);
}

.price-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.col-num { width: 48px; color: var(--text-muted); font-size: 12px; text-align: center; }
.col-name { font-weight: 500; color: var(--text-primary); }
.col-name .highlight { background: #f59e0b; color: #0f172a; border-radius: 3px; padding: 0 3px; font-weight: 700; }
.col-cat { width: 110px; }
.col-unit { width: 60px; color: var(--text-secondary); font-size: 13px; }
.col-price { width: 120px; text-align: right; }
.col-price-unit { width: 120px; text-align: right; }

.price-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.price-unit-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.price-na {
  color: var(--text-muted);
  font-size: 12px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(59,130,246,0.1);
  color: var(--accent-light);
  border: 1px solid rgba(59,130,246,0.15);
  white-space: nowrap;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-tagline {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.footer-contacts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--trans);
}
.footer-link:hover { color: var(--accent-light); }

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .header-location { display: none; }
  .header-contact { flex-wrap: nowrap; white-space: nowrap; }
  .header-phone { font-size: 13px; }
  .hero { padding: 32px 0 24px; }
  .hero-title { margin-bottom: 12px; }
  .hero-desc { font-size: 15px; margin-bottom: 24px; }
  .hero-stats { padding: 12px 16px; gap: 0; }
  .stat-item { padding: 0 12px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 10px; }
  .controls { flex-direction: column; align-items: stretch; }
  .categories-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .col-cat, .col-unit { display: none; }
  .col-price, .col-price-unit { width: 90px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stat-divider { display: none; }
  .hero-stats { gap: 16px; }
  .price-table { font-size: 13px; }
  .price-table td { padding: 10px 12px; }
  .price-value { font-size: 14px; }
}
