:root {
  color-scheme: light dark;
  --bg: #e8ecef;
  --bg-deep: #d5dce2;
  --surface: #f7f8f9;
  --surface-alt: #eef1f4;
  --surface-hover: #e2e7ec;
  --text: #152028;
  --text-secondary: #5a6670;
  --accent: #0c6e6b;
  --accent-hover: #095552;
  --accent-text: #f4f7f7;
  --accent-light: #d7eceb;
  --hero-ink: #0e171c;
  --hero-mist: #c5d0d8;
  --border: #c8d0d6;
  --border-strong: #9aa6af;
  --success: #1f7a45;
  --error: #b42318;
  --warning: #b7791f;
  --muted: #5a6670;
  --shadow-sm: 0 1px 0 rgba(21, 32, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(21, 32, 40, 0.08);
  --shadow-lg: 0 16px 40px rgba(21, 32, 40, 0.12);
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-xl: 6px;
  --font: "Figtree", "Segoe UI", sans-serif;
  --font-display: "Syne", "Figtree", sans-serif;
  --container: 1280px;
  --header-h: 64px;
  --grid-line: rgba(21, 32, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1014;
    --bg-deep: #080b0e;
    --surface: #151a1f;
    --surface-alt: #1b2229;
    --surface-hover: #243039;
    --text: #e6eaed;
    --text-secondary: #9aa6af;
    --accent: #2aafa8;
    --accent-hover: #4bc4bd;
    --accent-text: #061314;
    --accent-light: #143536;
    --hero-ink: #06090c;
    --hero-mist: #2a3640;
    --border: #2a333c;
    --border-strong: #465460;
    --success: #3dba6e;
    --error: #f07066;
    --warning: #e0b052;
    --muted: #9aa6af;
    --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
    --grid-line: rgba(230, 234, 237, 0.05);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8ecef;
  --bg-deep: #d5dce2;
  --surface: #f7f8f9;
  --surface-alt: #eef1f4;
  --surface-hover: #e2e7ec;
  --text: #152028;
  --text-secondary: #5a6670;
  --accent: #0c6e6b;
  --accent-hover: #095552;
  --accent-text: #f4f7f7;
  --accent-light: #d7eceb;
  --hero-ink: #0e171c;
  --hero-mist: #c5d0d8;
  --border: #c8d0d6;
  --border-strong: #9aa6af;
  --success: #1f7a45;
  --error: #b42318;
  --warning: #b7791f;
  --muted: #5a6670;
  --grid-line: rgba(21, 32, 40, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1014;
  --bg-deep: #080b0e;
  --surface: #151a1f;
  --surface-alt: #1b2229;
  --surface-hover: #243039;
  --text: #e6eaed;
  --text-secondary: #9aa6af;
  --accent: #2aafa8;
  --accent-hover: #4bc4bd;
  --accent-text: #061314;
  --accent-light: #143536;
  --hero-ink: #06090c;
  --hero-mist: #2a3640;
  --border: #2a333c;
  --border-strong: #465460;
  --success: #3dba6e;
  --error: #f07066;
  --warning: #e0b052;
  --muted: #9aa6af;
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
  --grid-line: rgba(230, 234, 237, 0.05);
}

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

input, select, textarea, button {
  font-family: var(--font);
  font-size: 14px;
}

main {
  min-height: 50vh;
}

/* ── Top Notice ── */
.top-notice {
  background: var(--hero-ink);
  color: #e8eef1;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Top Bar ── */
.top-bar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  max-width: var(--container);
  margin: 0 auto;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-weight: 500;
}

.top-bar-link:hover {
  color: var(--accent);
}

.top-bar-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.top-bar .theme-switcher {
  padding: 0;
}

.top-bar .theme-switcher button {
  padding: 2px 4px;
  font-size: 0;
}

.top-bar .theme-switcher button svg {
  display: block;
}

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: var(--header-h);
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

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

.header-catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--hero-ink);
  color: #eef3f5;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-catalog-btn:hover {
  background: var(--accent);
  color: var(--accent-text);
  transform: translateY(-1px);
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--text-secondary);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}

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

.search-submit {
  flex-shrink: 0;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 11px 18px;
  cursor: pointer;
}

.search-submit:hover {
  background: var(--accent-hover);
}

/* ── Header Actions ── */
.site-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-action:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.header-action-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.header-action .cart-badge {
  display: none;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  position: relative;
}

.header-icon:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.header-icon svg {
  width: 20px;
  height: 20px;
}

.header-icon .icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

/* ── Nav Bar ── */
.nav-bar {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  max-width: var(--container);
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-bar-inner::-webkit-scrollbar {
  display: none;
}

.nav-bar-inner a {
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-bar-inner a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Theme Switcher ── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface-alt);
  padding: 2px;
}

.theme-switcher button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 6px;
  cursor: pointer;
  line-height: 1;
}

.theme-switcher button:hover {
  color: var(--text);
}

.theme-switcher button.active {
  background: var(--surface);
  color: var(--text);
}

/* ── Logout ── */
.logout-form {
  margin: 0;
}

.logout-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.logout-form button:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* ── Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 10px 22px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  line-height: 1.35;
}

.button:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.button.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-secondary);
}

/* ── Hero Banner ── */
.hero-banner {
  position: relative;
  isolation: isolate;
  min-height: min(78vh, 720px);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 78% 42%, rgba(12, 110, 107, 0.35) 0%, transparent 55%),
    linear-gradient(115deg, var(--hero-ink) 0%, #163038 48%, #1a4a4a 100%);
  color: #eef3f5;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(238, 243, 245, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 245, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%, #000 100%);
  animation: hero-grid-drift 28s linear infinite;
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 8%;
  width: min(58vw, 680px);
  height: min(70vh, 620px);
  z-index: -1;
  background:
    radial-gradient(circle at 40% 40%, rgba(42, 175, 168, 0.22) 0%, transparent 55%),
    conic-gradient(from 210deg at 55% 45%, transparent 0 60deg, rgba(238, 243, 245, 0.08) 60deg 62deg, transparent 62deg 120deg, rgba(238, 243, 245, 0.06) 120deg 122deg, transparent 122deg);
  border: 1px solid rgba(238, 243, 245, 0.12);
  clip-path: polygon(12% 0, 100% 0, 100% 88%, 88% 100%, 0 100%, 0 14%);
  animation: hero-plane-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-56px, -56px, 0); }
}

@keyframes hero-plane-in {
  from { opacity: 0; transform: translate3d(40px, 24px, 0) scale(0.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(48px, 10vh, 96px) 20px clamp(40px, 8vh, 72px);
}

.hero-banner-content {
  color: #eef3f5;
  max-width: 34rem;
  animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.hero-brand {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: #ffffff;
}

.hero-banner h1 {
  color: #d7e4e6;
  font-family: var(--font);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 28ch;
}

.hero-banner-desc {
  color: rgba(238, 243, 245, 0.72);
  font-size: 1rem;
  max-width: 42ch;
  margin: 0;
  line-height: 1.6;
}

.hero-banner-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero-banner-actions .button {
  background: var(--accent);
  color: var(--accent-text);
  padding: 12px 26px;
}

.hero-banner-actions .button:hover {
  background: var(--accent-hover);
}

.hero-banner-actions .button.secondary {
  background: transparent;
  color: #eef3f5;
  border-color: rgba(238, 243, 245, 0.35);
}

.hero-banner-actions .button.secondary:hover {
  background: rgba(238, 243, 245, 0.08);
  border-color: rgba(238, 243, 245, 0.55);
}

.live-card {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
}

.live-card-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.live-card--compact {
  padding: 12px 0 28px;
  border-top: none;
  background: transparent;
}

.live-card--compact .live-card-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.live-card .eyebrow {
  color: var(--accent);
}

.live-card--compact .eyebrow {
  margin: 0;
}

.live-card p {
  color: var(--text-secondary);
  margin: 0;
}

.live-card--compact .live-card-inner > p:last-child {
  flex: 1 1 16rem;
}

.live-card h2 {
  font-size: 1.15rem;
  margin: 4px 0 8px;
}

/* ── Home Sections ── */
.home-section {
  padding: 48px 20px;
  max-width: var(--container);
  margin: 0 auto;
}

.home-section--tight {
  padding-top: 32px;
  padding-bottom: 24px;
}

/* Витрина главной: полноценная сетка 4→3→2 колонок, не list-view */
.product-grid.home-product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  gap: 16px;
}

.home-product-section {
  padding-top: 32px;
  padding-bottom: 32px;
}

.home-product-section .section-header > div {
  min-width: 0;
}

.home-product-section .section-header .eyebrow {
  margin: 0 0 4px;
}

.home-product-grid .product-card {
  max-width: none;
  width: 100%;
}

.home-product-grid .product-image-container {
  height: 180px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
}

.section-link {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.section-link:hover {
  color: var(--accent-hover);
}

/* ── Feature Badges ── */
.feature-badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 20px 56px;
  max-width: var(--container);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.feature-badge {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 20px 8px 0;
  border: none;
  background: transparent;
  border-right: 1px solid var(--border);
}

.feature-badge:last-child {
  border-right: none;
  padding-right: 0;
}

.feature-badge:hover {
  border-color: var(--border);
}

.feature-badge-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
}

.feature-badge-icon svg {
  width: 22px;
  height: 22px;
}

.feature-badge h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.feature-badge p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 28ch;
}

/* ── Eyebrow ── */
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Category Grid ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  border: none;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.category-card:hover {
  background: var(--accent-light);
  box-shadow: none;
  color: var(--text);
}

.category-card:hover h3 {
  color: var(--accent-hover);
}

.category-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.category-card-icon svg {
  width: 20px;
  height: 20px;
}

.category-card-body h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.category-card-body p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature-grid article,
.section-card,
.auth-card,
.page-header {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 24px;
}

.feature-grid article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-grid article:hover {
  box-shadow: var(--shadow-md);
}

.feature-grid p,
.section-card p,
.auth-card p,
.page-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Page Header ── */
.auth-card {
  margin-inline: auto;
  max-width: 480px;
}

.page-header {
  max-width: var(--container);
  margin: 0 auto;
  border: none;
  background: transparent;
  padding: 28px 20px 8px;
}

.page-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  margin: 4px 0 8px;
}

.section-card {
  margin-top: 16px;
}

.auth-card h1 {
  font-size: 1.75rem;
}

/* ── Forms ── */
.form-grid,
.search-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.form-grid label,
.search-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.search-form input {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color 0.15s;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-grid small,
.form-note,
.field-errors,
.form-errors {
  color: var(--text-secondary);
  font-size: 12px;
}

.field-errors,
.form-errors {
  color: var(--error);
}

/* ── Toast Notifications ── */
.toast-stack {
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  left: auto;
  max-width: min(400px, calc(100vw - 32px));
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: auto;
  width: max-content;
  z-index: 2000;
}

.toast {
  align-items: center;
  animation: toast-in 0.3s ease-out both;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 12px 16px;
  width: min(400px, calc(100vw - 32px));
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

.toast button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  justify-content: center;
  width: 24px;
}

.toast button:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.toast-hiding {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s, transform 0.2s;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Catalog Layout ── */
.catalog-layout,
.product-detail {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 260px 1fr;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.catalog-layout .section-card,
.product-detail .section-card,
.section-card:has(.product-grid) {
  max-width: none;
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  gap: 16px;
  /* Фиксируем верхнюю границу ширины карточки — иначе 1fr раздувает квадрат фото */
  grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
  justify-content: start;
}

/* ── Product Card ── */
.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  max-width: 240px;
  width: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.product-card:hover {
  box-shadow: none;
  border-color: var(--border-strong);
  background: var(--surface);
}

.product-card .product-image-container {
  position: relative;
  height: 160px;
  aspect-ratio: auto;
  background: var(--surface-alt);
  overflow: hidden;
  flex-shrink: 0;
  border: none;
  border-bottom: 1px solid var(--border);
}

.product-card .product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.product-card .badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--hero-ink);
  color: #eef3f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 0;
}

.product-card .badge-new { background: var(--success); }
.product-card .badge-sale { background: var(--error); }

.product-card-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.product-card .eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
}

.product-card h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.product-card h3 a {
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card h3 a:hover {
  color: var(--accent);
}

.product-card .price {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.product-card .price-old {
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 400;
}

.product-card a {
  color: inherit;
}

.product-card a:hover {
  color: inherit;
}

.product-card .product-card-body img {
  max-width: 100%;
  display: block;
}

.product-article {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0 0 4px;
}

.product-price {
  margin-top: auto;
  padding-top: 8px;
}

.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  margin-top: 10px;
}

.product-card-actions .button {
  flex: 1 1 auto;
  padding: 7px 10px;
  font-size: 12px;
  min-width: 0;
}

.product-card-form {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
}

.product-card-form .button {
  width: 100%;
}

.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: var(--text-secondary);
  font-size: 12px;
  background:
    linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
}

.placeholder-letter {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-secondary);
  opacity: 0.45;
}

.price-on-request {
  color: var(--text-secondary);
  font-style: italic;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Line List (Cart, Orders) ── */
.line-list {
  display: grid;
  gap: 8px;
}

.line-item {
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  padding: 12px 16px;
}

.order-row {
  grid-template-columns: 1fr auto auto;
}

.order-detail-row {
  grid-template-columns: 1fr auto auto;
}

.checkout-row {
  grid-template-columns: 1fr auto;
}

.quote-row {
  grid-template-columns: 1fr auto;
}

/* ── Inline Form ── */
.inline-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}

.inline-form input {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  max-width: 80px;
  padding: 6px 8px;
}

.inline-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Summary Card ── */
.summary-card {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 12px;
}

/* ── Pagination ── */
.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.pagination a:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.pagination .current {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ── Price ── */
.price {
  color: var(--text);
  font-weight: 700;
}

.price-large {
  font-size: 24px;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 12px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 16px 16px 0;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .separator {
  color: var(--border-strong);
}

/* ── Product Detail ── */
.product-meta,
.attributes-list {
  display: grid;
  gap: 0;
}

.product-meta div,
.attributes-list div {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(140px, 220px) 1fr;
  padding: 10px 0;
}

.product-meta div:nth-child(odd),
.attributes-list div:nth-child(odd) {
  background: transparent;
}

.product-meta dt,
.attributes-list dt {
  color: var(--text-secondary);
  font-size: 13px;
}

.product-meta dd,
.attributes-list dd {
  margin: 0;
  font-weight: 600;
}

.product-detail-enhanced {
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px 20px 28px;
  align-items: start;
}

.product-gallery {
  display: grid;
  gap: 12px;
}

.product-gallery-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 1 / 1;
  max-height: 460px;
  overflow: hidden;
  padding: 20px;
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  background: transparent;
  border: none;
  min-height: 0;
}

.product-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface-alt);
  min-height: 220px;
}

.gallery-thumbs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.gallery-thumbs img {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  object-fit: contain;
  width: 100%;
  padding: 6px;
  cursor: pointer;
}

.gallery-thumbs img:hover {
  border-color: var(--accent);
}

.product-buy-box {
  position: sticky;
  top: 88px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 22px 18px;
}

.product-buy-box .section-card {
  padding: 20px;
}

.product-specs {
  max-width: 960px;
}

.product-specs .section-card {
  padding: 20px;
}

/* ── Content Page ── */
.content-page {
  line-height: 1.75;
  max-width: 760px;
}

.content-page h1, .content-page h2, .content-page h3 {
  margin-top: 24px;
}

.content-page h1:first-child, .content-page h2:first-child {
  margin-top: 0;
}

/* ── Search Results ── */
.search-results {
  font-size: 13px;
}

.search-results .line-item {
  padding: 8px 12px;
}

/* ── Site Footer ── */
.site-footer {
  background: var(--hero-ink);
  color: rgba(238, 243, 245, 0.72);
  border-top: none;
  display: block;
  padding: 56px 20px 48px;
  margin-top: 64px;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 36px;
  max-width: var(--container);
  margin: 0 auto;
}

.site-footer h2 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(238, 243, 245, 0.45);
  margin: 0 0 14px;
}

.site-footer nav,
.site-footer section {
  display: grid;
  gap: 8px;
  align-content: start;
}

.site-footer a {
  color: rgba(238, 243, 245, 0.72);
  font-size: 14px;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer p {
  color: rgba(238, 243, 245, 0.65);
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}

.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 10px;
  text-transform: none;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-banner::before,
  .hero-banner::after,
  .hero-banner-content,
  .hero-banner-actions {
    animation: none !important;
  }
}

/* ── Responsive: 1280px ── */
@media (max-width: 1280px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .feature-badges {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-layout,
  .product-detail {
    grid-template-columns: 220px 1fr;
  }

  .product-detail-enhanced {
    grid-template-columns: 1fr;
  }

  .product-buy-box {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid.home-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Responsive: 768px ── */
@media (max-width: 768px) {
  .site-header-inner {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .site-nav {
    gap: 8px;
    order: 3;
    width: 100%;
  }

  .site-actions {
    gap: 4px;
  }

  .catalog-layout,
  .line-item,
  .product-detail {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    min-height: min(72vh, 560px);
  }

  .hero-banner::after {
    width: 70vw;
    opacity: 0.7;
  }

  .hero-banner h1 {
    max-width: none;
  }

  .search-bar {
    order: 3;
    max-width: none;
    width: 100%;
  }

  .header-catalog-btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .feature-badges {
    grid-template-columns: 1fr 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .feature-badge {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 12px 20px 0;
  }

  .top-bar-left {
    gap: 8px;
  }

  .top-bar-link span,
  .top-bar-info span {
    display: none;
  }

  .site-footer {
    padding: 40px 16px 36px;
  }

  .site-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .nav-bar-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .home-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .product-grid.home-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .breadcrumbs {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ── Responsive: 640px ── */
@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-badges {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .product-grid.home-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card {
    max-width: none;
  }

  .product-card .product-image-container {
    height: 130px;
  }

  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-header-inner {
    gap: 8px;
  }

  .header-action-label {
    font-size: 10px;
  }

  .top-bar-inner {
    flex-direction: column;
    gap: 2px;
  }

  .top-bar-right {
    gap: 6px;
  }

  .hero-banner-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-banner-actions .button {
    text-align: center;
  }

  .product-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card-actions .button {
    text-align: center;
  }

  .product-card-form {
    display: contents;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-header h1 {
    font-size: 22px;
  }
}

/* ── Utility Classes ── */
.u-no-max { max-width: none; }
.u-full-width { max-width: 960px; margin-left: auto; margin-right: auto; }
.u-mt-0 { margin-top: 0; }
.u-mb-0 { margin-bottom: 0; }
.u-pb-0 { padding-bottom: 0; }
.u-pt-0 { padding-top: 0; }
.u-text-center { text-align: center; }
.u-flex-1 { flex: 1; }
.u-hidden { display: none; }
.u-empty-state { text-align: center; padding: 48px 16px; }
.u-empty-state h2 { margin: 8px 0; }

/* ── Product Detail Specifics ── */
.product-buy-box .price-meta {
  background: var(--surface-alt);
  border: none;
  padding: 14px 16px;
  margin: 0 0 16px;
}

.product-buy-box .price-meta .price {
  margin: 0;
}

.product-buy-box .price-meta .product-article {
  margin: 4px 0 0;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-bar .button {
  border-radius: 0;
}

.tab-bar .button.active {
  border-bottom: 2px solid var(--accent);
}

.tab-bar .button:not(.active) {
  border-bottom: 2px solid transparent;
}

/* ── Cart Item Thumbnail ── */
.cart-thumb {
  width: 64px;
  height: 64px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Search Result Thumbnail ── */
.search-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Filter Button Row ── */
.filter-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-actions .button,
.filter-actions .button.secondary {
  flex: 1;
}

.filter-actions .button.secondary {
  text-align: center;
}

/* ── Additional Utilities ── */
.u-mt-12 { margin-top: 12px; }
.u-mb-8 { margin-bottom: 8px; }
.u-flex-between { justify-content: space-between; width: 100%; }

/* ── Product Detail extras ── */
.product-short-desc {
  margin-bottom: 16px;
}

.product-sku-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.product-sku-row strong {
  color: var(--text);
  font-weight: 700;
}

.product-stock {
  color: var(--accent);
  font-weight: 700;
}

.product-delivery {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.product-delivery strong {
  color: var(--text);
}

.product-meta-buy {
  margin-bottom: 20px;
}

.add-to-cart-form {
  margin-bottom: 14px;
  align-items: end;
}

.add-to-cart-form .button {
  min-width: 140px;
  padding: 11px 18px;
}

.product-text-action {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.product-text-action:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.product-desc-block {
  margin: 0 0 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.product-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.muted-text {
  color: var(--text-secondary);
}

.doc-link {
  font-weight: 600;
}

/* ── Subcategory chips ── */
.subcategory-chips {
  padding: 0;
  margin: 0 -16px;
}

.subcategory-label {
  margin-bottom: 8px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
}

.empty-state h2 {
  margin: 8px 0;
}

.empty-state-actions {
  justify-content: center;
  margin-top: 16px;
}

/* ── Catalog index ── */
.catalog-hero {
  position: relative;
  isolation: isolate;
  padding: 48px 20px 40px;
  background:
    linear-gradient(120deg, var(--hero-ink) 0%, #163038 100%);
  color: #eef3f5;
  overflow: hidden;
}

.catalog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(238, 243, 245, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 245, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.7;
}

.catalog-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.catalog-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.catalog-hero p {
  margin: 0;
  max-width: 48ch;
  font-size: 1rem;
  color: rgba(238, 243, 245, 0.7);
  line-height: 1.55;
}

.catalog-groups {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px 20px 24px;
}

.catalog-group {
  margin-bottom: 40px;
}

.catalog-group-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.catalog-group-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.catalog-group-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.catalog-group-link {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.catalog-group-link:hover {
  color: var(--accent-hover);
}

/* Компактный список подкатегорий на /catalog/ */
.catalog-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}

.catalog-link-list li {
  border-bottom: 1px solid var(--border);
}

.catalog-link-list li:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.catalog-link-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 0;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.catalog-link-list li:nth-child(even) a {
  padding-left: 12px;
  padding-right: 0;
}

.catalog-link-list a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.catalog-link-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
}

.catalog-link-count {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* List-view товаров (B2B) */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.product-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 200px;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.product-row-media {
  display: block;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}

.product-row-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.product-row-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  opacity: 0.55;
}

.product-row-main {
  min-width: 0;
}

.product-row-meta {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.product-row-meta .sep {
  margin: 0 4px;
  opacity: 0.5;
}

.product-row-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.product-row-title a {
  color: var(--text);
  text-decoration: none;
}

.product-row-title a:hover {
  color: var(--accent);
}

.product-row-sku {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.product-row-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.product-row-price {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.product-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.product-row-actions form {
  margin: 0;
}

.product-row-actions .button {
  padding: 7px 12px;
  font-size: 12px;
}

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.subcategory-grid .subcategory-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .catalog-link-list {
    grid-template-columns: 1fr;
  }

  .catalog-link-list li:nth-child(odd) {
    border-right: none;
  }

  .catalog-link-list li:nth-child(even) a,
  .catalog-link-list a {
    padding-left: 0;
    padding-right: 0;
  }

  .catalog-group-link {
    margin-left: 0;
    width: 100%;
  }

  .product-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .product-row-media {
    width: 72px;
    height: 72px;
  }

  .product-row-buy {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding-top: 4px;
  }

  .product-row-actions {
    justify-content: flex-end;
  }

  .subcategory-grid {
    grid-template-columns: 1fr;
  }
}

/* legacy subcat card grid (если остался где-то) */
.catalog-subcats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.subcat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  min-height: 0;
  transition: background-color 0.2s ease;
}

.subcat-card:hover {
  background: var(--accent-light);
  color: var(--text);
}

.subcat-card-icon {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--accent);
  opacity: 0.85;
}

.subcat-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.subcat-card-icon svg {
  width: 18px;
  height: 18px;
}

.subcat-card-body {
  flex: 1;
  min-width: 0;
}

.subcat-card-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-family: var(--font-display);
  font-weight: 700;
  word-break: break-word;
}

.subcat-card-count {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}

.show-more-wrap {
  text-align: center;
  margin-top: 14px;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

a.show-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.show-more-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.show-more-btn.expanded svg {
  transform: rotate(180deg);
}

.subcat-hidden {
  display: none;
}

/* ── Shop shells & panels ── */
.shop-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px 40px;
}

.shop-panel {
  border-top: 1px solid var(--border);
  background: transparent;
  padding: 20px 0;
}

.panel-title {
  font-size: 1.05rem;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.filter-panel {
  border-top: 1px solid var(--border);
  padding: 8px 0 20px;
}

.filter-panel .form-grid input,
.filter-panel .form-grid select,
.filter-panel .form-grid textarea {
  width: 100%;
  max-width: 100%;
}

.results-panel {
  border-top: 1px solid var(--border);
  padding: 8px 0 20px;
  min-width: 0;
}

.results-meta {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.subcategory-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--container);
}

.subcategory-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.subcategory-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
}

.product-detail-enhanced {
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px 20px 28px;
  gap: 28px;
}

.product-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 4px 0 14px;
  letter-spacing: -0.03em;
}

.product-buy-box .price-large {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.product-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-secondary-actions form {
  margin: 0;
}

.product-tabs-panel {
  max-width: var(--container);
  margin: 0 auto 32px;
  padding: 0 20px;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  max-width: 78ch;
  line-height: 1.7;
}

.line-item {
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 16px 0;
}

.line-item h2,
.line-item h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.line-item h2 a,
.line-item h3 a {
  color: var(--text);
}

.line-item h2 a:hover,
.line-item h3 a:hover {
  color: var(--accent);
}

.summary-card {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 40px 20px 64px;
}

.auth-card {
  width: min(100%, 440px);
  margin: 0;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  padding: 28px 0 0;
}

.auth-card h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 4px 0 10px;
}

.auth-card > p {
  color: var(--text-secondary);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}

.account-block {
  padding: 24px 28px 24px 0;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.account-block:nth-child(2n) {
  padding-right: 0;
  padding-left: 28px;
  border-right: none;
}

.account-block h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.account-block p {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.content-page {
  line-height: 1.75;
  max-width: 68ch;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.content-page h1,
.content-page h2,
.content-page h3 {
  margin-top: 28px;
}

.content-page h1:first-child,
.content-page h2:first-child {
  margin-top: 0;
}

.success-panel h2 {
  margin: 4px 0 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--hero-ink);
  color: #eef3f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-block,
  .account-block:nth-child(2n) {
    padding: 20px 0;
    border-right: none;
  }
}

@media (max-width: 768px) {
  .shop-shell,
  .product-detail-enhanced,
  .product-tabs-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .product-gallery-stage {
    max-height: 360px;
    aspect-ratio: 4 / 3;
  }

  .product-buy-box {
    padding: 18px 16px 14px;
  }

  .product-secondary-actions {
    gap: 10px 14px;
  }

  .add-to-cart-form {
    width: 100%;
  }

  .add-to-cart-form .button {
    flex: 1;
  }
}
