/* ═══════════════════════════════════════════════════════════════
   MC Виан B2B Portal — Design System (base.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CSS Custom Properties ────────────────────────────────── */
:root {
  /* Colors — Primary */
  --color-primary:        #007EFF;
  --color-primary-dark:   #0062CC;
  --color-primary-light:  #E8F3FF;
  --color-primary-hover:  #0070E6;

  /* Colors — Backgrounds & Surfaces */
  --color-bg:             #F7F9FB;
  --color-surface:        #FFFFFF;
  --color-text:           #0B1220;
  --color-text-secondary: #5A6678;
  --color-text-muted:     #8896A6;
  --color-border:         #E2E8F0;
  --color-border-light:   #F1F5F9;

  /* Colors — Status */
  --color-success:        #22C55E;
  --color-success-light:  #DCFCE7;
  --color-warning:        #F59E0B;
  --color-warning-light:  #FEF3C7;
  --color-danger:         #EF4444;
  --color-danger-light:   #FEE2E2;
  --color-info:           #06B6D4;
  --color-info-light:     #CFFAFE;

  /* Shadows */
  --color-shadow:         rgba(11,18,32,0.08);
  --shadow-xs:            0 1px 2px rgba(11,18,32,0.04);
  --shadow-sm:            0 1px 3px rgba(11,18,32,0.06);
  --shadow-md:            0 2px 8px rgba(11,18,32,0.08);
  --shadow-lg:            0 4px 16px rgba(11,18,32,0.12);
  --shadow-xl:            0 8px 30px rgba(11,18,32,0.16);

  /* Border Radius */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition:      all 0.2s ease;
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing Scale (numbered) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Spacing Aliases (named) */
  --space-2xs: 2px;
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --header-height:     64px;
  --sidebar-width:     260px;
  --container-max:     1280px;
  --container-padding: 24px;

  /* Z-index */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-header:    300;
  --z-drawer:    350;
  --z-overlay:   400;
  --z-modal:     500;
  --z-toast:     600;
  --z-loader:    700;
}

/* ── 2. CSS Reset (Modern) ───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: var(--color-primary-dark);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

::selection {
  background-color: var(--color-primary);
  color: #fff;
}

/* ── 3. Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 32px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; font-weight: 600; }

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}
p:last-child { margin-bottom: 0; }

small { font-size: 12px; }

.text-xs    { font-size: 12px; }
.text-sm    { font-size: 14px; }
.text-base  { font-size: 16px; }
.text-lg    { font-size: 18px; }
.text-xl    { font-size: 20px; }
.text-2xl   { font-size: 24px; }
.text-3xl   { font-size: 28px; }
.text-4xl   { font-size: 32px; }
.text-5xl   { font-size: 40px; }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-white     { color: #fff; }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 4. Layout Utilities ─────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Flex */
.flex         { display: flex; }
.inline-flex  { display: inline-flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Spacing */
.m-0  { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }

/* Width / Height */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Visibility */
.hidden  { display: none !important; }
.block   { display: block; }
.inline-block  { display: inline-block; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ── 5. Custom Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ── 6. Keyframe Animations ──────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ph-spin { animation: spin 1s linear infinite; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes progressBar {
  0%   { width: 0; }
  100% { width: 100%; }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* ── 7. Animation Utility Classes ────────────────────────────── */
.animate-fade-in     { animation: fadeIn 0.3s ease forwards; }
.animate-fade-out    { animation: fadeOut 0.3s ease forwards; }
.animate-slide-up    { animation: slideUp 0.4s ease forwards; }
.animate-slide-down  { animation: slideDown 0.4s ease forwards; }
.animate-slide-right { animation: slideInRight 0.3s ease forwards; }
.animate-scale-in    { animation: scaleIn 0.25s ease forwards; }
.animate-pulse       { animation: pulse 2s ease-in-out infinite; }
.animate-spin        { animation: spin 1s linear infinite; }
.animate-shake       { animation: shake 0.5s ease; }
.animate-bounce-in   { animation: bounceIn 0.5s ease forwards; }

/* Staggered delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ── 8. Skeleton Loaders ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-border) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-xs);
}
.skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: var(--space-3);
}
.skeleton-img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
}
.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}
.skeleton-btn {
  height: 40px;
  width: 120px;
  border-radius: var(--radius-md);
}

/* ── 9. Accessibility ────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: var(--z-loader);
  transition: var(--transition);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-4);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── 10. Page Loader ─────────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  z-index: var(--z-loader);
  transition: opacity 0.3s ease;
}
.page-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.page-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Top progress bar */
.progress-bar-top {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  z-index: var(--z-loader);
  transition: width 0.3s ease;
}

/* ── 11. Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  pointer-events: auto;
  animation: slideInRight 0.3s ease forwards;
  max-width: 400px;
  font-size: 14px;
}
.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-warning { border-left-color: var(--color-warning); }
.toast.toast-danger  { border-left-color: var(--color-danger); }
.toast.is-leaving    { animation: fadeOut 0.3s ease forwards; }

.toast__icon {
  font-size: 20px;
  flex-shrink: 0;
}
.toast__close {
  margin-left: auto;
  opacity: 0.5;
  transition: var(--transition-fast);
  padding: var(--space-1);
}
.toast__close:hover { opacity: 1; }

/* ── 11b. Main Content Area ──────────────────────────────────── */
.main {
  flex: 1;
  padding: var(--space-6) 0;
}
.page-home .main,
.main--no-padding-bottom {
  padding: 0;
}

/* ── 12. Section Styling ─────────────────────────────────────── */
.section {
  padding: var(--space-12) 0;
}
.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-8);
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-top: var(--space-3);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

/* ── 13. Responsive Breakpoints ──────────────────────────────── */
@media (max-width: 1279px) {
  :root {
    --container-padding: 20px;
  }
  .grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
  :root {
    --container-padding: 16px;
  }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(2, 1fr); }
  .hide-tablet { display: none !important; }
}

@media (max-width: 767px) {
  :root {
    --container-padding: 16px;
    --header-height: 56px;
  }
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  .section { padding: var(--space-8) 0; }
  .section-title { font-size: 22px; }
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    top: var(--space-4);
  }
  .toast { max-width: 100%; }
}

@media (min-width: 768px) {
  .show-mobile-only { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   14. Top Bar
   ═══════════════════════════════════════════════════════════════ */
.top-bar {
  background: var(--color-text);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
}
.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-bar__left,
.top-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.top-bar__link {
  color: rgba(255,255,255,0.8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: var(--transition-fast);
}
.top-bar__link:hover {
  color: #fff;
}
.top-bar__link i {
  font-size: 15px;
}

@media (max-width: 767px) {
  .top-bar__right { display: none; }
  .top-bar__left { gap: var(--space-3); font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   15. Header
   ═══════════════════════════════════════════════════════════════ */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.header__logo svg {
  display: block;
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-bar__form {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar__icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.search-bar__input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.search-bar__input:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.search-bar__input::placeholder {
  color: var(--color-text-muted);
}
.search-bar__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
  max-height: 400px;
  overflow-y: auto;
}
.search-bar__dropdown.is-open {
  display: block;
  animation: scaleIn 0.15s ease forwards;
}

/* ── Search Dropdown Items ─────────────────────────────────── */
.search-group {
  padding: var(--space-2) 0;
}
.search-group + .search-group {
  border-top: 1px solid var(--color-border-light);
}
.search-group__title {
  padding: var(--space-2) var(--space-4);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  margin-bottom: var(--space-1);
}
.search-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
  border-radius: var(--radius-md);
  margin: 0 var(--space-2);
}
.search-item:hover,
.search-item.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.search-item__img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--color-bg);
  flex-shrink: 0;
  border: 1px solid var(--color-border-light);
}
.search-item__info {
  flex: 1;
  min-width: 0;
}
.search-item__name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item__name mark {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}
.search-item__article {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.search-item__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--color-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.search-item i {
  font-size: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
}
.search-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
  font-size: 14px;
}
.search-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: var(--space-2);
  opacity: 0.5;
}
.search-skeleton {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Header Actions */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.header__action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 22px;
  transition: var(--transition-fast);
}
.header__action-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.header__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.header__badge:empty {
  display: none;
}

/* User Menu */
.header__user-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}
.header__user-btn:hover {
  background: var(--color-bg);
}
.header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.header__username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Burger */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
}
.header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}
.header__burger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.header__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.header__burger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Notifications & Cart Dropdowns */
.notifications-widget,
.cart-widget {
  position: relative;
}
.notifications-dropdown,
.cart-mini {
  position: absolute;
  top: calc(100% + 8px);
  right: 50%;
  transform: translateX(50%);
  width: 360px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
}
.notifications-dropdown.is-open,
.cart-mini.is-open {
  display: block;
  animation: scaleIn 0.15s ease forwards;
}

/* ---- Notifications Dropdown ---- */
.notifications-dropdown__content {
  padding: 0;
}
.notifications-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
}
.notifications-dropdown__header h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.notifications-dropdown__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
}
.notifications-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
  text-decoration: none;
  color: var(--color-text);
}
.notification-item:hover {
  background: var(--color-bg);
}
.notification-item.is-unread {
  background: rgba(0, 126, 255, 0.06);
}
.notification-item.is-unread:hover {
  background: rgba(0, 126, 255, 0.1);
}
.notification-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.notification-item.is-unread .notification-item__icon {
  background: var(--color-primary);
  color: #fff;
}
.notification-item__body {
  flex: 1;
  min-width: 0;
}
.notification-item__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-item__text {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notification-item__time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
  display: block;
}
.notifications-footer {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  border-top: 1px solid var(--color-border-light);
  transition: background 0.15s ease;
}
.notifications-footer:hover {
  background: var(--color-bg);
}
.notifications-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
}
.notifications-empty i {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.5;
}
.notifications-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

/* ---- Cart Mini Dropdown ---- */
.cart-mini__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
}
.cart-mini__header h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.cart-mini__header-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
}
.cart-mini__content {
  padding: 0;
}
.cart-mini__items {
  padding: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.cart-mini__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}
.cart-mini__item:hover {
  background: var(--color-bg);
}
.cart-mini__remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition-fast);
  flex-shrink: 0;
  opacity: 0;
}
.cart-mini__item:hover .cart-mini__remove {
  opacity: 1;
}
.cart-mini__remove:hover {
  color: var(--color-danger);
  background: var(--color-danger-light);
}
.cart-mini__img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-bg);
  flex-shrink: 0;
}
.cart-mini__info {
  flex: 1;
  min-width: 0;
}
.cart-mini__name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}
.cart-mini__qty {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.cart-mini__more {
  text-align: center;
  padding: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.cart-mini__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-light);
  font-size: 14px;
}
.cart-mini__total strong {
  font-size: 15px;
  color: var(--color-primary);
}
.cart-mini__actions {
  padding: 0 12px 12px;
}
.cart-mini__empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
}
.cart-mini__empty i {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.5;
}
.cart-mini__loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

/* User menu dropdown */
.user-menu .dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
  padding: var(--space-2);
}
.user-menu .dropdown__menu.is-open {
  display: block;
  animation: scaleIn 0.15s ease forwards;
}
.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  width: 100%;
  text-align: left;
}
.dropdown__item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.dropdown__item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}
.dropdown__item--danger {
  color: var(--color-danger);
}
.dropdown__item--danger:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}
.dropdown__divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-1) 0;
}

@media (max-width: 767px) {
  .header {
    height: 56px;
  }
  .search-bar {
    display: none;
  }
  .header__username {
    display: none;
  }
  .header__burger {
    display: flex;
  }
  .notifications-dropdown,
  .cart-mini {
    width: calc(100vw - 32px);
    right: 0;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   16. Header Navigation
   ═══════════════════════════════════════════════════════════════ */
.header-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav__list::-webkit-scrollbar {
  display: none;
}
.header-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}
.header-nav__link:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.header-nav__link.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.header-nav__link i {
  font-size: 18px;
}

@media (max-width: 767px) {
  .header-nav__link {
    padding: 10px 14px;
    font-size: 13px;
  }
  .header-nav__link i {
    font-size: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   17. Footer
   ═══════════════════════════════════════════════════════════════ */
.footer {
  background: linear-gradient(180deg, #0B1220 0%, #0e1a2e 30%, #162d4a 100%);
  color: rgba(255,255,255,0.85);
  padding: var(--space-16) 0 0;
  margin-top: 0;
}

/* On non-home pages, clean footer top edge */
body:not(.page-home):not(.page-flush-footer):not(.page-auth) .footer {
  margin-top: var(--space-10);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-10);
}
.footer__logo {
  display: inline-block;
  margin-bottom: var(--space-4);
}
.footer__logo svg text {
  fill: #fff;
}
.footer__slogan {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}
.footer__socials {
  display: flex;
  gap: var(--space-3);
}
.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  transition: var(--transition-fast);
}
.footer__social:hover {
  background: var(--color-primary);
  color: #fff;
}
.footer__title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__links a {
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  transition: var(--transition-fast);
}
.footer__links a:hover {
  color: #fff;
  padding-left: 4px;
}
.footer__links--contacts li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255,255,255,0.65);
  font-size: 14px;
}
.footer__links--contacts i {
  font-size: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.footer__links--contacts a {
  color: rgba(255,255,255,0.85);
}
.footer__links--contacts a:hover {
  color: #fff;
  padding-left: 0;
}
.footer__requisites {
  margin-top: var(--space-3);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
}
.footer__requisites p { margin: 0; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-5) 0;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  text-align: center;
}

@media (max-width: 1023px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8) var(--space-6);
  }
}
@media (max-width: 767px) {
  .footer {
    padding-top: var(--space-10);
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ═══════════════════════════════════════════════════════════════
   18. Messages Container
   ═══════════════════════════════════════════════════════════════ */
.messages-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 420px;
}

@media (max-width: 767px) {
  .messages-container {
    left: var(--space-4);
    right: var(--space-4);
    max-width: 100%;
  }
}
