/* ============================================================
   Сегмент — современная главная (превью-макет)
   Бренд сохранён: зелёная айдентика + бирюзовый логотип.
   Чистый CSS, без зависимостей. Адаптив: 1100 / 760 / 520.
   ============================================================ */

:root {
    /* Фирменная зелёная палитра (освежённая версия старого сайта) */
    --green-50:  #f1f7ec;
    --green-100: #e2efd7;
    --green-300: #a9d488;
    --green-500: #6fae45;   /* основной */
    --green-600: #5d9a39;
    --green-700: #4a7c2e;   /* hover / active */
    --green-800: #3a6224;

    --teal:      #18a5c6;   /* логотип «Сегмент» */
    --teal-dark: #0f7e99;

    --ink:       #23282d;   /* тёмная плашка «Категории», заголовки */
    --ink-soft:  #3a4046;
    --text:      #2c3138;
    --muted:     #71787f;
    --line:      #e6e9e6;

    --bg:        #eef1ee;
    --card:      #ffffff;

    --radius:    14px;
    --radius-sm: 10px;
    --shadow-1:  0 1px 2px rgba(20, 30, 15, .05), 0 2px 8px rgba(20, 30, 15, .05);
    --shadow-2:  0 8px 24px rgba(20, 40, 10, .12);
    --ring:      0 0 0 3px rgba(111, 174, 69, .35);

    --container: 1200px;
    --gap:       24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ---------- Верхняя утилитарная полоса ---------- */
.topbar {
    background: var(--ink);
    color: #c9d0c5;
    font-size: 13.5px;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
}
.topbar a { color: #e7ece2; }
.topbar a:hover { color: #fff; }
.topbar__left { display: flex; gap: 22px; }
.topbar__item { display: inline-flex; align-items: center; gap: 7px; }
.topbar__item svg { width: 15px; height: 15px; opacity: .8; }
@media (max-width: 760px) { .topbar__left { gap: 14px; } .topbar__city { display: none; } }

/* ---------- Шапка ---------- */
.header {
    background: linear-gradient(180deg, #fff 0%, #fbfdfa 100%);
    border-bottom: 1px solid var(--line);
}
.header .container {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-top: 18px;
    padding-bottom: 18px;
}

/* Логотип «Сегмент» (картинка assets/images/logo.gif) */
.logo { display: inline-flex; align-items: center; }
.logo__img { height: 56px; width: auto; display: block; }
/* В подвале (тёмный фон) — на белой подложке, чтобы логотип читался */
.logo--footer { background: #fff; padding: 9px 13px; border-radius: 12px; }
.logo--footer img { height: 46px; width: auto; display: block; }

.header__tagline {
    margin-left: 6px;
    color: var(--muted);
    font-size: 14px;
    border-left: 2px solid var(--line);
    padding-left: 22px;
}
.header__tagline b { color: var(--text); font-weight: 600; }

.header__cta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.header__phone { text-align: right; }
.header__phone .num { font-size: 19px; font-weight: 700; color: var(--text); white-space: nowrap; }
.header__phone .lbl { font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) { .header__tagline { display: none; } }
@media (max-width: 760px)  {
    .header .container { gap: 14px; }
    .header__phone .lbl { display: none; }
    .logo__img { height: 44px; }
}

/* ---------- Навигация ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(180deg, var(--green-500), var(--green-600));
    box-shadow: 0 2px 10px rgba(74, 124, 46, .25);
}
.nav .container { display: flex; align-items: center; gap: 6px; }
.nav__menu { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav__menu a {
    display: block;
    color: #f3faec;
    font-weight: 600;
    font-size: 15px;
    padding: 15px 20px;
    transition: background .18s ease, color .18s ease;
}
.nav__menu a:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav__menu a.is-active { background: var(--green-700); color: #fff; }

/* Бургер (моб.) */
.nav__burger {
    display: none;
    margin-left: auto;
    background: transparent; border: 0; cursor: pointer;
    padding: 12px; color: #fff;
}
.nav__burger svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
    .nav__burger { display: block; }
    .nav__menu {
        order: 4; width: 100%; flex-direction: column; gap: 0;
        max-height: 0; overflow: hidden; transition: max-height .25s ease;
    }
    .nav.is-open .nav__menu { max-height: 420px; padding-bottom: 8px; }
    .nav__menu a { padding: 13px 6px; border-top: 1px solid rgba(255,255,255,.12); }
}

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1100px 320px at 80% -40%, rgba(255,255,255,.18), transparent),
        linear-gradient(135deg, var(--green-600) 0%, var(--green-800) 100%);
    color: #fff;
    padding: 46px 0 40px;
}
.hero h1 { margin: 0 0 10px; font-size: 34px; font-weight: 800; letter-spacing: -.3px; }
.hero p { margin: 0 0 22px; font-size: 17px; color: #e9f3df; max-width: 620px; }
.hero__search {
    display: flex; gap: 10px; max-width: 620px;
    background: #fff; padding: 8px; border-radius: 14px; box-shadow: var(--shadow-2);
}
.hero__search input {
    flex: 1; border: 0; outline: none; background: transparent;
    padding: 12px 14px; font-size: 16px; color: var(--text);
}
.hero__search button {
    border: 0; cursor: pointer; border-radius: 10px;
    background: var(--green-600); color: #fff; font-weight: 700;
    padding: 0 26px; font-size: 15px; transition: background .18s ease;
}
.hero__search button:hover { background: var(--green-700); }
@media (max-width: 760px) { .hero h1 { font-size: 26px; } .hero { padding: 34px 0 30px; } }

/* ---------- Основной макет: контент + сайдбар ---------- */
.layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--gap);
    margin: 36px auto;
    align-items: start;
}
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 0 0 20px;
}
.section-head h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--ink); }
.section-head .hint { color: var(--muted); font-size: 14px; }

/* Сетка категорий */
.cats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 1000px) { .cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .cats { grid-template-columns: 1fr; } }

.cat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
    border-color: var(--green-300);
}
.cat__media {
    aspect-ratio: 4 / 3;
    background: #f6f8f5;
    display: grid; place-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.cat__media img {
    max-height: 100%; width: auto; object-fit: contain;
    transition: transform .25s ease;
    mix-blend-mode: multiply;
}
.cat:hover .cat__media img { transform: scale(1.06); }
.cat__body {
    padding: 14px 16px 16px;
    display: flex; flex-direction: column; gap: 8px;
    flex: 1;
}
.cat__name {
    font-weight: 700; font-size: 15px; color: var(--text);
    line-height: 1.3; transition: color .15s ease;
}
.cat:hover .cat__name { color: var(--green-700); }
.cat__meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.cat__count {
    font-size: 12.5px; color: var(--muted);
    background: var(--green-50); color: var(--green-700);
    padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.cat__arrow { color: var(--green-500); opacity: 0; transform: translateX(-4px); transition: .18s ease; }
.cat:hover .cat__arrow { opacity: 1; transform: translateX(0); }
.cat__arrow svg { width: 18px; height: 18px; }

/* ---------- Сайдбар ---------- */
.aside {top: 60px; align-self: start; display: flex; flex-direction: column; gap: var(--gap); }
.panel {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1);
}
.panel__head {
    background: var(--ink); color: #fff;
    padding: 14px 18px; font-weight: 700; font-size: 16px;
    display: flex; align-items: center; gap: 10px;
}
.panel__head svg { width: 18px; height: 18px; }
/* Список без прокрутки — показываем все категории целиком */
.catlist { list-style: none; margin: 0; padding: 6px; }
.catlist a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 14.5px; color: var(--text);
    transition: background .15s ease, color .15s ease, padding-left .15s ease;
}
.catlist a:hover { background: var(--green-50); color: var(--green-700); padding-left: 16px; }
.catlist .n { color: var(--muted); font-size: 12px; }
.catlist a:hover .n { color: var(--green-600); }

@media (max-width: 1000px) {
    .aside { position: static; }
}

/* ---------- Подвал ---------- */
.footer { background: var(--ink); color: #aeb6ab; margin-top: 10px; }
.footer .container {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px;
    padding-top: 44px; padding-bottom: 30px;
}
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer a { color: #c7cec1; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.footer ul li { display: flex; align-items: center; gap: 9px; }
.footer ul li svg { width: 17px; height: 17px; flex: none; color: var(--green-300); }
.footer__about p { font-size: 14px; line-height: 1.6; margin: 12px 0 0; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer__bottom .container {
    display: flex; justify-content: space-between; padding: 16px 20px; font-size: 13px;
    grid-template-columns: none;
}
@media (max-width: 760px) {
    .footer .container { grid-template-columns: 1fr; gap: 22px; }
    .footer__bottom .container { flex-direction: column; gap: 8px; }
}

/* ============================================================
   Страницы каталога (категория / индекс) — в стиле главной
   ============================================================ */
.catalog-main { min-width: 0; }   /* не даём широкой таблице растягивать grid-колонку */
.page-title { margin: 8px 0 18px; font-size: 26px; font-weight: 800; color: var(--ink); }

/* Хлебные крошки */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; margin: 14px 0 14px; }
.breadcrumbs .crumb { color: var(--green-700); }
.breadcrumbs .crumb:hover { color: var(--green-800); text-decoration: underline; }
.breadcrumbs .crumb-active { color: var(--muted); }
.breadcrumbs .crumb-sep { color: #c2c8be; }

/* Шапка раздела (на всю ширину): заголовок слева, поиск справа */
.catalog-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 14px 24px; margin: 6px 0 0;
}
.catalog-head .page-title { margin: 0; }
.page-count { color: var(--muted); font-weight: 600; font-size: 0.6em; white-space: nowrap; vertical-align: 2px; }
/* колонки каталога — компактный отступ от шапки (вместо 36px у обычного .layout) */
.catalog-layout { margin-top: 18px; }

/* Поиск */
.catalog-search {
    flex: 0 1 460px;
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 8px; box-shadow: var(--shadow-1);
}
.catalog-search input[type="text"] {
    flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; font: inherit; font-size: 15px; color: var(--text); outline: none;
}
.catalog-search input[type="text"]:focus { border-color: var(--green-300); box-shadow: var(--ring); }
.catalog-search button {
    border: 0; cursor: pointer; border-radius: 10px; background: var(--green-600); color: #fff;
    font-weight: 700; padding: 10px 22px; font-size: 15px; white-space: nowrap; transition: background .18s ease;
}
.catalog-search button:hover { background: var(--green-700); }
@media (max-width: 760px) { .catalog-search { flex-basis: 100%; } }

/* Подвал таблицы: счётчик слева, пагинация справа */
.catalog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.catalog-total { color: var(--muted); font-size: 14px; margin: 0; }
.catalog-total b { color: var(--text); font-weight: 700; }

/* Таблица */
.catalog-table-wrap {
    overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow-1);
}
.catalog-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.catalog-table thead th {
    background: var(--ink); color: #fff; font-weight: 600; text-align: center;
    padding: 12px; white-space: nowrap;
}
.catalog-table thead th:first-child { text-align: left; }
.catalog-table thead th a { color: #fff; }
.catalog-table thead th a:hover { color: var(--green-300); }
.catalog-table tbody td { padding: 10px 12px; border-top: 1px solid var(--line); }
.catalog-table tbody tr:nth-child(even) { background: #fafbf9; }
.catalog-table tbody tr:hover { background: var(--green-50); }
.catalog-table .c-center { text-align: center; }
.catalog-table .c-type { font-weight: 600; color: var(--text); }
.catalog-table .c-stock { color: var(--green-700); font-weight: 700; }
.catalog-empty { padding: 28px; text-align: center; color: var(--muted); }

/* Пагинация (pdoPage) */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.pagination li { list-style: none; }
.pagination a, .pagination span {
    display: inline-block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--text); font-size: 14px;
}
.pagination a:hover { border-color: var(--green-300); color: var(--green-700); text-decoration: none; }
.pagination .active span, .pagination .active a { background: var(--green-600); color: #fff; border-color: var(--green-600); }
