/* ============================================================
   BigBoss — базовые стили
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #222;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    margin: 1.5rem 0 0.75rem;
    line-height: 1.2;
}

p {
    margin: 0 0 1rem;
}

/* ── Layout ─────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* ── Header ─────────────────────────────────────────────────── */

.site-header {
    background: #1a1a1a;
    color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #333;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-logo {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.site-logo:hover {
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: #fff;
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: #66b3ff;
    text-decoration: none;
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.lang-switcher a {
    color: #aaa;
    padding: 0.25rem 0.5rem;
    border: 1px solid #444;
    border-radius: 3px;
}

.lang-switcher a:hover {
    color: #fff;
    border-color: #fff;
    text-decoration: none;
}

.lang-switcher a.active {
    color: #fff;
    background: #444;
    border-color: #444;
}

/* ── Footer ─────────────────────────────────────────────────── */

.site-footer {
    background: #f4f4f4;
    border-top: 1px solid #ddd;
    padding: 2rem 0;
    color: #666;
    font-size: 0.9rem;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Карточки контента ──────────────────────────────────────── */

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0;
    list-style: none;
    margin: 1rem 0 2rem;
}

.card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f0f0f0;
}

.card__body {
    padding: 1rem 1.25rem;
}

.card__title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.card__title a {
    color: #222;
}

.card__meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.card__excerpt {
    color: #444;
    margin: 0;
    font-size: 0.9rem;
}

/* ── Breadcrumbs ────────────────────────────────────────────── */

.breadcrumbs {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

.breadcrumbs li::after {
    content: "/";
    color: #ccc;
    margin-left: 0.5rem;
}

.breadcrumbs li:last-child::after {
    display: none;
}

.breadcrumbs a {
    color: #888;
}

/* ── Контент Editor.js ──────────────────────────────────────── */

.content figure {
    margin: 1.5rem 0;
}

.content figure img {
    border-radius: 4px;
    margin: 0 auto;
}

.content figcaption {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    color: #555;
    margin: 1.5rem 0;
}

.content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.content th, .content td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.content th {
    background: #f9f9f9;
    font-weight: 600;
}

/* ── 404 ────────────────────────────────────────────────────── */

.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    margin: 0;
    color: #ccc;
}

.error-page p {
    font-size: 1.1rem;
    color: #666;
}

/* ── Адаптив ────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .site-nav {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

/* ── FAQ (раскрывающиеся вопросы) ───────────────────────────── */
.faq {
    margin: 2rem 0;
}
.faq > h2 {
    margin-bottom: 1rem;
}
.faq details {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: .75rem;
    overflow: hidden;
}
.faq summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    background: #f9f9f9;
    list-style: none;
    position: relative;
    padding-right: 3rem;
    user-select: none;
}
.faq summary::-webkit-details-marker {
    display: none;
}
.faq summary::after {
    content: "+";
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: #999;
}
.faq details[open] summary::after {
    content: "\2212";
}
.faq details[open] summary {
    border-bottom: 1px solid #e5e5e5;
}
.faq details p {
    padding: 1rem 1.25rem;
    margin: 0;
    color: #444;
    line-height: 1.6;
}

/* ── Меню сайта (renderMenu) ─────────────────────────────────── */
.site-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.site-menu > li { position: relative; }
.site-menu a {
    color: inherit;
    text-decoration: none;
    padding: .25rem 0;
    display: inline-block;
}
.site-menu a:hover { color: var(--accent, #2563eb); }

/* Подменю */
.site-menu__sub {
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: .5rem 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border-radius: .35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
    z-index: 100;
}
.site-menu__has-children:hover > .site-menu__sub {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.site-menu__sub li { padding: 0 1rem; }
.site-menu__sub a { padding: .35rem 0; }

/* Вложенное подменю — справа от родителя */
.site-menu__sub .site-menu__sub {
    top: 0;
    left: 100%;
    margin-left: 0;
}

@media (max-width: 768px) {
    .site-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
    .site-menu__sub {
        position: static;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none;
        padding: .25rem 0 .25rem 1rem;
        background: transparent;
    }
}

/* ── Блок "Об авторе" под статьёй ──────────────────────────── */
.author-card {
    display: flex;
    gap: 1.25rem;
    margin: 2.5rem 0 1.5rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
}
.author-card__avatar { flex-shrink: 0; }
.author-card__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.author-card__body { flex: 1; min-width: 0; }
.author-card__name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: .35rem;
    color: #1f2937;
}
.author-card__bio {
    color: #475569;
    line-height: 1.5;
    margin-bottom: .75rem;
    font-size: .95rem;
}
.author-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.author-card__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    transition: all .15s;
}
.author-card__social:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    transform: translateY(-1px);
}
.author-card__social svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 600px) {
    .author-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 1rem;
    }
    .author-card__links { justify-content: center; }
}

/* ── Связанные статьи ────────────────────────────────────────── */
.related-posts {
    margin: 2.5rem 0 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}
.related-posts__title {
    font-size: 1.35rem;
    margin: 0 0 1rem;
    color: #1f2937;
}
.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.related-posts__item {
    display: block;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.related-posts__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.related-posts__image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}
.related-posts__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-posts__name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    padding: .75rem 1rem 1rem;
    color: #1f2937;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .related-posts__grid { grid-template-columns: 1fr; }
}

/* ── Пагинация категорий ─────────────────────────────────────── */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0 1rem;
}
.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .65rem;
    border-radius: .35rem;
    text-decoration: none;
    color: #1f2937;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-weight: 500;
    transition: all .15s;
}
.pagination__link:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.pagination__link--active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    cursor: default;
}
.pagination__ellipsis {
    padding: 0 .35rem;
    color: #94a3b8;
}

/* ── TOC (Table of Contents) ─────────────────────────────────── */
.toc {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    border-radius: .35rem;
}
.toc__title {
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title::before {
    content: "▾";
    font-size: .8em;
    transition: transform .15s;
    color: #2563eb;
}
.toc:not([open]) > .toc__title::before {
    transform: rotate(-90deg);
}
.toc__list,
.toc__sublist {
    list-style: decimal;
    margin: .75rem 0 0;
    padding-left: 1.5rem;
}
.toc__sublist {
    list-style: lower-alpha;
    margin: .25rem 0 .25rem;
}
.toc__item {
    margin: .25rem 0;
    line-height: 1.4;
}
.toc__link {
    color: #1f2937;
    text-decoration: none;
}
.toc__link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Плавный скролл к якорю */
html { scroll-behavior: smooth; }

/* ── Кнопки шеринга ──────────────────────────────────────────── */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin: 1.5rem 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    padding: 0;
}
.share-btn svg { width: 20px; height: 20px; }
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.share-btn--telegram:hover { background: #229ED9; color: #fff; border-color: #229ED9; }
.share-btn--whatsapp:hover { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn--viber:hover    { background: #7360F2; color: #fff; border-color: #7360F2; }
.share-btn--twitter:hover  { background: #000;    color: #fff; border-color: #000; }
.share-btn--facebook:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn--vk:hover       { background: #0077FF; color: #fff; border-color: #0077FF; }
.share-btn--ok:hover       { background: #EE8208; color: #fff; border-color: #EE8208; }
.share-btn--copy:hover     { background: #2563eb; color: #fff; border-color: #2563eb; }
.share-btn--copy.copied    { background: #10b981; color: #fff; border-color: #10b981; }

/* ── Кнопка "Наверх" ─────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s, visibility .25s, background .15s;
    z-index: 200;
    padding: 0;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover { background: #1d4ed8; }
.back-to-top svg { width: 22px; height: 22px; }
/* ───────── ДОБАВИТЬ В ФРОНТОВЫЙ styles.css ─────────
   Товар: галерея, цена, характеристики, лайтбокс */
.product__top { display:flex; gap:2rem; flex-wrap:wrap; align-items:flex-start; }
.product-gallery { flex:1 1 360px; max-width:520px; }
.product__info  { flex:1 1 320px; }

.product-gallery__main img {
    width:100%; height:auto; border-radius:8px; cursor:zoom-in; background:#f5f5f5;
}
.product-gallery__thumbs { display:flex; gap:.5rem; margin-top:.6rem; flex-wrap:wrap; }
.product-gallery__thumb {
    width:72px; height:72px; padding:0; border:2px solid transparent;
    border-radius:6px; overflow:hidden; cursor:pointer; background:#f5f5f5;
}
.product-gallery__thumb.is-active { border-color:#2d7ef7; }
.product-gallery__thumb img { width:100%; height:100%; object-fit:cover; display:block; }

.product__price-row { display:flex; align-items:center; gap:1rem; margin:1rem 0; flex-wrap:wrap; }
.product__price { font-size:1.6rem; font-weight:700; }
.product__stock { font-size:.95rem; padding:.25rem .7rem; border-radius:999px; }
.product__stock--in  { background:#e6f6ec; color:#1a7f3c; }
.product__stock--out { background:#fdecec; color:#c0392b; }

.product__specs { width:100%; border-collapse:collapse; margin-top:1rem; }
.product__specs th, .product__specs td {
    text-align:left; padding:.5rem .75rem; border-bottom:1px solid #eee; font-size:.95rem;
}
.product__specs th { color:#666; font-weight:500; width:45%; }
.product__desc { margin-top:2rem; }

/* Лайтбокс */
.pg-lightbox {
    display:none; position:fixed; inset:0; z-index:9999;
    background:rgba(0,0,0,.9); align-items:center; justify-content:center;
}
.pg-lightbox.is-open { display:flex; }
.pg-lightbox__img {
    max-width:90vw; max-height:90vh; object-fit:contain; cursor:zoom-in;
    transition:transform .2s; transform:scale(1);
}
.pg-lightbox__img.is-zoomed { transform:scale(2.2); cursor:zoom-out; }
.pg-lightbox__close, .pg-lightbox__nav {
    position:absolute; background:rgba(255,255,255,.15); color:#fff; border:none;
    cursor:pointer; border-radius:50%; width:48px; height:48px; font-size:1.8rem; line-height:1;
}
.pg-lightbox__close { top:1rem; right:1rem; }
.pg-lightbox__nav--prev { left:1rem; top:50%; transform:translateY(-50%); }
.pg-lightbox__nav--next { right:1rem; top:50%; transform:translateY(-50%); }
.pg-lightbox__close:hover, .pg-lightbox__nav:hover { background:rgba(255,255,255,.3); }
/* ═══════════════════════════════════════════════════════════
   VIP-компании — добавить в /assets/css/styles.css на сервере
   ═══════════════════════════════════════════════════════════ */
 
/* Бейдж VIP в списках и на карточке */
.vip-badge {
    display: inline-block;
    margin-left: .5rem;
    padding: .1rem .5rem;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    color: #7a5800;
    background: linear-gradient(135deg, #ffe082, #ffca28);
    border-radius: 4px;
    vertical-align: middle;
    letter-spacing: .02em;
    white-space: nowrap;
}
 
/* Подсветка VIP-строки в списке компаний */
.company-list__item--vip {
    position: relative;
}
.company-list__item--vip > a {
    font-weight: 600;
}
 
/* Крупный бейдж на карточке компании */
.vip-badge--card {
    font-size: .85rem;
    padding: .25rem .7rem;
    margin-left: .75rem;
}
 
/* Блок «Рекомендуемые компании» */
.recommended {
    margin: 2.5rem 0;
}
.recommended__title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.recommended__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.recommended__card {
    display: block;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s;
    background: #fff;
}
.recommended__card:hover {
    border-color: #ffca28;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.recommended__name {
    font-weight: 600;
    margin-top: .35rem;
}
.recommended__badge {
    font-size: .7rem;
    font-weight: 700;
    color: #7a5800;
    background: #ffe082;
    padding: .08rem .4rem;
    border-radius: 3px;
}
.recommended__loading {
    color: #999;
    font-size: .9rem;
}
/* ═══════════════════════════════════════════════════════════
   Карточка компании — добавить в styles.css
   ═══════════════════════════════════════════════════════════ */

/* Блоки */
.company__block { margin: 2rem 0; }
.company__block h2 { margin-bottom: 1rem; }

/* Контакты / соцсети */
.company__social { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.company__social-link {
    display: inline-block; padding: .4rem .8rem; border-radius: 6px;
    background: #f0f0f0; text-decoration: none; color: #333; font-size: .9rem;
    transition: background .15s;
}
.company__social-link:hover { background: #e0e0e0; }

/* Локации */
.company__locations { display: grid; gap: 1rem; }
.location {
    padding: 1rem; border: 1px solid #eee; border-radius: 8px; background: #fff;
}
.location__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .4rem; flex-wrap: wrap; }
.location__type { font-size: 1.05rem; }
.location__status { font-size: .85rem; padding: .12rem .5rem; border-radius: 4px; font-weight: 600; }
.location__status--open  { color: #1a7f37; background: #e6f6ea; }
.location__status--closed { color: #b42318; background: #fde8e8; }
.location__address { color: #555; margin-bottom: .25rem; }
.location__phone a { text-decoration: none; font-weight: 600; }
.location__hours { margin: .6rem 0; border-collapse: collapse; font-size: .9rem; }
.location__hours td { padding: .1rem .8rem .1rem 0; }
.location__hours--today { font-weight: 700; }
.location__dayoff { color: #999; }
.location__route { margin-top: .5rem; }

/* Модалка маршрута */
.route-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.route-modal__box {
    background: #fff; border-radius: 10px; padding: 1.5rem; width: 280px; max-width: 90vw;
    display: flex; flex-direction: column; gap: .6rem;
}
.route-modal__title { font-weight: 700; margin-bottom: .3rem; }
.route-modal__link {
    display: block; padding: .7rem 1rem; border-radius: 6px; background: #f0f0f0;
    text-decoration: none; color: #222; text-align: center; font-weight: 600;
}
.route-modal__link:hover { background: #e2e2e2; }
.route-modal__close {
    margin-top: .3rem; padding: .5rem; border: none; background: none;
    color: #888; cursor: pointer; font-size: .9rem;
}

/* Витрина услуг/товаров */
.company__showcase-intro { margin-bottom: 1.2rem; color: #444; }
.showcase-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.showcase-card {
    border: 1px solid #eee; border-radius: 8px; overflow: hidden; background: #fff;
    display: flex; flex-direction: column;
}
.showcase-card--hidden { display: none; }
.showcase-card__img { aspect-ratio: 4/3; overflow: hidden; }
.showcase-card__img img { width: 100%; height: 100%; object-fit: cover; }
.showcase-card__body { padding: .75rem; }
.showcase-card__name { font-weight: 600; margin-bottom: .3rem; }
.showcase-card__desc { font-size: .85rem; color: #666; margin-bottom: .4rem; }
.showcase-card__price { font-weight: 700; color: #c47f00; }
.showcase-more { margin-top: 1rem; }

/* «Почему выбирают» */
.company__why { padding-top: 1rem; border-top: 1px solid #eee; }
@media (max-width:600px) {
    .product__top { gap:1rem; }
    .pg-lightbox__nav { width:40px; height:40px; }
}
@media (max-width: 600px) {
    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 40px;
        height: 40px;
    }
}