/* ============================================================
   Компоненты FSA-VIK. Все значения берутся из tokens.css.
   Порядок: раскладка -> шапка -> навигация -> карточки/сетки
            -> страница товара -> формы -> служебные блоки -> подвал
   ============================================================ */

/* ============================================================
   1. Раскладка
   ============================================================ */

.container {
   width: min(var(--container), 100%);
   margin-inline: auto;
   padding-inline: var(--gutter);
}

/* Часть шаблонов вкладывает .container в .container — второй раз отступы не нужны */
.container .container {
   width: 100%;
   padding-inline: 0;
}

.mt { margin-top: var(--section-y); }
.pt { padding-top: var(--section-y); }
.pb { padding-bottom: var(--section-y); }

/* Чередование фона у секций на главной */
.section-products:nth-child(2n+1) {
   background-color: var(--bg-soft);
}

.box-space {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: var(--sp-6);
   height: 100%;
}

/* Пережиток вёрстки таблицами — оставлен, чтобы не ломать разметку */
.table-cell {
   display: block;
}

/* ============================================================
   2. Шапка
   ============================================================ */

/* Липнет весь <header> со сдвигом на высоту верхней плашки: плашка с «О нас /
   Контакты» уезжает вверх при прокрутке, а основная полоса остаётся на месте.
   Вешать sticky на саму .menu-bottom нельзя — липкий элемент не может выйти
   за пределы родителя, и полоса уезжала бы вместе с <header>. */
header {
   position: sticky;
   top: calc(-1 * var(--menu-top-h));
   z-index: 100;
}

.menu-top {
   display: flex;
   align-items: center;
   justify-content: center;
   height: var(--menu-top-h);
   background-color: var(--brand-900);
   color: #EDE7F6;
   font-size: var(--fs-sm);
}

.box-info-top {
   height: var(--menu-top-h);
}

.menu-info {
   display: flex;
   align-items: center;
   gap: var(--sp-6);
}

.menu-info a,
.box-phone a {
   font-size: var(--fs-sm);
   color: #EDE7F6;
   white-space: nowrap;
}

.menu-info a:hover,
.box-phone a:hover {
   color: #fff;
}

.box-phone a {
   font-weight: 600;
}

/* --- Основная полоса: логотип, поиск, действия --- */
.menu-bottom {
   display: flex;
   align-items: center;
   justify-content: center;
   min-height: var(--header-h);
   background-color: var(--brand-500);
   color: #fff;
}

.box-menu-top {
   gap: var(--sp-6);
   padding-block: var(--sp-3);
}

.box-menu-left a {
   display: flex;
   flex-direction: column;
   justify-content: center;
   font-size: 24px;
   font-weight: 700;
   letter-spacing: .5px;
   line-height: 1.1;
   white-space: nowrap;
}

.box-menu-left a span {
   font-size: 13px;
   font-weight: 500;
   letter-spacing: .5px;
   opacity: .85;
}

/* --- Поиск --- */
.search-box {
   flex: 1 1 auto;
   min-width: 0;
   margin: 0;
}

.search-box form {
   display: flex;
   position: relative;
}

.search-width {
   width: 100%;
   padding: 11px 108px 11px 16px;
   background-color: rgba(255, 255, 255, .14);
   border: 1px solid rgba(255, 255, 255, .22);
   border-radius: var(--r-md);
   color: #fff;
}

.search-width::placeholder {
   color: rgba(255, 255, 255, .7);
}

.search-width:hover {
   border-color: rgba(255, 255, 255, .4);
}

.search-width:focus {
   background-color: rgba(255, 255, 255, .2);
   border-color: #fff;
   box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.search-box form button {
   position: absolute;
   top: 4px;
   right: 4px;
   bottom: 4px;
   padding-inline: var(--sp-5);
   background-color: #fff;
   color: var(--brand-600);
   border-radius: var(--r-sm);
   font-size: var(--fs-sm);
   font-weight: 600;
   transition: background-color var(--t-fast), color var(--t-fast);
}

.search-box form button:hover {
   background-color: var(--brand-50);
}

/* --- Кнопки действий (вход / выход / админ) --- */
.main-buttons-box {
   display: flex;
   align-items: center;
   gap: var(--sp-2);
}

.main-btn {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 2px;
   min-width: 68px;
   padding: var(--sp-2) var(--sp-3);
   border-radius: var(--r-md);
   white-space: nowrap;
   transition: background-color var(--t-fast);
}

.main-btn:hover {
   background-color: rgba(255, 255, 255, .16);
}

.main-btn span {
   font-size: var(--fs-xs);
   font-weight: 500;
}

.main-btn svg {
   width: 20px;
   height: 20px;
}

/* --- Телефон и бургер: на десктопе скрыты --- */
.header-actions {
   display: none;
   align-items: center;
   gap: var(--sp-2);
}

.header-phone {
   display: inline-flex;
   align-items: center;
   gap: var(--sp-2);
   height: 40px;
   padding-inline: var(--sp-3);
   border: 1px solid rgba(255, 255, 255, .3);
   border-radius: var(--r-pill);
   color: #fff;
   font-size: var(--fs-sm);
   font-weight: 600;
   white-space: nowrap;
   transition: background-color var(--t-fast), border-color var(--t-fast);
}

.header-phone:hover {
   background-color: rgba(255, 255, 255, .16);
   border-color: rgba(255, 255, 255, .5);
   color: #fff;
}

.header-phone svg {
   width: 16px;
   height: 16px;
   flex: none;
   fill: currentColor;
}

.nav-toggle {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   flex: none;
   border-radius: var(--r-md);
   color: #fff;
   transition: background-color var(--t-fast);
}

.nav-toggle:hover {
   background-color: rgba(255, 255, 255, .16);
}

.nav-toggle svg {
   width: 24px;
   height: 24px;
   fill: currentColor;
}

/* Выдвижная панель — наполняется теми же ссылками, что и .extra-menu */
.mobile-nav {
   display: none;
   position: fixed;
   inset: 0;
   z-index: 120;
   background: rgba(23, 19, 31, .45);
}

.nav-open .mobile-nav {
   display: block;
}

.mobile-nav__panel {
   position: absolute;
   inset-block: 0;
   right: 0;
   width: min(360px, 88vw);
   display: flex;
   flex-direction: column;
   gap: var(--sp-1);
   padding: var(--sp-5) var(--sp-5) var(--sp-10);
   background: var(--bg);
   box-shadow: var(--sh-4);
   overflow-y: auto;
}

/* Шапка панели: кнопка закрытия в правом верхнем углу, с теми же
   боковыми отступами, что и пункты меню */
.mobile-nav__head {
   display: flex;
   justify-content: flex-end;
   margin-bottom: var(--sp-2);
}

.mobile-nav__close {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   border-radius: var(--r-md);
   background: var(--bg-soft);
   border: 1px solid var(--line);
   color: var(--ink-2);
   transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.mobile-nav__close:hover {
   background: var(--brand-50);
   border-color: var(--brand-200);
   color: var(--brand-700);
}

.mobile-nav__close svg {
   width: 18px;
   height: 18px;
   fill: currentColor;
}

.mobile-nav__title {
   margin: var(--sp-4) 0 var(--sp-1);
   color: var(--muted);
   font-size: var(--fs-xs);
   font-weight: 700;
   letter-spacing: .08em;
   text-transform: uppercase;
}

.mobile-nav__panel a {
   display: flex;
   align-items: center;
   gap: var(--sp-3);
   padding: var(--sp-3) var(--sp-3);
   border-radius: var(--r-md);
   color: var(--ink);
   font-size: var(--fs-body);
   font-weight: 500;
   transition: background-color var(--t-fast), color var(--t-fast);
}

.mobile-nav__panel a:hover {
   background: var(--brand-50);
   color: var(--brand-600);
}

.mobile-nav__panel a svg {
   width: 20px;
   height: 20px;
   flex: none;
   fill: var(--muted);
}

.mobile-nav__panel a:hover svg {
   fill: var(--brand-600);
}

.mobile-nav__panel .btn {
   justify-content: center;
   margin-top: var(--sp-3);
   color: #fff;
}

.mobile-nav__panel .btn:hover {
   color: #fff;
}

/* Когда меню открыто — фон не скроллится */
body.nav-open {
   overflow: hidden;
}

/* ============================================================
   3. Навигация под шапкой
   ============================================================ */

.main-sec {
   padding-top: var(--sp-4);
}

.extra-menu {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: var(--sp-2);
   margin: 0 0 var(--sp-8);
   padding-bottom: var(--sp-4);
   border-bottom: 1px solid var(--line-2);
}

.extra-menu a {
   display: inline-flex;
   align-items: center;
   gap: var(--sp-2);
   padding: var(--sp-2) var(--sp-4);
   border-radius: var(--r-pill);
   background: var(--bg-soft);
   border: 1px solid var(--line);
   color: var(--ink-2);
   font-size: var(--fs-sm);
   font-weight: 500;
   white-space: nowrap;
   transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.extra-menu a:hover {
   background: var(--brand-50);
   border-color: var(--brand-200);
   color: var(--brand-700);
}

.extra-menu a svg {
   width: 16px;
   height: 16px;
   fill: var(--muted);
   transition: fill var(--t-fast);
}

.extra-menu a:hover svg {
   fill: var(--brand-600);
}

/* --- Хлебные крошки --- */
.breadcrumb-box {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: var(--sp-1) 0;
   margin: 0 0 var(--sp-6);
   padding: 0;
   font-size: var(--fs-sm);
}

.breadcrumb-box a {
   color: var(--muted);
   font-size: var(--fs-sm);
   border-bottom: 1px solid transparent;
   transition: color var(--t-fast), border-color var(--t-fast);
}

.breadcrumb-box a:hover {
   color: var(--brand-600);
   border-bottom-color: var(--brand-300);
}

.breadcrumb-box span {
   color: var(--ink);
   font-size: var(--fs-sm);
   font-weight: 500;
}

/* Разделитель — символ, а не картинка: не тянет лишний запрос и наследует цвет */
.breadcrumb-box div::after {
   content: '/';
   margin: 0 var(--sp-2);
   color: var(--muted-2);
}

.product-bc {
   margin-bottom: var(--sp-6);
}

/* ============================================================
   4. Кнопки и ссылки-действия
   ============================================================ */

.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: var(--sp-2);
   width: fit-content;
   min-height: 48px;
   padding: 12px var(--sp-6);
   background: linear-gradient(96deg, var(--accent) 0%, var(--brand-500) 100%);
   box-shadow: var(--sh-brand);
   border: none;
   border-radius: var(--r-pill);
   color: #fff;
   font-size: var(--fs-body);
   font-weight: 600;
   line-height: 1;
   cursor: pointer;
   transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}

.btn:hover {
   filter: brightness(1.06);
   box-shadow: 0 8px 22px rgba(132, 54, 232, .34);
}

.btn:active {
   transform: translateY(1px);
   box-shadow: var(--sh-1);
}

.btn--block {
   width: 100%;
}

.btn--ghost {
   background: var(--bg);
   border: 1px solid var(--line);
   box-shadow: none;
   color: var(--ink);
}

.btn--ghost:hover {
   background: var(--brand-50);
   border-color: var(--brand-200);
   color: var(--brand-700);
   filter: none;
   box-shadow: none;
}

input[type="submit"] {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-height: 48px;
   padding: 12px var(--sp-6);
   background: linear-gradient(96deg, var(--accent) 0%, var(--brand-500) 100%);
   box-shadow: var(--sh-brand);
   border: none;
   border-radius: var(--r-pill);
   color: #fff;
   font-size: var(--fs-body);
   font-weight: 600;
   cursor: pointer;
   transition: filter var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

input[type="submit"]:hover {
   filter: brightness(1.06);
   box-shadow: 0 8px 22px rgba(132, 54, 232, .34);
}

input[type="submit"]:active {
   transform: translateY(1px);
}

/* Текстовая ссылка-действие («Показать все товары», «Редактировать») */
.main-product-title a,
.title-product a {
   display: inline-flex;
   align-items: center;
   gap: var(--sp-2);
   height: fit-content;
   padding-bottom: 2px;
   border-bottom: 1px solid var(--brand-300);
   color: var(--brand-600);
   font-size: var(--fs-body);
   font-weight: 600;
   white-space: nowrap;
   transition: color var(--t-fast), border-color var(--t-fast);
}

.main-product-title a:hover,
.title-product a:hover {
   color: var(--brand-700);
   border-bottom-color: var(--brand-600);
}

/* ============================================================
   5. Заголовки секций и сетка карточек
   ============================================================ */

.main-product-title {
   display: flex;
   justify-content: space-between;
   align-items: flex-end;
   gap: var(--sp-6);
   margin-bottom: var(--sp-8);
   padding: 0;
}

.main-product-title div {
   display: flex;
   flex-direction: column;
   gap: var(--sp-3);
   width: auto;
   max-width: 72ch;
}

.main-product-title div p {
   color: var(--muted);
   font-size: var(--fs-sm);
   line-height: var(--lh-body);
}

.category-product-title {
   display: flex;
   flex-direction: column;
   margin-bottom: var(--sp-6);
   padding: 0;
}

.category-p-t-box {
   display: flex;
   flex-direction: column;
   gap: var(--sp-3);
   max-width: 80ch;
}

.category-p-t-box p {
   color: var(--muted);
   font-size: var(--fs-sm);
}

.title-category {
   margin: 0 0 var(--sp-6);
   padding: 0;
}

/* --- Сетка: колонки подстраиваются сами, карточки одной высоты --- */
.main-product-row {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
   gap: var(--sp-5);
   padding: 0;
}

.p-row-one {
   display: flex;
   flex-direction: column;
   width: auto;
   padding: var(--sp-3);
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: var(--r-lg);
   overflow: hidden;
   transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.p-row-one:hover {
   border-color: var(--brand-200);
   box-shadow: var(--sh-3);
   transform: translateY(-2px);
   backdrop-filter: none;
}

.main-p-img-box {
   position: relative;
   overflow: hidden;
   border-radius: var(--r-md);
   background: var(--bg-soft);
   /* Фиксированная пропорция: карточки не «прыгают» при загрузке картинок */
   aspect-ratio: 1 / 1;
}

.p-row-one img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   transition: transform var(--t-slow);
}

.p-row-one:hover img {
   transform: scale(1.04);
}

.p-row-title-box {
   display: flex;
   flex: 1 1 auto;
   align-items: flex-start;
   padding: var(--sp-4) var(--sp-1) var(--sp-1);
}

.p-row-title-box span {
   color: var(--ink);
   font-size: var(--fs-sm);
   font-weight: 500;
   line-height: 1.45;
   /* Названия в каталоге разной длины — обрезаем до 3 строк, чтобы сетка была ровной */
   display: -webkit-box;
   -webkit-line-clamp: 3;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

.p-row-one:hover .p-row-title-box span {
   color: var(--brand-700);
}

/* ============================================================
   6. Сортировка и постраничная навигация
   ============================================================ */

.sort-box {
   display: flex;
   flex-wrap: wrap;
   gap: var(--sp-2);
   margin-bottom: var(--sp-6);
   padding: 0;
}

.sort-box a {
   padding: var(--sp-2) var(--sp-4);
   background-color: var(--bg-soft);
   border: 1px solid var(--line);
   border-radius: var(--r-pill);
   color: var(--ink-2);
   font-size: var(--fs-sm);
   font-weight: 500;
   transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.sort-box a:hover {
   background-color: var(--brand-50);
   border-color: var(--brand-200);
   color: var(--brand-700);
}

/* Активная сортировка видна сразу, без догадок */
.sort-box a.is-active {
   background-color: var(--brand-500);
   border-color: var(--brand-500);
   color: #fff;
   cursor: default;
}

.pagination-category {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: center;
   gap: var(--sp-2);
   margin-top: var(--sp-10);
   padding: 0;
}

.pg-one {
   display: flex;
   align-items: center;
   justify-content: center;
   min-width: 44px;
   height: 44px;
   padding-inline: var(--sp-2);
   border: 1px solid transparent;
   border-radius: var(--r-md);
   color: var(--ink-2);
   font-size: var(--fs-sm);
   font-weight: 600;
   cursor: pointer;
   transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.pg-one:hover {
   background-color: var(--brand-50);
   border-color: var(--brand-200);
   color: var(--brand-700);
}

.pg-active,
.pg-active:hover {
   background: var(--brand-500);
   border-color: var(--brand-500);
   box-shadow: var(--sh-brand);
   color: #fff;
   cursor: default;
}

/* Стрелки «назад / вперёд» */
.pg-nav {
   gap: var(--sp-2);
   padding-inline: var(--sp-4);
   border-color: var(--line);
}

.pg-nav svg {
   width: 14px;
   height: 14px;
   fill: currentColor;
}

/* Многоточие между далёкими страницами */
.pg-gap {
   display: flex;
   align-items: flex-end;
   justify-content: center;
   min-width: 24px;
   height: 44px;
   color: var(--muted-2);
   user-select: none;
}

/* ============================================================
   7. Страница товара
   ============================================================ */

.product {
   border-top: none;
}

.box-product {
   display: flex;
   flex-direction: column;
}

.title-product {
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
   gap: var(--sp-6);
   margin: 0 0 var(--sp-8);
}

.title-product h1 {
   max-width: 46ch;
}

.product-top {
   display: grid;
   grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
   gap: var(--sp-10);
   align-items: start;
}

/* --- Галерея --- */
.product-images {
   width: auto;
   position: sticky;
   top: calc(var(--header-h) + var(--sp-5));
}

.product-images .main-img {
   width: 100%;
   aspect-ratio: 1 / 1;
   object-fit: contain;
   background: var(--bg-soft);
   border: 1px solid var(--line);
   border-radius: var(--r-lg);
}

.product-images .box-img {
   position: relative;
   margin-top: var(--sp-3);
}

.product-images .container-img {
   display: flex;
   flex-direction: row;
   gap: var(--sp-2);
   position: relative;
   right: 0;
}

.img-ov-h {
   overflow: hidden;
}

.product-images .box-img .container-img .img-only {
   flex: 0 0 calc(25% - 6px);
}

.img-only img {
   width: 100%;
   aspect-ratio: 1 / 1;
   object-fit: contain;
   background: var(--bg-soft);
   border: 2px solid var(--line);
   border-radius: var(--r-md);
   cursor: pointer;
}

.image-activity {
   opacity: .7;
   transition: opacity var(--t-fast), border-color var(--t-fast);
}

.image-activity:hover {
   opacity: 1;
   border-color: var(--brand-200);
}

.imgActive img,
.imgActive img:hover {
   opacity: 1;
   border-color: var(--brand-500);
}

.img-scroll-btn-left,
.img-scroll-btn-right {
   position: absolute;
   top: calc(50% - 20px);
   z-index: 10;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 40px;
   height: 40px;
   background: var(--bg);
   border: 1px solid var(--line);
   border-radius: 50%;
   box-shadow: var(--sh-2);
   cursor: pointer;
   user-select: none;
   transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.img-scroll-btn-left  { left: -14px; }
.img-scroll-btn-right { right: -14px; }

.img-scroll-btn-left:hover,
.img-scroll-btn-right:hover {
   border-color: var(--brand-200);
   box-shadow: var(--sh-3);
}

.img-scroll-btn-left svg,
.img-scroll-btn-right svg {
   width: 14px;
   height: 14px;
   fill: var(--muted);
   transition: fill var(--t-fast);
}

.img-scroll-btn-left:hover svg,
.img-scroll-btn-right:hover svg {
   fill: var(--brand-600);
}

/* --- Описание и характеристики --- */
.product-info {
   width: auto;
   display: flex;
   flex-direction: column;
}

.product-info > * {
   margin-bottom: 0;
}

.T-info {
   display: block;
   margin-bottom: var(--sp-4);
   color: var(--ink);
   font-size: 18px;
   font-weight: 700;
}

.product-text {
   margin-bottom: var(--sp-8);
   color: var(--ink-2);
   line-height: var(--lh-body);
}

/* Характеристики — таблица «в полоску»: глаз не теряет строку */
.product-info-row {
   display: flex;
   justify-content: space-between;
   align-items: baseline;
   gap: var(--sp-4);
   padding: var(--sp-3) var(--sp-4);
   border: none;
   border-radius: var(--r-sm);
}

.product-info-row:nth-child(odd) {
   background: var(--bg-soft);
}

.mini-info {
   flex: 0 0 auto;
   color: var(--muted);
   font-size: var(--fs-sm);
}

.product-info-row p {
   color: var(--ink);
   font-size: var(--fs-sm);
   font-weight: 600;
   text-align: right;
}

/* ============================================================
   8. Формы: вход, регистрация, добавление товара/статьи
   ============================================================ */

/* Узкая колонка по центру — привычный вид для входа/регистрации */
.auth-wrap {
   display: flex;
   justify-content: center;
   padding-block: var(--section-y);
}

.auth-card {
   width: 100%;
   max-width: 440px;
   padding: clamp(24px, 4vw, 40px);
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: var(--r-xl);
   box-shadow: var(--sh-2);
}

.auth-card h1 {
   margin-bottom: var(--sp-2);
   text-align: center;
}

.auth-card__sub {
   margin-bottom: var(--sp-8);
   color: var(--muted);
   font-size: var(--fs-sm);
   text-align: center;
}

.auth-card form {
   display: flex;
   flex-direction: column;
   gap: var(--sp-5);
}

.auth-card input[type="submit"] {
   width: 100%;
   margin-top: var(--sp-1);
}

.auth-card__foot {
   margin-top: var(--sp-6);
   padding-top: var(--sp-5);
   border-top: 1px solid var(--line-2);
   color: var(--muted);
   font-size: var(--fs-sm);
   text-align: center;
}

.auth-card__foot a {
   color: var(--brand-600);
   font-weight: 600;
   border-bottom: 1px solid var(--brand-200);
}

.auth-card__foot a:hover {
   color: var(--brand-700);
   border-bottom-color: var(--brand-600);
}

/* Одно поле формы: подпись сверху, поле снизу */
.form-field {
   display: flex;
   flex-direction: column;
}

.form-field label {
   margin-bottom: var(--sp-2);
}

.form-hint {
   margin-top: var(--sp-2);
   color: var(--muted);
   font-size: var(--fs-xs);
}

/* Формы админки */
.blog-add form {
   display: flex;
   flex-direction: column;
   gap: var(--sp-5);
   max-width: 720px;
   margin-top: var(--sp-6);
}

.blog-add h1 {
   margin: 0;
}

.blog-add input,
.blog-add textarea,
.blog-add select {
   width: 100%;
   margin: 0;
}

.blog-add label {
   margin: 0 0 var(--sp-2);
}

.blog-add input[type="submit"] {
   width: fit-content;
}

.subcategoryBox {
   display: flex;
   flex-direction: column;
}

/* ============================================================
   9. Служебные блоки: сообщения, пустые состояния, ошибки
   ============================================================ */

.alert {
   display: flex;
   align-items: flex-start;
   gap: var(--sp-3);
   margin-bottom: var(--sp-5);
   padding: var(--sp-4);
   border: 1px solid transparent;
   border-radius: var(--r-md);
   font-size: var(--fs-sm);
   line-height: 1.5;
}

.alert svg {
   flex: none;
   width: 18px;
   height: 18px;
   margin-top: 1px;
   fill: currentColor;
}

.alert--error {
   background: var(--danger-bg);
   border-color: var(--danger-line);
   color: var(--danger);
}

.alert--success {
   background: var(--success-bg);
   border-color: var(--success-line);
   color: var(--success);
}

/* Раньше это был фиолетовый баннер во всю ширину — заменён на спокойное пустое состояние */
.container-error {
   grid-column: 1 / -1;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: var(--sp-3);
   margin: 0;
   padding: var(--sp-12) var(--sp-6);
   background: var(--bg-soft);
   border: 1px dashed var(--line);
   border-radius: var(--r-lg);
   color: var(--muted);
   font-size: var(--fs-body);
   font-weight: 500;
   text-align: center;
}

.empty-state {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: var(--sp-4);
   padding-block: clamp(48px, 8vw, 96px);
   text-align: center;
}

.empty-state h1 {
   max-width: 24ch;
}

.empty-state p {
   max-width: 52ch;
   color: var(--muted);
}

.empty-state__code {
   color: var(--brand-200);
   font-size: clamp(64px, 12vw, 128px);
   font-weight: 800;
   line-height: 1;
   letter-spacing: -.04em;
}

.empty-state__actions {
   display: flex;
   flex-wrap: wrap;
   gap: var(--sp-3);
   justify-content: center;
   margin-top: var(--sp-2);
}

/* ============================================================
   10. Главная: слайдер, блок компаний
   ============================================================ */

.itc-slider__items {
   counter-reset: slide;
}

.itc-slider__items img {
   width: 100%;
   height: auto;
   border-radius: var(--r-lg);
   vertical-align: middle;
}

.itc-slider__item {
   flex: 0 0 100%;
   max-width: 100%;
   height: auto;
   position: relative;
   counter-increment: slide;
}

.company {
   position: relative;
   overflow: hidden;
   background-color: var(--brand-500);
   border-radius: 0;
}

.company .circle-one {
   position: absolute;
   left: 0;
   bottom: -120px;
   z-index: 4;
   pointer-events: none;
}

.company .circle-two {
   position: absolute;
   right: 0;
   top: -220px;
   z-index: 4;
   pointer-events: none;
}

.company .container {
   position: relative;
   z-index: 10;
   margin-block: var(--section-y);
}

.company .container h6 {
   margin-bottom: var(--sp-8);
   color: #fff;
   font-size: var(--fs-h3);
}

.box-company {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: var(--sp-5);
}

.box-company div {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: var(--sp-4);
   width: auto;
   padding: var(--sp-6);
   background: rgba(39, 10, 56, .35);
   backdrop-filter: blur(15px);
   border: 1px solid rgba(255, 255, 255, .12);
   border-radius: var(--r-xl);
   box-shadow: inset 0 -3px 2px rgba(0, 0, 0, .12), inset 0 3px 2px rgba(255, 255, 255, .12);
}

.box-company div img {
   width: 100%;
   max-width: 160px;
}

.box-company div span {
   padding-top: 0;
   color: #fff;
   font-size: var(--fs-sm);
   line-height: 1.45;
   text-align: center;
}

/* ============================================================
   11. Статьи, документы, контакты
   ============================================================ */

.section-conttext p {
   margin: var(--sp-6) 0;
}

.section-conttext p:last-child {
   margin-bottom: 0;
}

.section-conttext ul {
   padding-left: var(--sp-5);
   list-style-type: decimal;
}

.section-conttext ul li {
   margin: var(--sp-4) 0;
}

.blog-box .breadcrumb-box {
   padding: 0;
}

.articles-box,
.documents-box {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: var(--sp-6);
   width: 100%;
   margin-top: var(--sp-8);
}

.articles-box .article-cont,
.document-cont {
   display: flex;
   flex-direction: column;
   gap: var(--sp-3);
   width: auto;
   height: auto;
   padding: var(--sp-5);
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: var(--r-lg);
   transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.articles-box .article-cont:hover,
.document-cont:hover {
   border-color: var(--brand-200);
   box-shadow: var(--sh-3);
   transform: translateY(-2px);
}

/* Дата прижата к низу карточки — при разной длине текста подписи
   всё равно оказываются на одной линии */
.articles-box .article-cont span,
.document-cont span {
   margin-top: auto;
   padding-top: var(--sp-2);
   color: var(--muted);
   font-size: var(--fs-xs);
}

.article-cont p {
   margin: 0;
   color: var(--muted);
   font-size: var(--fs-sm);
}

.article-info {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   gap: var(--sp-3);
   margin-top: var(--sp-6);
   padding-top: var(--sp-4);
   border-top: 1px solid var(--line-2);
}

.article-info p {
   margin: 0;
   color: var(--muted);
   font-size: var(--fs-sm);
}

.title {
   margin: 0;
   color: var(--ink);
   font-size: var(--fs-h2);
   font-weight: 700;
}

.section-articles .title {
   font-size: var(--fs-h2);
}

.section-articles .main-product-title {
   padding: 0;
}

.title-a {
   margin: 0;
   color: var(--ink);
   font-size: 17px;
   font-weight: 700;
   line-height: 1.35;
   transition: color var(--t-fast);
}

.article-cont:hover .title-a,
.title-a:hover {
   color: var(--brand-700);
}

.ellipsis {
   color: var(--muted-2);
}

.document-image-box {
   width: 100%;
   margin: var(--sp-8) 0;
}

.document-image-box img {
   width: 100%;
   border-radius: var(--r-lg);
}

/* Колонки ограничены сверху: одна карточка не растягивается на всю ширину
   страницы, а несколько по-прежнему встают в ряд */
.contacts-container {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(280px, 480px));
   justify-content: start;
   gap: var(--sp-8);
   margin-top: var(--sp-6);
}

.w50 {
   width: auto;
   padding: var(--sp-6);
   background: var(--bg-soft);
   border: 1px solid var(--line);
   border-radius: var(--r-lg);
}

.w50 .contacts-title {
   margin: 0 0 var(--sp-4);
   color: var(--ink);
   font-weight: 700;
}

.contacts-box {
   display: flex;
   flex-direction: column;
   gap: var(--sp-3);
}

.contacts-box p {
   margin: 0;
   font-size: var(--fs-sm);
}

.contacts-box p a {
   color: var(--brand-600);
   font-size: var(--fs-sm);
   font-weight: 600;
   border-bottom: 1px solid var(--brand-200);
   transition: color var(--t-fast), border-color var(--t-fast);
}

.contacts-box p a:hover {
   color: var(--brand-700);
   border-bottom-color: var(--brand-600);
}

/* --- Админ: управление картинками --- */
.edit-images-box {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
   gap: var(--sp-4);
   width: 100%;
   margin: var(--sp-4) 0;
}

.edit-images-container {
   position: relative;
   width: auto;
   height: auto;
   overflow: hidden;
   border: 1px solid var(--line);
   border-radius: var(--r-md);
}

.edit-images-box img {
   width: 100%;
   aspect-ratio: 1 / 1;
   object-fit: contain;
   background: var(--bg-soft);
}

.img-delete {
   position: absolute;
   inset: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: background-color var(--t-fast);
}

.img-delete:hover {
   background-color: rgba(23, 19, 31, .5);
}

.img-delete svg {
   opacity: 0;
   transition: opacity var(--t-fast);
}

.img-delete:hover svg {
   opacity: 1;
}

/* ============================================================
   12. Подвал
   ============================================================ */

.footer-bm {
   width: 100%;
   display: flex;
   justify-content: center;
   background: radial-gradient(70% 120% at 20% 100%, var(--brand-500) 0%, #5D26A9 30%, #3D186D 65%, var(--brand-900) 100%);
   color: #fff;
}

.footer-bm .container {
   display: flex;
   flex-direction: column;
   padding-block: var(--sp-12);
}

.footer-bm hr {
   margin: var(--sp-8) 0;
   border-top: 1px solid rgba(255, 255, 255, .16);
}

.phone-f-box {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: var(--sp-6);
}

.phone-f-box div {
   display: flex;
   flex-direction: column;
   gap: var(--sp-1);
}

.phone-f-box div a,
.phone-f-box div span {
   color: #fff;
   font-size: 17px;
   font-weight: 600;
}

.phone-f-box div a:hover {
   color: var(--brand-200);
}

.phone-f-box div p {
   color: rgba(255, 255, 255, .6);
   font-size: var(--fs-xs);
}

.menu-f-box {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: var(--sp-6);
}

.menu-f-box div {
   display: flex;
   flex-direction: column;
   gap: var(--sp-3);
   width: auto;
}

.menu-f-box div a {
   color: rgba(255, 255, 255, .8);
   font-size: var(--fs-sm);
   letter-spacing: normal;
}

.menu-f-box div a:hover {
   color: #fff;
}

.footer-bm .box-menu-right {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: var(--sp-6);
}

.footer-bm .box-menu-right a {
   display: flex;
   align-items: center;
   gap: var(--sp-2);
   color: rgba(255, 255, 255, .85);
   font-size: var(--fs-sm);
}

.footer-bm .box-menu-right a:hover {
   color: #fff;
}

.footer-bm .box-menu-right a svg {
   width: 28px;
   height: 28px;
}

.footer-copyr {
   display: flex;
   flex-wrap: wrap;
   justify-content: space-between;
   gap: var(--sp-3) var(--sp-10);
   padding-top: var(--sp-8);
   color: rgba(255, 255, 255, .55);
   font-size: var(--fs-xs);
}
