/* === Каталог видеонаблюдения === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --cat-bg: #f8f9fa;
    --cat-card-bg: #fff;
    --cat-border: #e9ecef;
    --cat-text: #212529;
    --cat-text2: #6c757d;
    --cat-accent: #28a745;
    --cat-accent-hover: #218838;
    --cat-radius: 10px;
    --cat-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --cat-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* === Обёртка === */
.catalog-page {
    font-family: 'Inter', -apple-system, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    color: var(--cat-text);
    min-height: 80vh;
}

/* === Хлебные крошки === */
.cat-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cat-text2);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cat-breadcrumbs a {
    color: var(--cat-text2);
    text-decoration: none;
    transition: color 0.2s;
}

.cat-breadcrumbs a:hover {
    color: var(--cat-accent);
}

.cat-breadcrumbs span {
    color: #adb5bd;
}

/* === Заголовок === */
.cat-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px;
    font-style: italic;
}

/* === СЕТКА КАТЕГОРИЙ === */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .cat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cat-card {
    background: var(--cat-card-bg);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cat-card:hover {
    box-shadow: var(--cat-shadow-hover);
    transform: translateY(-3px);
}

.cat-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
    margin-bottom: 10px;
}

.cat-card:hover .cat-card-img {
    filter: grayscale(0%);
}

.cat-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--cat-text);
    line-height: 1.3;
}

.cat-card-count {
    font-size: 11px;
    color: var(--cat-text2);
    margin-top: 4px;
}

/* === СПИСОК ТОВАРОВ (внутри категории) === */
.cat-layout {
    display: flex;
    gap: 24px;
}

/* Фильтры слева */
.cat-filters {
    width: 240px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cat-layout {
        flex-direction: column;
    }

    .cat-filters {
        width: 100%;
    }
}

.cat-filter-group {
    border-bottom: 1px solid var(--cat-border);
    padding: 14px 0;
}

.cat-filter-title {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.cat-filter-title::after {
    content: '›';
    font-size: 18px;
    transition: transform 0.2s;
    color: var(--cat-text2);
}

.cat-filter-title.is-open::after {
    transform: rotate(90deg);
}

.cat-filter-body {
    display: none;
    padding-top: 10px;
}

.cat-filter-body.is-open {
    display: block;
}

.cat-filter-body label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 3px 0;
    cursor: pointer;
    color: var(--cat-text);
}

.cat-filter-body input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--cat-accent);
}

/* Ценовой диапазон */
.cat-price-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cat-price-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--cat-border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.cat-price-input:focus {
    border-color: var(--cat-accent);
}

/* Сортировка */
.cat-sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    flex-wrap: wrap;
}

.cat-sort-label {
    color: var(--cat-text2);
}

.cat-sort-btn {
    padding: 6px 14px;
    border: 1px solid var(--cat-border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.cat-sort-btn.is-active {
    background: var(--cat-accent);
    color: #fff;
    border-color: var(--cat-accent);
}

.cat-sort-btn:hover:not(.is-active) {
    border-color: var(--cat-accent);
    color: var(--cat-accent);
}

/* Товарная сетка */
.cat-products-grid {
    flex: 1;
}

.cat-products-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .cat-products-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cat-products-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .cat-products-list {
        grid-template-columns: 1fr;
    }
}

.cat-product-card {
    background: var(--cat-card-bg);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s;
    cursor: pointer;
}

.cat-product-card:hover {
    box-shadow: var(--cat-shadow-hover);
}

.cat-product-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 12px;
}

.cat-product-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--cat-text);
    flex: 1;
}

.cat-product-art {
    font-size: 11px;
    color: var(--cat-text2);
    margin-bottom: 8px;
}

.cat-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.cat-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--cat-text);
}

.cat-product-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--cat-text2);
}

.cat-cart-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--cat-accent);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cat-cart-btn:hover {
    background: var(--cat-accent-hover);
    transform: scale(1.1);
}

.cat-cart-btn.in-cart {
    background: #6c757d;
}

/* === КАРТОЧКА ТОВАРА === */
.cat-detail {
    display: flex;
    gap: 30px;
}

@media (max-width: 768px) {
    .cat-detail {
        flex-direction: column;
    }
}

.cat-detail-gallery {
    display: flex;
    gap: 12px;
    width: 50%;
    min-width: 300px;
}

@media (max-width: 768px) {
    .cat-detail-gallery {
        width: 100%;
        min-width: auto;
    }
}

.cat-detail-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 70px;
    flex-shrink: 0;
}

.cat-detail-thumb {
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 6px;
    object-fit: contain;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f8f9fa;
    padding: 2px;
}

.cat-detail-thumb.is-active {
    border-color: var(--cat-accent);
}

.cat-detail-main-img {
    flex: 1;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--cat-radius);
    background: #f8f9fa;
    padding: 20px;
}

.cat-detail-info {
    flex: 1;
}

.cat-detail-art {
    font-size: 13px;
    color: var(--cat-accent);
    margin-bottom: 10px;
}

.cat-detail-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

/* Характеристики */
.cat-params-title {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px;
}

.cat-params-table {
    width: 100%;
    border-collapse: collapse;
}

.cat-params-table tr:nth-child(even) {
    background: #f8f9fa;
}

.cat-params-table td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--cat-border);
}

.cat-params-table td:first-child {
    color: var(--cat-text2);
    width: 45%;
}

.cat-params-table td:last-child {
    font-weight: 500;
    text-align: right;
}

/* Цена и кнопка в карточке */
.cat-detail-price-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--cat-radius);
}

.cat-detail-price {
    font-size: 28px;
    font-weight: 700;
}

.cat-detail-price span {
    font-size: 18px;
    font-weight: 400;
    color: var(--cat-text2);
}

.cat-detail-cart-btn {
    padding: 12px 28px;
    background: var(--cat-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-detail-cart-btn:hover {
    background: var(--cat-accent-hover);
}

/* === КОРЗИНА (плавающая) === */
.cat-floating-cart {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cat-accent);
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.35);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 600;
}

.cat-floating-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(40, 167, 69, 0.45);
}

.cat-floating-cart-count {
    background: #fff;
    color: var(--cat-accent);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* Модалка корзины */
.cat-cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}

.cat-cart-modal-overlay.is-open {
    display: flex;
}

.cat-cart-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.cat-cart-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cat-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--cat-border);
}

.cat-cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cat-cart-item-info {
    flex: 1;
}

.cat-cart-item-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.cat-cart-item-price {
    font-size: 14px;
    font-weight: 700;
}

.cat-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--cat-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-cart-qty-btn:hover {
    background: #f0f0f0;
}

.cat-cart-item-remove {
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    border: none;
    background: none;
    padding: 4px;
}

.cat-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 700;
}

.cat-cart-order-btn {
    width: 100%;
    padding: 14px;
    background: var(--cat-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.cat-cart-order-btn:hover {
    background: var(--cat-accent-hover);
}

.cat-cart-empty {
    text-align: center;
    color: var(--cat-text2);
    padding: 40px 0;
    font-size: 15px;
}

/* Загрузка */
.cat-loading {
    text-align: center;
    padding: 60px;
    color: var(--cat-text2);
    font-size: 18px;
}

.cat-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: var(--cat-accent);
    border-radius: 50%;
    animation: catSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes catSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Описание */
.cat-description {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--cat-radius);
    font-size: 14px;
    line-height: 1.6;
    color: var(--cat-text2);
}

/* === КНОПКА «НА ГЛАВНУЮ» — Футуристичная === */
.back-home-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9989;
    display: flex;
    align-items: center;
    gap: 0;
    height: 48px;
    padding: 0 16px;
    border-radius: 24px;
    text-decoration: none;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, rgba(30, 60, 90, 0.85), rgba(20, 40, 70, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 30px rgba(40, 167, 69, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-home-btn:hover {
    gap: 8px;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(33, 136, 56, 0.95));
    box-shadow:
        0 8px 32px rgba(40, 167, 69, 0.4),
        0 0 60px rgba(40, 167, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
    border-color: rgba(40, 167, 69, 0.4);
}

/* Стрелка */
.back-home-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    animation: arrowPulse 2s ease-in-out infinite;
}

.back-home-btn:hover .back-home-arrow {
    animation: arrowSlide 0.6s ease-out;
}

@keyframes arrowPulse {

    0%,
    100% {
        transform: translateX(0);
        opacity: 0.8;
    }

    50% {
        transform: translateX(-3px);
        opacity: 1;
    }
}

@keyframes arrowSlide {
    0% {
        transform: translateX(8px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Текст */
.back-home-text {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.3s ease 0.1s;
}

.back-home-btn:hover .back-home-text {
    max-width: 120px;
    opacity: 1;
}

/* Неоновое свечение */
.back-home-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(40, 167, 69, 0.3) 50%,
            transparent 70%);
    background-size: 200% 200%;
    animation: glowSweep 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowSweep {
    0% {
        background-position: 200% 0;
    }

    50% {
        background-position: 0 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* === МОБИЛЬНАЯ АДАПТАЦИЯ === */
@media (max-width: 768px) {

    /* Скрываем баннер на мобильном в каталоге */
    #site-header .lp-form-18 {
        display: none !important;
    }

    .catalog-page {
        padding: 16px 12px;
    }

    .cat-title {
        font-size: 20px;
        margin: 0 0 16px;
    }

    .cat-breadcrumbs {
        font-size: 12px;
        margin-bottom: 12px;
    }

    /* Сетка категорий — 2 колонки */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cat-card {
        padding: 12px 8px;
    }

    .cat-card-img {
        height: 100px;
    }

    .cat-card-name {
        font-size: 12px;
    }

    .cat-card-count {
        font-size: 10px;
    }

    /* Товарная сетка — 2 колонки */
    .cat-products-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .cat-product-card {
        padding: 10px;
    }

    .cat-product-img {
        height: 120px;
    }

    .cat-product-name {
        font-size: 12px;
    }

    .cat-product-price {
        font-size: 14px;
    }

    .cat-cart-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    /* Фильтры — скрыты по умолчанию */
    .cat-layout {
        flex-direction: column;
    }

    .cat-filters {
        width: 100%;
    }

    /* Сортировка */
    .cat-sort-bar {
        gap: 6px;
        margin-bottom: 12px;
    }

    .cat-sort-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Карточка товара — вертикально */
    .cat-detail {
        flex-direction: column;
    }

    .cat-detail-gallery {
        width: 100%;
        min-width: auto;
    }

    .cat-detail-main-img {
        max-height: 300px;
    }

    .cat-detail-thumbs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
    }

    .cat-detail-thumb {
        width: 50px;
        height: 50px;
    }

    .cat-detail-name {
        font-size: 18px;
    }

    .cat-detail-price {
        font-size: 22px;
    }

    .cat-detail-price-block {
        flex-wrap: wrap;
        padding: 12px;
    }

    .cat-params-table td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .cat-description {
        font-size: 13px;
        padding: 14px;
    }

    /* Корзина */
    .cat-floating-cart {
        bottom: 16px;
        right: 16px;
        padding: 10px 18px;
        font-size: 13px;
    }

    .cat-cart-modal {
        padding: 20px 16px;
        width: 95%;
    }

    /* Кнопка назад */
    .back-home-btn {
        bottom: 16px;
        left: 16px;
        height: 42px;
        padding: 0 14px;
    }
}

@media (max-width: 400px) {
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .cat-card-img {
        height: 80px;
    }

    .cat-products-list {
        grid-template-columns: 1fr !important;
    }

    .cat-product-img {
        height: 150px;
    }
}