:root {
    --red: #d90000;
    --gray-bg: #f2f3f7;
    --border: #e1e3ea;
    --text: #1f2937;
}

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    background: var(--gray-bg);
    color: var(--text);
}

/* Красный фон */
.filter-bg {
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%);
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

/* Квадратная карточка */
.filter-section {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .filter-bg {
        padding: 20px 12px;
    }

    .filter-section {
        border-radius: 14px;
        padding: 16px;
    }
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.filter-group {
    position: relative;
}

.filter-group input,
.filter-group select,
.filter-group button {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.toggle-group button {
    flex: 1;
    border: none;
    background: #fff;
    cursor: pointer;
}

.toggle-group button.active {
    background: var(--red);
    color: #fff;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.chip.active {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.show-btn {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 14px;
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.price-range input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #e1e3ea;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
}

.more-filters {
    display: none;
    margin-top: 16px;
}

.more-filters.active {
    display: block;
}

/* 📱 Mobile */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.ads-layout {
    display: grid;
    grid-template-columns: minmax(180px, 200px) minmax(0, 1fr) minmax(180px, 200px);
    gap: 24px;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Центр */
.ads-layout .content {
    /*display: flex;*/
    justify-content: center;
}

/* Реклама */
.side-ad {
    position: sticky;
    top: 5px; /* под хедер */
    height: 100vh;
}

.ad-box {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    height: 100%;
    background: #f3f4f6;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
}

.catalog-cards {
    display: flex;
    flex-direction: column;
}

.blog-widget {
    width: 100%;
}

.ad-box {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.ad-box img {
    height: 100%;
    width: 100%;
}
/* Кнопка фильтра */
.mobile-filter-btn {
    display: none;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: #d90000;
    color: #fff;
    border: none;
    font-size: 16px;
    margin: 12px 0;
}

/* Панель фильтра */
.mobile-filter-panel {
    transition: transform .3s ease, opacity .3s ease;
}

.close-filter {
    display: none;
}

/* 📱 Mobile */
@media (min-width: 768px) {
    .close-filter {
        display: none;
    }
}
@media (max-width: 768px) {
    body.no-scroll {
        overflow: hidden;
        height: 100vh;
        touch-action: none;
    }
    body.filter-open header {
        display: none;
    }
    .mobile-filter-btn {
        display: block;
    }

    .mobile-filter-panel {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: linear-gradient(
                102.93deg,
                #374b5c 0%,
                #c10037 100%
        );
        overflow-y: auto;

        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        padding-top: 60px; /* отступ под хедер */

    }
    .mobile-filter-overlay {
        position: absolute;
        inset: 0;
    }
    .mobile-filter-panel.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* На мобилке фильтр не показываем сразу */
    .filter-bg {
        position: absolute;
        background: transparent;
        padding: 0;
    }
    .close-filter {
        top: 0;
        background: #fff;
        border: none;
        font-size: 24px;
        padding: 8px 0;
        z-index: 10;
    }
}


@media (max-width: 575px) {
    .card-body-desc{
        display: none;
    }
}
@media (min-width: 575px) {
    .card-body-mob{
        display: none;
    }
}
@media (max-width: 768px) {
    .catalog-cards {
        width: 50% !important;
    }
}

@media (max-width: 1400px) {
    .side-ad {
        display: none;
    }

    .ads-layout {
        display: block !important;
    }
}

/* bottom menu*/

/* Скрыто на десктопе */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    .mobile-bottom-nav {
        transition: transform 0.3s ease, opacity 0.3s ease;
        will-change: transform;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3000;

        display: flex;
        justify-content: space-around;
        align-items: center;

        height: 64px;
        padding-bottom: env(safe-area-inset-bottom);

        background: #fff;
        border-top: 1px solid #e6e6e6;
    }
    .mobile-bottom-nav.hidden {
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
    }

    .nav-item {
        flex: 1;
        text-align: center;
        text-decoration: none;
        color: #9aa1ad;
        font-size: 11px;
    }

    .nav-item .icon {
        display: block;
        font-size: 20px;
        line-height: 1;
    }

    .nav-item.active {
        color: #c10037;
    }

    /* Центральная кнопка */
    .add-btn {
        position: relative;
        top: -18px;
        width: 56px;
        height: 56px;
        background: #c10037;
        border-radius: 50%;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        box-shadow: 0 8px 20px rgba(193,0,55,0.35);
    }

    .add-btn .label {
        display: none;
    }
}

/* категории фильтра*/
/* Градиент снаружи — как у фильтра */
.category-compact-bg {
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%);
    padding: 12px 16px;
}

/* Белая панель */
.category-compact {
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

/* Один элемент */
.cat-item {
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    background: #f9fafb;

    padding: 12px 8px;
    text-align: center;

    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 500;
    color: #1f2937;

    cursor: pointer;
    transition: all .2s ease;
}

/* Иконка */
.cat-icon {
    font-size: 22px;
    line-height: 1;
}

/* Hover / active */
.cat-item:hover {
    border-color: #c10037;
    background: #fff;
}

.cat-item.active {
    border-color: #c10037;
    box-shadow: 0 0 0 2px rgba(193,0,55,.2);
    background: #fff;
}

/* 📱 Mobile — 2×2 */
@media (max-width: 768px) {
    .category-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}
.bx-pagination .bx-pagination-container ul li.bx-active span{
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%) !important;
}
.title-right{
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%) !important;
}
.footer.footer-seven{
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%) !important;
}


/* hover */
.subcat-item:hover {
    background: #fff;
    border-color: #c10037;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

/* активная */
.subcat-item.active {
    border-color: #c10037;
    box-shadow: 0 0 0 2px rgba(193,0,55,.2);
}
/* Тот же фон, что сверху */
.subcategory-bg {
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%);
    padding: 16px;
}

/* Белая карточка */
.subcategory-wrapper {
    background: #fff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 18px 44px rgba(0,0,0,.15);
}

/* Шапка */
.subcategory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subcategory-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.back-btn {
    background: none;
    border: none;
    color: #c10037;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* Сетка */
.subcategory-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* Карточка */
.subcat-item {
    height: 110px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f7f8fa);
    border: 1px solid #e6e6e6;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 14px;
    font-weight: 500;
    color: #1f2937;

    cursor: pointer;
    transition: all .2s ease;
}

/* Иконка */
.subcat-icon {
    width: 46px;
    height: 20px;
    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    /*background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%);*/
}

/* Hover */
.subcat-item:hover {
    border-color: #c10037;
    box-shadow: 0 12px 28px rgba(0,0,0,.14);
    transform: translateY(-2px);
}

.filter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.filter-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #111;
}

.back-all {
    background: none;
    border: none;
    color: #e60000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.back-all:hover {
    text-decoration: underline;
}
.login-content{
    background: linear-gradient(102.93deg, #374b5c 0%, #c10037 100%);
}

.social-auth {
    display: flex;
    justify-content: center;      /* по центру */
    align-items: center;          /* выравнивание по высоте */
    gap: 20px;                    /* расстояние между кнопками */
    flex-wrap: wrap;              /* перенос на мобилке */
}

.auth-btn {
    min-width: 60px;
    height: 60px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    margin: 0;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 18px;
    margin-bottom: 20px;

    background: #fde8e8;
    border: 1px solid #f87171;
    border-radius: 12px;

    color: #b91c1c;
    font-weight: 500;
}

.login-error i {
    font-size: 20px;
    flex-shrink: 0;
}

.login-error .error-text {
    text-align: left;
}

.error-hidden{
    display: none;
}

.tb-detail {
    --tb-red: #ca1016;
    --tb-text: #212c3a;
    --tb-muted: #8d94a0;
    --tb-bg: #f4f6f8;
    --tb-card: #ffffff;
    --tb-border: #e7ebf0;
    padding: 28px 0 48px;
    background: var(--tb-bg);
}
.tb-page-layout {
    display: grid;
    grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) minmax(140px, 180px);
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 10px;
}
.tb-side-ad {
    position: sticky;
    top: 76px;
    height: calc(100vh - 90px);
}
.tb-side-ad .ad-box {
    display: flex;
    width: 100%;
    height: 100%;
    border: 1px dashed #d7dde7;
    border-radius: 10px;
    background: #eef2f6;
    overflow: hidden;
}
.tb-side-ad .ad-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tb-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}
.tb-breadcrumbs {
    font-size: 13px;
    color: var(--tb-muted);
    margin-bottom: 14px;
}
.tb-breadcrumbs a {
    color: #4e596a;
}
.tb-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
    gap: 18px;
}
.tb-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 12px;
}
.tb-main-head {
    padding: 18px;
    margin-bottom: 14px;
}
.tb-main-head h1 {
    margin: 0;
    color: var(--tb-text);
    font-size: 30px;
    font-weight: 700;
}
.tb-head-meta {
    margin-top: 8px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--tb-muted);
    font-size: 14px;
}
.tb-price {
    margin-top: 14px;
    display: inline-block;
    font-size: 34px;
    font-weight: 700;
    color: var(--tb-red);
}
.tb-promo {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.tb-promo button {
    border: 1px solid var(--tb-border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    background: #fff;
    color: #39475a;
}
.tb-promo .is-main {
    background: #fff4f4;
    border-color: #f7d3d4;
    color: var(--tb-red);
}
.tb-gallery {
    padding: 10px;
    margin-bottom: 14px;
}
.tb-gallery-main {
    width: 100%;
    height: 430px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    cursor: zoom-in;
}
.tb-thumbs {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.tb-thumbs button {
    border: 1px solid var(--tb-border);
    background: #fff;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}
.tb-thumbs button.is-active {
    border-color: var(--tb-red);
}
.tb-thumbs img {
    width: 100%;
    height: 82px;
    object-fit: cover;
    display: block;
}
.tb-section {
    padding: 16px 18px;
    margin-bottom: 14px;
}
.tb-section h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--tb-text);
}
.tb-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}
.tb-spec {
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 8px;
}
.tb-spec small {
    display: block;
    color: var(--tb-muted);
    font-size: 12px;
}
.tb-spec span {
    color: #2f3b4d;
    font-weight: 600;
    font-size: 15px;
}
.tb-description {
    color: #364356;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 0;
}
.tb-seller {
    padding: 18px;
    position: sticky;
    top: 24px;
}
.tb-seller h4 {
    margin: 0;
    font-size: 22px;
    color: var(--tb-text);
}
.tb-seller p {
    margin: 8px 0;
    color: var(--tb-muted);
    font-size: 14px;
}
.tb-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 12px 0 8px;
    background: var(--tb-red);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 8px;
    border: 0;
}
.tb-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.tb-actions a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    height: 40px;
    color: #495768;
    font-size: 14px;
    font-weight: 600;
}
.tb-actions button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    height: 40px;
    color: #495768;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
}
.tb-actions .tb-danger {
    border-color: #f3d0d2;
    color: var(--tb-red);
}
.tb-phone-note {
    margin: 0;
    color: #7e8793;
    font-size: 12px;
    text-align: center;
}
.tb-safe {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px dashed #d9e1ea;
    border-radius: 8px;
    padding: 10px;
}
.tb-safe h5 {
    margin: 0 0 6px;
    font-size: 13px;
    color: #2f3b4d;
}
.tb-safe ul {
    margin: 0;
    padding-left: 16px;
    color: #5e6877;
    font-size: 12px;
}
.tb-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
.tb-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    color: #4d5a6b;
    font-size: 14px;
}
.tb-list li strong {
    color: #2f3b4d;
}
.tb-sim-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff4f4;
    color: var(--tb-red);
    font-size: 13px;
    font-weight: 700;
}
.tb-similarity {
    margin-top: 20px;
}
.tb-similarity h3 {
    color: var(--tb-text);
    font-size: 24px;
    margin: 0 0 12px;
}
.tb-sim-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.tb-item {
    background: #fff;
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    overflow: hidden;
}
.tb-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.tb-item-body {
    padding: 10px;
}
.tb-item-price {
    color: var(--tb-red);
    font-size: 19px;
    font-weight: 700;
}
.tb-item-title {
    margin: 4px 0;
    color: #2f3b4d;
    font-size: 14px;
    line-height: 1.4;
}
.tb-item-meta {
    color: var(--tb-muted);
    font-size: 12px;
}
.tb-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(17, 22, 30, 0.94);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.tb-lightbox.is-open {
    display: flex;
}
.tb-lightbox img {
    max-width: min(1200px, 94vw);
    max-height: 92vh;
    object-fit: contain;
    border-radius: 10px;
}
.tb-lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 22px;
    line-height: 1;
}
@media (max-width: 991px) {
    .tb-grid {
        grid-template-columns: 1fr;
    }
    .tb-seller {
        position: static;
    }
    .tb-main-head h1 {
        font-size: 25px;
    }
    .tb-gallery-main {
        height: 300px;
    }
}
@media (max-width: 1400px) {
    .tb-page-layout {
        display: block;
        max-width: 1160px;
        padding: 0;
    }
    .tb-side-ad {
        display: none;
    }
}
@media (max-width: 767px) {
    .tb-detail {
        padding-top: 18px;
    }
    .tb-main-head,
    .tb-section,
    .tb-seller {
        padding: 14px;
        border-radius: 10px;
    }
    .tb-main-head h1 {
        font-size: 21px;
    }
    .tb-price {
        font-size: 29px;
    }
    .tb-gallery {
        padding: 8px;
    }
    .tb-gallery-main {
        height: 240px;
    }
    .tb-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
    .tb-thumbs img {
        height: 64px;
    }
    .tb-spec-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .tb-sim-grid {
        grid-template-columns: 1fr;
    }
}