/* =========================================================================
   SMART FILTER — Умный фильтр каталога
   ========================================================================= */

/* Layout */
.catalog-section {
    padding: 30px 0 60px;
}

.catalog-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* SIDEBAR */
.smart-filter {
    background: #fff;
    border-radius: 18px;
    padding: 24px 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
}

.sf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.sf-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--pink, #fa0268);
}

.sf-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

/* ACTIVE CHIPS */
.sf-active-chips {
    /*display: flex;*/
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    min-height: 28px;
}

.sf-chip {
    background: linear-gradient(
            135deg,
            var(--pink, #fa0268),
            var(--violet, #8b72f7)
    );
    color: #fff;
    padding: 5px 10px 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sf-chip:hover {
    opacity: 0.85;
}

.sf-chip::after {
    content: "×";
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* GROUPS */
.sf-group {
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 0;
}

.sf-group:last-of-type {
    border-bottom: none;
}

.sf-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
    user-select: none;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.sf-group-title:hover {
    color: var(--pink, #fa0268);
}

.sf-arrow {
    font-size: 14px;
    color: #999;
    transition: transform 0.25s;
}

.collapsed .sf-arrow {
    transform: rotate(-90deg);
}

.sf-group.collapsed .sf-group-body {
    display: none;
}

.sf-group-body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* CHECKBOX */
.sf-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px;
    transition: color 0.15s;
}

.sf-checkbox:hover {
    color: var(--pink, #fa0268);
}

.sf-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s;
}

.sf-checkbox input[type="checkbox"]:checked {
    background: var(--pink, #fa0268);
    border-color: var(--pink, #fa0268);
}

.sf-checkbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sf-label {
    flex: 1;
}

.sf-count {
    color: #999;
    font-size: 12px;
}

.sf-count-title {
    color: #999;
    font-size: 12px;
}

/* PRICE SLIDER */
.sf-price-slider {
    padding-top: 8px;
}

.sf-price-track {
    position: relative;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-bottom: 18px;
}

.sf-price-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(
            90deg,
            var(--pink, #fa0268),
            var(--violet, #8b72f7)
    );
    border-radius: 3px;
}

.sf-price-input {
    position: absolute;
    top: -7px;
    width: 100%;
    height: 20px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    outline: none;
}

.sf-price-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--pink, #fa0268);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(250, 2, 104, 0.3);
}

.sf-price-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--pink, #fa0268);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}

.sf-price-inputs {
    display: flex;
    gap: 10px;
}

.sf-price-inputs label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    flex: 1;
}

.sf-price-inputs input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.sf-price-inputs input:focus {
    outline: none;
    border-color: var(--pink, #fa0268);
}

/* COLOR SWATCHES */
.sf-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.sf-color {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--swatch);
    cursor: pointer;
    position: relative;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    transition: all 0.15s;
}

.sf-color.bx-active {
    box-shadow: 0 0 0 2px var(--pink, #fa0268), 0 0 0 4px #fff, 0 0 0 6px var(--pink, #fa0268);
}


.sf-color:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 1px var(--pink, #fa0268),
    0 4px 8px rgba(0, 0, 0, 0.15);
}

.sf-color input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.sf-color input:checked ~ *,
.sf-color:has(input:checked) {
    box-shadow: 0 0 0 2px var(--pink, #fa0268),
    0 0 0 4px #fff,
    0 0 0 6px var(--pink, #fa0268);
}

/* ACTIONS */
.sf-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.sf-apply {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.sf-reset {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.sf-reset:hover {
    color: var(--pink, #fa0268);
    border-color: var(--pink, #fa0268);
}

/* TOOLBAR */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page_title {
    font-size: 32px;
    margin: 0;
    color: #222;
}

.catalog-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.results-count {
    font-size: 14px;
    color: #666;
}

.results-count b {
    color: var(--pink, #fa0268);
}

.catalog-sort {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.catalog-sort:focus {
    outline: none;
    border-color: var(--pink, #fa0268);
}

.sf-toggle-mobile {
    display: none;
    padding: 8px 16px;
    background: var(--pink, #fa0268);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* PRODUCTS GRID */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card,.myproduct-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover,.myproduct-card:hover {
    box-shadow: 0 12px 28px rgba(250, 2, 104, 0.18);
}

.pc-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 15;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.5px;
}

.badge-hit {
    background: var(--pink, #fa0268);
}

.badge-new {
    background: var(--cyan, #00c9c0);
    color: #fff;
}

.badge-pre {
    background: #888;
}

.pc-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    font-size: 64px;
    margin-bottom: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, #fff5fa, #f5edff);
    border-radius: 12px;
    transition: transform 0.25s;
}

.pc-img:hover {
    transform: scale(1.05);
}

.pc-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    flex: 1;
}

.pc-title a {
    color: #222;
    text-decoration: none;
}

.pc-title a:hover {
    color: var(--pink, #fa0268);
}

.pc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.pc-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #eee;
}

.pc-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--pink, #fa0268);
    margin-bottom: 12px;
}

.pc-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* NO RESULTS */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 30px;
}

.no-results h3 {
    font-size: 24px;
    color: #444;
    margin-bottom: 10px;
}

.no-results p {
    color: #888;
    margin-bottom: 20px;
}

/* PAGINATION */
.pagenavigator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagenavigator a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s;
    border: 1px solid #eee;
}

.pagenavigator a:hover,
.pagenavigator a.active {
    background: var(--pink, #fa0268);
    color: #fff;
    border-color: var(--pink, #fa0268);
}

/* HIDDEN STATE (for filtering) */
.product-card.hidden {
    display: none;
}

/* MOBILE */
@media (max-width: 992px) {
    .catalog-wrap {
        grid-template-columns: 1fr;
    }

    .smart-filter {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 999;
        border-radius: 0;
        transition: left 0.3s ease;
    }

    .smart-filter.open {
        left: 0;
    }

    .sf-toggle {
        display: block;
    }

    .sf-toggle-mobile {
        display: inline-block;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .page_title {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .catalog-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================================
   CPT GRID — совместимость с фильтром
   ========================================================================= */

.cpt-card,.mycpt-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    position: relative;
}

.cpt-card:hover,.mycpt-card:hover {
    box-shadow: 0 12px 28px rgba(250, 2, 104, 0.18);
}

.cpt-card .cpt-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    margin-bottom: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, #fff5fa, #f5edff);
    border-radius: 12px;
    overflow: hidden;
}

.cpt-card .cpt-foto img {
    max-height: 100%;
    object-fit: contain;
}

.cpt-card .cpt-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    line-height: 1.3;
}

.cpt-card .cpt-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--pink, #fa0268);
    margin-bottom: 12px;
}

.cpt-card .cpt-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
}

/* Badges inside cpt-card */
.cpt-card .pc-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

/* Compatibility: product-card → cpt-card */
.product-card.cpt-card.hidden,
.cpt-card.product-card.hidden {
    display: none;
}
