@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&display=swap');

:root {
    --cf-bg: #0a0a0a;
    --cf-surface: #111111;
    --cf-surface-2: #1a1a1a;
    --cf-border: #2a2a2a;
    --cf-accent: #0095e8;
    --cf-accent-glow: rgba(0, 149, 232, 0.25);
    --cf-text: #ffffff;
    --cf-text-muted: #888888;
    --cf-text-dim: #555555;
    --cf-danger: #e83a00;
    --cf-font: 'Oswald', sans-serif;
    --cf-radius: 15px;
    --cf-transition: 0.2s ease;
}

.cf-filter-wrap {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: 500px;
    background: var(--cf-bg);
    font-family: var(--cf-font);
    color: var(--cf-text);
    margin-left: -30px;
}

/* ─── SIDEBAR ─── */

.cf-sidebar {
    background: var(--cf-surface);
    border-right: 1px solid var(--cf-border);
    padding: 0;
    position: sticky;
    top: 0;
    height: fit-content;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.cf-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 12px;
    border-bottom: 1px solid var(--cf-border);
    background: var(--cf-surface-2);
    border-top-left-radius: 15px;
}

.cf-sidebar__label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--cf-text-muted);
}

.cf-clear-btn {
    background: none;
    border: 1px solid var(--cf-border);
    color: var(--cf-text-muted);
    font-family: var(--cf-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: var(--cf-radius);
    transition: all var(--cf-transition);
    display: none;
}

.cf-clear-btn.is-visible {
    display: block;
}

.cf-clear-btn:hover {
    border-color: var(--cf-danger);
    color: var(--cf-danger);
}

/* ─── FILTER GROUPS ─── */

.cf-filter-group {
    border-bottom: 1px solid var(--cf-border);
}

.cf-filter-group:last-child {
    border-bottom: none;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.cf-group-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--cf-text);
    font-family: var(--cf-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.15em;
    padding: 16px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--cf-transition);
}

.cf-group-toggle:hover {
    color: var(--cf-accent);
}

.cf-chevron {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transition: transform var(--cf-transition);
    flex-shrink: 0;
}

.cf-group-toggle[aria-expanded="false"] .cf-chevron {
    transform: rotate(-90deg);
}

.cf-option-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 12px;
    overflow: hidden;
}

.cf-option-list.is-collapsed {
    display: none;
}

.cf-option {
    padding: 0;
}

.cf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background var(--cf-transition);
    position: relative;
}

.cf-checkbox-label:hover {
    background: var(--cf-surface-2);
}

.cf-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cf-checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--cf-border);
    background: var(--cf-bg);
    border-radius: var(--cf-radius);
    flex-shrink: 0;
    transition: all var(--cf-transition);
    position: relative;
}

.cf-checkbox:checked+.cf-checkbox-custom {
    background: var(--cf-accent);
    border-color: var(--cf-accent);
    box-shadow: 0 0 8px var(--cf-accent-glow);
}

.cf-checkbox:checked+.cf-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.cf-option-text {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--cf-text-muted);
    transition: color var(--cf-transition);
}

.cf-checkbox:checked~.cf-option-text {
    color: var(--cf-text);
}

/* ─── RESULTS AREA ─── */

.cf-results-area {
    padding: 0;
    background: var(--cf-bg);
}

.cf-results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--cf-border);
    background: var(--cf-surface);
    flex-wrap: wrap;
    border-top-right-radius: 15px;
}

.cf-results-count {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--cf-text-muted);
    white-space: nowrap;
}

#cf-count {
    color: var(--cf-accent);
}

/* ─── ACTIVE TAGS ─── */

.cf-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cf-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cf-surface-2);
    border: 1px solid var(--cf-accent);
    color: var(--cf-accent);
    font-family: var(--cf-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border-radius: var(--cf-radius);
    animation: cf-tag-in 0.15s ease;
}

@keyframes cf-tag-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cf-tag__remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--cf-transition);
    line-height: 1;
    font-size: 12px;
}

.cf-tag__remove:hover {
    opacity: 1;
}

/* ─── PRODUCT GRID ─── */

.cf-product-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ─── STATES ─── */

.cf-initial-state,
.cf-no-results,
.cf-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: var(--cf-text-dim);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2em;
}

.cf-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cf-border);
    border-top-color: var(--cf-accent);
    border-radius: 50%;
    animation: cf-spin 0.7s linear infinite;
    margin-left: 12px;
}

@keyframes cf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── PRODUCT CARD ─── */

.cf-card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    overflow: hidden;
    transition: all var(--cf-transition);
    animation: cf-card-in 0.25s ease both;
}

.cf-card:nth-child(1) { animation-delay: 0.03s; }
.cf-card:nth-child(2) { animation-delay: 0.06s; }
.cf-card:nth-child(3) { animation-delay: 0.09s; }
.cf-card:nth-child(4) { animation-delay: 0.12s; }

@keyframes cf-card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cf-card:hover {
    border-color: var(--cf-accent);
    box-shadow: 0 0 20px var(--cf-accent-glow);
    transform: translateY(-2px);
}

.cf-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cf-card__img-wrap {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--cf-surface-2);
    position: relative;
}

.cf-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.cf-card:hover .cf-card__img-wrap img {
    transform: scale(1.05);
}

.cf-card__no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cf-text-dim);
    font-size: 10px;
    letter-spacing: 0.15em;
}

.cf-card__body {
    padding: 12px 16px;
    border-top: 1px solid var(--cf-border);
}

.cf-card__title {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--cf-text);
    margin: 0;
    line-height: 1.35;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .cf-filter-wrap {
        grid-template-columns: 1fr;
        margin-left: 0;
    }

    .cf-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--cf-border);
    }

    .cf-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        padding: 16px;
        gap: 12px;
    }
}