/* core\src\components\site\sidebar\style\sidebar.css */

/* ============================================================
 Sidebar
 >= 1024px  → фиксированная панель слева
 <  1024px  → скрыт, выезжает как drawer по кнопке бургера
 ============================================================ */

/* ---- Оверлей (затемнение фона на мобильном) ---- */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
}

/* ---- Сайдбар ---- */

.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;

  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 100;

  background: var(--bg-color-surface);
  padding: 10px 10px 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* ---- Десктоп (>= 1024px): сайдбар всегда виден ---- */

@media (min-width: 1024px) {

  .site-sidebar~main,
  .site-sidebar~.site-footer {
    padding-left: var(--sidebar-width);
  }

  .sidebar-overlay {
    display: none !important;
  }

  .sidebar-close {
    display: none;
  }
}

/* ---- Мобильный (< 1024px): drawer ---- */

@media (max-width: 1023px) {
  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.is-visible {
    pointer-events: auto;
  }

  .site-sidebar {
    /* Скрыт за левым краем */
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    /* На мобильном — на всю ширину экрана */
    width: min(320px, 100vw);
    /* Выше оверлея */
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .site-sidebar.is-open {
    transform: translateX(0);
  }
}

/* ---- Верхняя часть ---- */

.sidebar-header {
  position: relative;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  padding-bottom: 0.5rem;
}

/* Логотип — по центру */

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color);
}

.sidebar-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-site-name {
  font-size: var(--size-small);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Кнопка закрытия — поверх, правый угол, только мобильный */

.sidebar-close {
  display: none;
}

@media (max-width: 1023px) {
  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-muted);
    transition:
      background 0.15s,
      color 0.15s;
  }

  .sidebar-close:hover {
    background: var(--btn-bg-color-active);
    color: var(--color);
  }
}

/* ---- Навигация ---- */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-items {
  list-style: none;
  margin: 0.25rem 0 0.5rem 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* ---- Кнопка «Назад» = заголовок раздела (единая кликабельная строка) ---- */

.sidebar-back-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0.5rem;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-muted);
  font-size: var(--size);
  font-weight: 800;
  transition:
    background 0.15s,
    color 0.15s;
}

.sidebar-back-link:hover {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

.sidebar-back-icon {
  flex-shrink: 0;
}

/* ---- Стрелка у пункта с подкатегориями ---- */

.sidebar-link-arrow {
  margin-left: auto;
  padding-left: 4px;
  font-size: 16px;
  line-height: 1;
  color: var(--color-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Чтобы стрелка встала вправо, ссылки с ней должны быть flex */
.sidebar-link:has(.sidebar-link-arrow) {
  display: flex;
  align-items: center;
}

/* ---- Ссылки ---- */

.sidebar-link {
  display: block;
  padding: 10px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-muted);
  font-size: var(--size-small);
  transition:
    background 0.15s,
    color 0.15s;
}

.sidebar-link:hover {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

/* Категория в контексте */
.sidebar-link.is-active {
  font-weight: 800;
  color: var(--color);
}

/* Текущая страница */
.sidebar-link.is-current {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

/* Footer */

.sidebar-footer {
  flex-shrink: 0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer .links {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
}

.sidebar-footer .link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: var(--size-small);
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background 0.15s,
    color 0.15s;
}

/* Иконка пункта нижнего меню: на ПК в развёрнутом сайдбаре и на мобильном не показывается */
.sidebar-footer .link-icon {
  display: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer .link-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-footer .link:hover {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

.sidebar-footer .link.is-current {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

.sidebar-footer .lang {
  display: flex;
  gap: 6px;
}

.sidebar-footer .lang-btn {
  width: 26px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-small);
  font-weight: normal;
  text-transform: uppercase;
  border-radius: 6px;
  text-decoration: none;
  background: transparent;
  color: var(--color-muted);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-footer .lang-btn.is-active {
  background: var(--bg-color-surface);
  color: var(--color);
  border-color: var(--btn-border-color);
}

.sidebar-footer .lang-btn:hover {
  background: var(--btn-bg-color-active);
  color: var(--color);
}

/* ============================================================
 Сворачивание сайдбара (только ПК, >= 1024px)
 Состояние — класс .sidebar-collapsed на <html>
 ============================================================ */

:root {
  --sidebar-width-collapsed: 50px;
}

.sidebar-collapse {
  display: none;
}

/* Иконки разделов — показываются только в свёрнутой полоске на ПК */
.sidebar-rail {
  display: none;
}

@media (min-width: 1024px) {
  .site-sidebar {
    transition: width 0.25s ease;
  }

  .site-sidebar~main,
  .site-sidebar~.site-footer {
    transition: padding-left 0.25s ease;
  }

  /* Кнопка «<» — правый верхний угол развёрнутого сайдбара */
  .sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-muted);
    transition:
      background 0.15s,
      color 0.15s;
  }

  .sidebar-collapse:hover {
    background: var(--btn-bg-color-active);
    color: var(--color);
  }

  .sidebar-collapse svg {
    transition: transform 0.25s ease;
  }

  /* --- Свёрнутое состояние: узкая полоска --- */

  html.sidebar-collapsed .site-sidebar {
    width: var(--sidebar-width-collapsed);
    padding: 10px 8px 0;
  }

  html.sidebar-collapsed .site-sidebar~main,
  html.sidebar-collapsed .site-sidebar~.site-footer {
    padding-left: var(--sidebar-width-collapsed);
  }

  /* Вверху: «>» и логотип */
  html.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  html.sidebar-collapsed .sidebar-collapse {
    position: static;
    order: -1;
    width: 34px;
    height: 34px;
  }

  html.sidebar-collapsed .sidebar-collapse svg {
    transform: rotate(180deg);
  }

  html.sidebar-collapsed .sidebar-logo img {
    width: 34px;
    height: 34px;
  }

  html.sidebar-collapsed .sidebar-site-name,
  html.sidebar-collapsed .sidebar-nav {
    display: none;
  }

  /* Под логотипом: иконки разделов верхнего уровня */
  html.sidebar-collapsed .sidebar-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .sidebar-rail .rail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: var(--color-muted);
    transition:
      background 0.15s,
      color 0.15s;
  }

  .sidebar-rail .rail-link svg {
    width: 20px;
    height: 20px;
  }

  .sidebar-rail .rail-link:hover,
  .sidebar-rail .rail-link.is-current {
    background: var(--btn-bg-color-active);
    color: var(--color);
  }

  /* Внизу: иконки нижнего меню и языки столбиком */
  html.sidebar-collapsed .sidebar-footer {
    margin-top: auto;
    padding: 1rem 0;
    align-items: center;
  }

  html.sidebar-collapsed .sidebar-footer .links {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  html.sidebar-collapsed .sidebar-footer .link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
  }

  html.sidebar-collapsed .sidebar-footer .link-icon {
    display: flex;
  }

  html.sidebar-collapsed .sidebar-footer .link-text {
    display: none;
  }

  html.sidebar-collapsed .sidebar-footer .lang {
    flex-direction: column;
  }
}/* core\src\layouts\back-to-top\style\back-to-top.css */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s,
    transform 0.2s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: scale(1.1);
}

.back-to-top svg {
  display: block;
}
/* core\src\components\site\breadcrumbs\style\breadcrumbs.css */

.breadcrumbs {
  font-size: var(--size-small);
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  line-height: 1.2;
}

/* ================= ЭЛЕМЕНТЫ СПИСКА ================= */
.breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--color-muted);
}

/* Автоматический разделитель через CSS (вместо span в HTML) */
.breadcrumbs li:not(:last-child)::after {
  content: ">";
  color: #aaa;
  font-weight: 300;
  font-size: var(--size-small);
}
/* core\src\components\site\cart-icon\style\cart-icon.css */

.topbar-links .cart-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background-color: var(--bg-color);
  color: var(--color);
  font-weight: normal;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.topbar-links .cart-icon:has(.active) {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.topbar-links .cart-icon:has(.active):hover {
  border-color: var(--color-accent);
}

.cart-count {
  font-weight: bold;
}
/* core\src\components\site\style\header.css */

/* ============================================================
   Единая шапка.
   Мобильный  (< 1024px): две строки —  [лого | кнопки] / [крошки]
   Десктоп   (>= 1024px): одна строка — [крошки          | кнопки]
   ============================================================ */

.site-header {
  background: var(--bg-color);
}

.topbar {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "burger logo . actions"
    "crumbs crumbs crumbs crumbs";
  align-items: center;
  gap: 0 12px;
}

/* ── Бургер ────────────────────────────────────────────────── */

.topbar-burger {
  grid-area: burger;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  color: var(--color);
  transition: background 0.15s;
  flex-shrink: 0;
}

.topbar-burger:hover {
  background: var(--bg-color-surface);
}

.burger-box {
  display: block;
  width: 20px;
  height: 14px;
  position: relative;
}

.burger-inner,
.burger-inner::before,
.burger-inner::after {
  width: 20px;
  height: 2px;
  background-color: currentColor;
  position: absolute;
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.burger-inner {
  top: 50%;
  transform: translateX(-50%);
}

.burger-inner::before {
  content: "";
  top: -6px;
  left: 0;
}

.burger-inner::after {
  content: "";
  bottom: -6px;
  left: 0;
}

/* ── Логотип ───────────────────────────────────────────────── */

.topbar-logo {
  grid-area: logo;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
  color: var(--color);
  white-space: nowrap;
}

/* ── Хлебные крошки ────────────────────────────────────────── */

.topbar-crumbs {
  grid-area: crumbs;
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  padding: 20px 0 10px;
  margin-top: 10px;
}

.topbar-links a {
  color: var(--color);
  text-decoration: none;
  padding: 5px 8px;
  border: 1px solid var(--bg-color);
  border-radius: var(--border-radius-small);
}

.topbar-links a:hover {
  background-color: var(--bg-color-surface);
}

/* ── Кнопки ────────────────────────────────────────────────── */

.topbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-actions a {
  color: var(--color);
  font-size: var(--size-small);
  text-decoration: none;
  white-space: nowrap;
  transition: border 0.2s ease;
}

/* Более 1024 пикселей */
@media (min-width: 1024px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    grid-template-areas: "crumbs actions";
    gap: 0 12px;
  }

  /* Бургер и логотип скрыты на десктопе */
  .topbar-burger {
    display: none;
  }

  .topbar-logo {
    display: none;
  }

  /* Линию убираем — строка одна */
  .topbar-crumbs {
    border-top: none;
    padding: 0;
    margin: 0;
  }
}
/* core\src\components\site\style\footer.css */

.site-footer {
  margin-top: 3rem;
  padding: 30px 10px;
  text-align: center;
}

.site-footer .description {
  font-size: var(--size-small);
  color: var(--color-muted);
}
/* core\src\layouts\style\content.css */

article {
  margin: 0 auto;
  padding: 0 10px;
  max-width: var(--width-text);
}

article header {
  max-width: var(--width-text);
  text-align: center;
  margin: 1rem auto;
}

article header p {
  margin: 0;
}

article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  font-family: "Segoe UI", sans-serif;
  font-weight: 700;
}

article h1 {
  font-size: var(--size-h1);
  margin: 0;
  color: #666;
}

article h2 {
  font-size: var(--size-h2);
  margin: 2rem 0 1rem;
  color: steelblue;
}

article h3 {
  font-size: var(--size-h3);
  margin: 1rem 0;
  color: #666;
}

article h4,
article h5,
article h6 {
  font-size: var(--size);
  margin: 1rem 0;
}

article h6 {
  font-weight: normal;
}

article ul,
article ol {
  padding-left: 30px;
}

article p,
article ul,
article li {
  line-height: 1.6;
}

/* --- ТАБЛИЦА --- */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

article table thead th {
  text-align: center;
}

article table th,
article table td {
  border: 1px solid var(--border-color);
  padding: 8px;
}

/* --- КАРТИНКА --- */

figure {
  margin: 0;
}

@media (max-width: 768px) {
  figure img {
    max-width: 100%;
    height: auto;
  }
}

/* --- ЦИТАТА --- */

blockquote {
  margin: 1rem 0;
  padding: 1.5rem 2rem;
  border-left: 5px solid #4f46e5;
  border-radius: 8px;
  background-color: floralwhite;
}

blockquote p {
  margin: 0;
}

blockquote cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: right;
}
/* core\src\layouts\style\global.css */

/* --- БРЕЙКПОИНТЫ ---
   Планшет:  max-width: 1024px
   Мобильный: max-width: 768px
*/

:root {
  /* Размер шрифта (в rem: на мобильном масштабируются через html) */

  /* Основной текст */
  --size: 1rem;
  /* Любой текст меньше обычного */
  --size-small: 0.8rem;
  /* Заголовки */
  --size-h1: 2rem;
  --size-h2: 1.5rem;
  --size-h3: 1.3rem;
  /* Ширина */
  --width-text: 800px;
  --width-wide: 1600px;
  --sidebar-width: 250px;
  /* Кнопка */
  --btn-color: white;
  --btn-color-secondary: white;
  --btn-color-disabled: white;
  --btn-color-accent: crimson;
  --btn-bg-color: crimson;
  --btn-bg-color-active: #ddd;
  --btn-bg-color-secondary: #888;
  --btn-bg-color-disabled: #888;
  --btn-border-color: #888;
  --btn-border-color-secondary: #aaa;
  /* Граница */
  --border-color: #ddd;
  --border-color-field: #c8c8c8;
  --border-color-accent: crimson;
  --border-radius-small: 5px;
  --border-radius-middle: 12px;
  --border-radius-big: 20px;
  /* Изображение */
  --img-border-radius-small: 3px;
  --img-border-radius-middle: 12px;
  --img-border-radius-big: 20px;
  --img-border-color: #ccc;
  /* Цвет */
  --color: black;
  --color-accent: crimson;
  --color-muted: #444;
  --color-subtle: #757575;
  --color-placeholder: #9e9e9e;
  --color-success: #1a7a45;
  --color-warning: #7a4a00;
  --color-star: #f39c12;
  --color-error: #b91c1c;
  /* Фон */
  --bg-color: white;
  --bg-color-surface: #f5f5f5;
  --bg-color-accent: crimson;
  --bg-color-green: #e0fff3;
  --bg-color-red: #ffebeb;
  --bg-color-blue: #e8f6ff;
  --bg-color-yellow: #fff7e4;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 768px) {
  html {
    font-size: 113%;
  }

  :root {
    --size-h1: 1.6rem;
    --size-h2: 1.4rem;
    --size-h3: 1.2rem;
  }
}

@view-transition {
  navigation: auto;
}/* core\src\layouts\style\body.css */

body {
  font-family: Verdana, sans-serif;
  font-size: var(--size);
  margin: 0;
  padding: 0;

  /* Sticky footer */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  padding: 16px 0 0;
  flex: 1;
}

/* Утилиты */

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

strong {
  font-weight: 700;
}

/* --- Наведение --- */

.fly {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.fly:hover,
.button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

/* --- КНОПКИ --- */

.buttons {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  list-style: none;
  padding: 0;
}

.button {
  display: inline-block;
  align-self: flex-start;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 25px;
  border: none;
  border-radius: var(--border-radius-middle);
  font-weight: normal;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  color: var(--btn-color);
  background-color: var(--btn-bg-color);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.secondary {
  background-color: var(--btn-bg-color-secondary);
  color: var(--btn-color-secondary);
}

/* Контурная кнопка: белый фон и рамка (второстепенное действие) */
.button.outline {
  background-color: var(--bg-color);
  color: var(--color);
  border: 1px solid var(--btn-border-color-secondary);
}

.button:disabled {
  background-color: var(--btn-bg-color-disabled);
  color: var(--btn-color-disabled);
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 768px) {
  .buttons {
    flex-direction: column;
  }

  .button {
    box-sizing: border-box;
  }
}

/* Кнопка Сервис */

.button-service {
  padding: 10px 12px;
  background-color: black;
  border-radius: var(--border-radius-middle);
  color: white;
  font-weight: normal;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition-property: color, background;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

.button-service:hover {
  filter: brightness(1.1);
}

.button-service:active {
  filter: brightness(0.9);
}

/* Кнопка Опция */

.button-option {
  padding: 6px 10px;
  background-color: var(--bg-color-surface);
  border-radius: var(--border-radius-small);
  border-style: solid;
  border-color: var(--border-color);
  border-width: 1px;
  font-size: 0.9rem;
  color: var(--color);
  text-decoration: none;
  transition-property: color, background;
  transition-duration: 0.2s;
  transition-timing-function: ease;
  cursor: pointer;
}

.button-option:hover:not(.disabled) {
  border-color: var(--color-accent);
}

.button-option.active,
.button-option:has(input:checked) {
  border-color: var(--color-accent);
  outline-color: var(--color-accent);
  outline-style: solid;
  outline-width: 2px;
  cursor: default;
  pointer-events: none;
}

/* Число */

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
