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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #2d2d2d;
  --accent-light: #f5f5f5;
  --aluma-zone: #e8f4e8;
  --aluma-border: #4a9e4a;
  --brand-alo: #1a1a1a;
  --brand-lulu: #d31334;
  --brand-ua: #1d1d1d;
  --brand-nike: #111111;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* === Password Gate === */
#password-gate {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.gate-container {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 0 20px;
}

.gate-logo {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.gate-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.gate-form {
  display: flex;
  gap: 8px;
}

.gate-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.gate-form input:focus {
  border-color: var(--accent);
}

.gate-form button {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.gate-form button:hover { opacity: 0.85; }

.gate-error {
  color: #d32f2f;
  font-size: 0.8rem;
  margin-top: 12px;
  min-height: 1.2em;
}

/* === Header === */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.25em;
}

.header-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === Category Nav === */
.category-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 57px;
  z-index: 99;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-tabs {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.cat-tab {
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.cat-tab:hover { color: var(--text-primary); }
.cat-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* === Controls === */
.controls {
  background: var(--bg);
  padding: 16px 0 0;
  position: sticky;
  top: 105px;
  z-index: 98;
}

.controls-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.brand-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.brand-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.brand-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* === Price Bar === */
.price-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.price-bar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.price-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
}

.price-bar-label {
  width: 100px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}

.price-bar-track {
  flex: 1;
  height: 20px;
  background: var(--accent-light);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.price-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  opacity: 0.7;
}

.price-bar-fill.brand-ua { background: #5c7cfa; }
.price-bar-fill.brand-nike { background: #ff6b35; }
.price-bar-fill.brand-alo { background: #333; }
.price-bar-fill.brand-lulu { background: #d31334; }
.price-bar-fill.brand-aluma {
  background: var(--aluma-zone);
  border: 1.5px solid var(--aluma-border);
  opacity: 1;
}

.price-bar-values {
  width: 80px;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* === Product Grid === */
.product-grid-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Category divider */
.category-divider {
  grid-column: 1 / -1;
  padding: 32px 0 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.category-divider h2 {
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}

.category-divider .divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.category-divider .divider-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Product Card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.product-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-image {
  aspect-ratio: 1;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.03);
}

.product-card-image .brand-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.product-card-image .img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

.product-card-body {
  padding: 14px 16px 16px;
}

.product-card-brand {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.price-usd {
  font-size: 1rem;
  font-weight: 600;
}

.price-eur {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.product-card-features {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.product-card-colors {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* === 1688 Supplier Section === */
.supplier-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.supplier-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff8f0;
  transition: all var(--transition);
}

.supplier-link:hover {
  border-color: #ff6600;
  background: #fff3e0;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.12);
}

.supplier-image {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}

.supplier-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.supplier-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ff6600;
  background: #fff3e0;
}

.supplier-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ff6600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.supplier-badge::after {
  content: '\2197';
  font-size: 0.85rem;
}

/* No results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 16px;
  }

  .header-brand { gap: 10px; }
  .header-stats { font-size: 0.72rem; }

  .category-tabs { padding: 0 16px; }
  .cat-tab { padding: 12px 14px; font-size: 0.76rem; }

  .controls-inner { padding: 0 16px; }
  .product-grid-container { padding: 8px 16px 60px; }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand-filters { gap: 6px; }
  .brand-btn { padding: 5px 12px; font-size: 0.72rem; }

  .price-bar-label { width: 70px; font-size: 0.7rem; }
}

/* Scrollbar styling */
.category-nav::-webkit-scrollbar {
  height: 0;
}
