/* ============================================================
   BOCA FABRICS — Main stylesheet
   Импорты в порядке зависимости
   ============================================================ */
@import url('/css/components/catalog.css');
@import url('/css/components/sidebar.css');
@import url('/css/components/cards.css');
@import url('/css/components/modal.css');
@import url('/css/components/forms.css');
@import url('/css/components/fabric-page.css');

/* ============================================================
   ДИЗАЙН-ТОКЕНЫ
   ============================================================ */
:root {
  /* Фоны */
  --bg:           #0c0c0f;
  --bg-elevated:  #15151a;
  --bg-sidebar:   #131318;
  --bg-input:     #1a1a20;
  --bg-overlay:   rgba(0, 0, 0, 0.7);

  /* Границы */
  --border:        rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-bright: rgba(255, 255, 255, 0.2);

  /* Текст */
  --text:        #ffffff;
  --text-dim:    rgba(255, 255, 255, 0.55);
  --text-faint:  rgba(255, 255, 255, 0.35);
  --text-mute:   rgba(255, 255, 255, 0.25);

  /* Акценты */
  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-dim:    rgba(59, 130, 246, 0.12);
  --accent-glow:   rgba(59, 130, 246, 0.4);

  /* Семантические */
  --danger:        #ef4444;
  --danger-hover:  #dc2626;
  --warning:       #f59e0b;
  --success:       #10b981;

  /* Лимитные (тёплый янтарный) */
  --limited:       #f59e0b;
  --limited-glow:  rgba(245, 158, 11, 0.3);

  /* Закругления */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Тени */
  --shadow-sm:  0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow:     0 12px 32px -8px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 30px 80px -20px rgba(0, 0, 0, 0.6);

  /* Анимации */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --duration:   0.2s;

  /* Типографика */
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --header-height: 132px;
  --sidebar-width: 260px;
  --content-max:   1680px;
  --gutter:        24px;

  /* z-index */
  --z-header:   100;
  --z-modal:    1000;
  --z-toast:    2000;
}

/* ============================================================
   СБРОС И БАЗА
   ============================================================ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

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

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

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

/* Кастомный скроллбар */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-bright);
}

/* ============================================================
   ЗАГРУЗОЧНЫЙ ЭКРАН
   ============================================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--bg);
  z-index: 9999;
  animation: boot-fade-out 0.4s var(--ease) forwards;
  animation-play-state: paused;
}

.boot-screen.is-hiding {
  animation-play-state: running;
}

@keyframes boot-fade-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.boot-screen__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 0.18em;
  color: var(--text);
  opacity: 0.9;
}

.boot-screen__dots {
  display: flex;
  gap: 8px;
}

.boot-screen__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: boot-pulse 1.4s ease-in-out infinite;
}

.boot-screen__dots span:nth-child(2) { animation-delay: 0.16s; }
.boot-screen__dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes boot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   ОБЩИЕ КОМПОНЕНТЫ
   ============================================================ */

/* Spinner для загрузок */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Утилиты */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   404
   ============================================================ */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
}

.not-found__code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 120px;
  letter-spacing: -0.04em;
  color: var(--text-faint);
  line-height: 1;
}

.not-found__title {
  font-size: 18px;
  color: var(--text-dim);
}

.not-found__link {
  margin-top: 16px;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  transition: background var(--duration) var(--ease);
}

.not-found__link:hover {
  background: var(--accent-hover);
}

/* ============================================================
   ТОСТЫ
   ============================================================ */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s var(--ease-out);
  max-width: 360px;
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast--success {
  border-color: rgba(16, 185, 129, 0.4);
}

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

/* ============================================================
   АДАПТИВНОСТЬ — главные брейкпоинты
   ============================================================ */
@media (max-width: 1280px) {
  :root {
    --sidebar-width: 240px;
  }
}

@media (max-width: 960px) {
  :root {
    --gutter: 16px;
    --header-height: auto;
  }
}
