/* ═══════════════════════════════════════════════════
   NOVOLED B2B — styles.css
   Подход: mobile-first
   Брейкпоинты: 480px → 768px → 1024px
   ═══════════════════════════════════════════════════ */

/* ─── ПЕРЕМЕННЫЕ ─── */
:root {
  --bg: #05060a;
  --bg-elevated: #0b0d13;
  --bg-soft: #11141f;
  --border-subtle: #1c2133;
  --accent: #4df29b;
  --accent-soft: rgba(77, 242, 155, 0.1);
  --accent-strong: #32c276;
  --text: #f5f5f7;
  --text-muted: #8b91a5;
  --danger: #ff5c5c;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --transition-fast: 0.18s ease-out;
  --max-width: 1120px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top left, #10131e, #020309 52%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', Roboto, sans-serif;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ─── КОНТЕЙНЕР ─── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ═══════════════════════════════════════════════════
   ШАПКА — mobile-first
   ═══════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(3, 5, 12, 0.9), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
}

/* Логотип — мобильный размер по умолчанию */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.logo-svg {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.logo-img {
  height: 12px;
  width: auto;
  max-width: 120px;
  display: block;
  flex-shrink: 1;
}

/* Старые элементы логотипа — скрыты */
.logo-mark, .logo-text { display: none; }

/* Навигация — не сжимается, кнопки всегда видны */
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 7px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-active {
  color: #040506;
  background: var(--accent);
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 10px;
  margin-left: 3px;
  background: var(--accent-soft);
  color: red;
  font-weight: 600;
}

/* Auth area */
.header-auth-area {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle);
}

.auth-email {
  display: none; /* скрыт на мобильных */
  font-size: 12px;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-login-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-login-link:hover {
  background: var(--accent);
  color: #000;
}

.auth-logout-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 5px 8px;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.auth-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── Шапка: планшет 480px+ ─── */
@media (min-width: 480px) {
  .header-inner {
    padding: 12px 16px;
    gap: 12px;
  }
  .logo-img {
    height: 18px;
    max-width: 150px;
  }
  .main-nav { gap: 8px; }
  .nav-link {
    font-size: 13px;
    padding: 6px 9px;
  }
  .cart-count-badge {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    margin-left: 4px;
  }
  .auth-login-link {
    font-size: 12px;
    padding: 5px 12px;
  }
  .auth-logout-btn { font-size: 12px; }
  .header-auth-area {
    gap: 8px;
    margin-left: 6px;
    padding-left: 10px;
  }
}

/* ─── Шапка: десктоп 768px+ ─── */
@media (min-width: 768px) {
  .header-inner {
    padding: 14px 16px;
    gap: 16px;
  }
  .logo-img {
    height: 28px;
    max-width: 200px;
  }
  .main-nav { gap: 12px; }
  .nav-link {
    font-size: 14px;
    padding: 6px 10px;
  }
  .auth-email { display: block; }
  .auth-login-link {
    font-size: 13px;
    padding: 6px 14px;
  }
  .auth-logout-btn { font-size: 12px; padding: 5px 10px; }
  .header-auth-area {
    gap: 10px;
    margin-left: 8px;
    padding-left: 12px;
  }
}

/* ─── Логин-страница: логотип ─── */
.login-logo {
  display: block;
  margin-bottom: 28px;
  text-decoration: none;
}

.login-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

@media (min-width: 480px) {
  .login-logo-img { height: 32px; }
}

/* ═══════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════ */

.hero {
  position: relative;
  padding: 40px 0 40px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero { padding: 80px 0 60px; }
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.hero-inner-single { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr);
  }
}

.hero-bg {
  position: absolute;
  inset: -10%;
  background-image: url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transform: scale(1.1);
  will-change: transform;
}

.hero-glow {
  position: absolute;
  width: 800px;
  height: 400px;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(77,242,155,0.35), rgba(77,242,155,0.1) 40%, transparent 70%);
  filter: blur(60px);
  opacity: 0.6;
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%   { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
}

.hero-light {
  position: absolute;
  width: 1200px;
  height: 600px;
  left: 50%;
  top: 30%;
  transform: translateX(-50%) rotate(-10deg);
  background: linear-gradient(90deg, transparent, rgba(77,242,155,0.15), transparent);
  filter: blur(80px);
  animation: lightSweep 8s ease-in-out infinite;
}

@keyframes lightSweep {
  0%   { transform: translateX(-60%) rotate(-10deg); opacity: 0; }
  50%  { transform: translateX(-50%) rotate(-10deg); opacity: 1; }
  100% { transform: translateX(-40%) rotate(-10deg); opacity: 0; }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0,0,0,0.5), #020309),
              linear-gradient(to bottom, transparent 40%, #020309);
  z-index: 0;
}

.hero > .container { position: relative; z-index: 1; }

.hero-copy h1 {
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1.15;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy p {
  margin: 0;
  color: var(--text-muted);
  max-width: 380px;
}

.hero-actions {
  background: radial-gradient(circle at top right, #182134, #050711 60%);
  border-radius: 20px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-actions-below { margin-top: 12px; }

.hero-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(2, 4, 10, 0.9);
  color: var(--text);
  font-size: 14px;
}

.hero-search input::placeholder { color: #626a80; }

.hero-search input:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(77, 242, 155, 0.4);
}

#search-input {
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

#search-input:focus {
  box-shadow: 0 0 0 3px rgba(77, 242, 155, 0.12);
}

select {
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 13, 21, 0.9);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════
   КНОПКИ
   ═══════════════════════════════════════════════════ */

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020308;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(77, 242, 155, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(77, 242, 155, 0.7);
}

.btn-secondary {
  background: rgba(9, 11, 18, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.btn-primary.btn-pulse,
.btn-add-to-cart.btn-pulse {
  animation: btn-pulse 0.4s ease-out;
}

@keyframes btn-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 rgba(77,242,155,0.6); }
  50%  { transform: scale(1.04); box-shadow: 0 0 18px rgba(77,242,155,0.8); }
  100% { transform: scale(1);    box-shadow: 0 0 10px rgba(77,242,155,0.4); }
}

.btn-primary[disabled], .btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   ФИЛЬТРЫ
   ═══════════════════════════════════════════════════ */

.products-section { padding: 10px 0 40px; }
.filters-section  { padding: 8px 0; }

.filters-bar {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(135deg, #070914, #090d19);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.filters-group { min-width: 0; flex: 1 1 160px; }

.filters-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 8, 16, 0.9);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast);
}

.filter-chip input { display: none; }

.filter-chip-active {
  border-color: rgba(77, 242, 155, 0.7);
  background: rgba(77, 242, 155, 0.12);
  color: var(--accent);
  transform: translateY(-1px);
}

.filters-reset { align-self: center; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header h2 { margin: 0; font-size: 18px; }

.muted { color: var(--text-muted); font-size: 13px; }

.loader { padding: 24px 0; color: var(--text-muted); font-size: 14px; display: none; }

.error-message {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.45);
  color: #ffd6d6;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   СЕТКА ТОВАРОВ
   ═══════════════════════════════════════════════════ */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}

@media (min-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 12px;
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
  }
}

/* ═══════════════════════════════════════════════════
   ДЕРЕВО КАТЕГОРИЙ
   ═══════════════════════════════════════════════════ */

#catalog-tree { display: flex; flex-direction: column; gap: 8px; }

.tree-node {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top left, #0b0f1b, #05060a);
  padding: 8px 10px;
}

.tree-node summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tree-node summary::-webkit-details-marker { display: none; }

.tree-node-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.tree-node-toggle {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tree-node-toggle::before { content: '+'; }
.tree-node[open] > summary .tree-node-toggle::before { content: '−'; }

.tree-node[open] .tree-node-toggle {
  background: rgba(77, 242, 155, 0.1);
  border-color: rgba(77, 242, 155, 0.6);
  color: var(--accent);
}

.tree-node-children {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tree-node-depth-1 { margin-left: 6px; }
.tree-node-depth-2 { margin-left: 12px; }

/* ═══════════════════════════════════════════════════
   КАРТОЧКА ТОВАРА
   ═══════════════════════════════════════════════════ */

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card {
  background: linear-gradient(160deg, #0d1120, #07090f);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  animation: card-in 0.25s ease-out both;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  border-color: rgba(77, 242, 155, 0.18);
}

.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s ease;
}

.product-card:hover .product-thumb img { transform: scale(1.04); }

.product-info-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 14, 24, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  z-index: 2;
  text-transform: uppercase;
}

.product-info-badge:hover {
  background: rgba(77, 242, 155, 0.15);
  border-color: rgba(77, 242, 155, 0.5);
  color: var(--accent);
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 0;
}

.product-badges { display: flex; flex-wrap: wrap; gap: 5px; min-height: 20px; }

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.badge-accent {
  border-color: rgba(77, 242, 155, 0.35);
  color: var(--accent);
  background: rgba(77, 242, 155, 0.06);
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}

.product-sku { font-size: 11px; color: var(--text-muted); margin-top: -4px; }

.product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.product-unit { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: -6px; }

.product-stock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.stock-indicator {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.stock-available { background: #3ad47a; color: #3ad47a; }
.stock-pending   { background: #ff6363; color: #ff6363; }
.stock-label-available { color: #3ad47a; }
.stock-label-pending   { color: #ff6363; }

.product-bottom { padding: 12px 14px 14px; margin-top: auto; }
.product-actions { display: flex; gap: 8px; }

.btn-add-to-cart {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020308;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 0 20px rgba(77, 242, 155, 0.4);
}

.btn-add-to-cart:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(77, 242, 155, 0.65);
}

.btn-add-to-cart:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* Совместимость */
.product-meta { display: flex; flex-direction: column; gap: 4px; }
.product-specs-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--text-muted); }
.product-specs-row span:last-child { color: var(--text); }
.price-locked { display: none; }
.link-plain {
  border-radius: 999px; padding: 6px 10px; text-decoration: none;
  font-size: 12px; color: var(--text-muted); border: 1px solid transparent;
  cursor: pointer; background: transparent;
}
.link-plain:hover { border-color: rgba(255, 255, 255, 0.16); }

/* ═══════════════════════════════════════════════════
   ФУТЕР
   ═══════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 20px 0 22px;
  background: radial-gradient(circle at top, #070814, #020309);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
  }
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-contact-name { font-size: 13px; font-weight: 600; color: var(--text); }

.footer-contact-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.footer-contact-link:hover { opacity: 0.75; }

/* ═══════════════════════════════════════════════════
   ПРОДУКТ ДЕТАЛЬНАЯ СТРАНИЦА
   ═══════════════════════════════════════════════════ */

.product-section { padding: 28px 0 40px; }

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--text); }

.product-detail {
  background: linear-gradient(145deg, #0b0e18, #05060a);
  border-radius: 22px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 768px) {
  .product-detail {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.7fr);
  }
}

.product-gallery { display: flex; flex-direction: column; gap: 10px; }

.product-main-image {
  border-radius: 16px;
  background: radial-gradient(circle at top left, #1d2740, #05060a);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-main-image img { width: 100%; height: 100%; object-fit: contain; }

.product-thumbs-row { display: flex; gap: 8px; }

.product-thumb-small {
  flex: 1 1 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #070812;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-thumb-small img { width: 100%; height: 100%; object-fit: contain; }

.product-info { display: flex; flex-direction: column; gap: 8px; }

.product-info-header { display: flex; justify-content: space-between; gap: 6px; }
.product-info-header h1 { margin: 0 0 4px; font-size: 18px; }
.product-category { font-size: 12px; color: var(--text-muted); }
.product-price-lg { font-size: 18px; font-weight: 600; }
.product-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.product-specs {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.specs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 12px; }
.spec-row { display: flex; justify-content: space-between; gap: 4px; }
.spec-label { color: var(--text-muted); }
.spec-value { font-weight: 500; }

.product-detail-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ═══════════════════════════════════════════════════
   КОРЗИНА
   ═══════════════════════════════════════════════════ */

.cart-section { padding: 26px 0 40px; }
.cart-section h1 { margin: 0 0 4px; }

.empty-state {
  padding: 22px 18px;
  border-radius: 16px;
  background: rgba(7, 10, 20, 0.9);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 14px;
  color: var(--text-muted);
}

.cart-table-wrapper { margin-top: 16px; overflow-x: auto; }

.cart-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.cart-table th, .cart-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-table thead th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cart-qty-input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 8, 15, 0.9);
  color: var(--text);
}

.cart-summary { margin-top: 14px; display: flex; justify-content: flex-end; }
.cart-summary-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.cart-summary-row + .cart-summary-row { margin-top: 4px; }

.cart-request { margin-top: 28px; }

.request-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row label { flex: 1 1 200px; }

label { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }

input, textarea {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(7, 9, 16, 0.9);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(77, 242, 155, 0.45);
}

#request-result { margin-top: 6px; font-size: 13px; }

/* Скрыть цоколь на маленьких экранах */
@media (max-width: 600px) {
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) { display: none; }
}

/* ═══════════════════════════════════════════════════
   МОДАЛКА
   ═══════════════════════════════════════════════════ */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 41;
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  background: radial-gradient(circle at top left, #151827, #05060a);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.8);
  padding: 16px 16px 18px;
  overflow: hidden;
}

.modal-body { max-height: calc(90vh - 40px); overflow: auto; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover { background: rgba(0, 0, 0, 0.8); color: var(--text); }

.modal-product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

@media (min-width: 600px) {
  .modal-product-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr);
  }
}

.modal-product-gallery { display: flex; flex-direction: column; gap: 10px; }

.modal-main-image {
  border-radius: 14px;
  background: #ffffff;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-main-image img { width: 100%; height: 100%; object-fit: contain; }

.modal-thumbs { display: flex; gap: 8px; }

.modal-thumb {
  flex: 1 1 0;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.75;
}

.modal-thumb-active { border-color: rgba(77, 242, 155, 0.7); opacity: 1; }
.modal-thumb img { width: 100%; height: 100%; object-fit: contain; }

.modal-product-info { display: flex; flex-direction: column; gap: 8px; }

.modal-product-header { display: flex; justify-content: space-between; gap: 8px; }
.modal-product-header h2 { margin: 0 0 4px; font-size: 18px; }

.modal-price-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 4px 0;
}

.modal-total-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.modal-total-label { font-size: 13px; color: var(--text-muted); }
.modal-total-value { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }

.modal-qty-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.modal-qty-row .btn-primary { flex: 1; min-width: 130px; }

/* ═══════════════════════════════════════════════════
   QTY STEPPER
   ═══════════════════════════════════════════════════ */

.qty-stepper { display: inline-flex; align-items: center; gap: 8px; }

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), color var(--transition-fast),
    background-color var(--transition-fast), transform var(--transition-fast);
}

.qty-btn:hover {
  border-color: rgba(77, 242, 155, 0.55);
  color: var(--accent);
  background: rgba(77, 242, 155, 0.08);
}

.qty-btn:active { transform: translateY(1px); }
.qty-icon { font-size: 16px; line-height: 1; }
.qty-value { min-width: 30px; text-align: center; font-weight: 600; font-size: 13px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast);
}

.icon-btn:hover { border-color: rgba(255, 255, 255, 0.22); color: var(--text); background: rgba(255, 255, 255, 0.05); }
.icon-btn-danger:hover { border-color: rgba(255, 92, 92, 0.45); color: #ffd6d6; background: rgba(255, 92, 92, 0.08); }

/* ═══════════════════════════════════════════════════
   SCROLL TO TOP
   ═══════════════════════════════════════════════════ */

.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(11, 13, 19, 0.9);
  border: 1px solid rgba(77, 242, 155, 0.35);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease,
              background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.scroll-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top-btn:hover { background: rgba(77, 242, 155, 0.15); border-color: rgba(77, 242, 155, 0.7); box-shadow: 0 0 20px rgba(77, 242, 155, 0.3); }
.scroll-top-btn:active { transform: translateY(1px); }

@media (min-width: 640px) {
  .scroll-top-btn { bottom: 28px; right: 24px; width: 42px; height: 42px; }
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 70px;
  right: 16px;
  background: var(--bg-elevated);
  border: 1px solid rgba(77, 242, 155, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  max-width: 240px;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 640px) {
  .toast { bottom: 80px; right: 24px; }
}

/* ═══════════════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════════════ */

@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

@media (min-width: 480px) {
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
}

@media (min-width: 768px) {
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
}

.skeleton-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  height: 300px;
}

.skeleton-card::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 60%, transparent 100%);
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════
   SYNC КНОПКА
   ═══════════════════════════════════════════════════ */

@keyframes spin-icon {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

#sync-catalog-btn svg { transition: transform 0.2s; }
#sync-catalog-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR + SELECTION
   ═══════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(77, 242, 155, 0.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(77, 242, 155, 0.4); }

::selection { background: rgba(77, 242, 155, 0.25); color: var(--text); }