/* ===== MAIN LAYOUT SYSTEM ===== */

#marketplace-content-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

/* ===== SIDEBAR FILTERS CONTAINER ===== */

#marketplace-filters-sidebar {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.8) 0%, rgba(26, 32, 44, 0.9) 100%);
    border: 1px solid rgba(74, 85, 104, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

#marketplace-filters-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.3), transparent);
}

/* ===== SIDEBAR HEADER ===== */

#marketplace-sidebar-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 24px 28px;
    border-bottom: 1px solid rgba(74, 85, 104, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    flex-shrink: 0;
}

#marketplace-sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.3), transparent);
}

#marketplace-sidebar-title {
    margin: 0;
    color: var(--z-text);
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--z-text) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

#marketplace-sidebar-title i {
    color: var(--z-accent);
    font-size: 1.1rem;
}

#marketplace-reset-filters {
    background: rgba(45, 55, 72, 0.8);
    border: 1px solid rgba(74, 85, 104, 0.4);
    color: var(--z-text-sec);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

#marketplace-reset-filters:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.4);
    color: var(--z-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

/* ===== SIDEBAR CONTENT ===== */

#marketplace-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--z-surface-3) transparent;
}

#marketplace-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

#marketplace-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

#marketplace-sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--z-accent), var(--z-accent-dark));
    border-radius: 4px;
}

#marketplace-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--z-accent-dark), var(--z-accent-dark));
}

/* ===== FILTER SECTIONS BASE ===== */

#marketplace-filter-categories,
#marketplace-filter-price,
#marketplace-filter-features,
#marketplace-filter-formats {
    border-bottom: 1px solid rgba(74, 85, 104, 0.2);
    position: relative;
}

#marketplace-filter-categories:last-child,
#marketplace-filter-price:last-child,
#marketplace-filter-features:last-child,
#marketplace-filter-formats:last-child {
    border-bottom: none;
}

/* Filter Section Titles */
#marketplace-filter-categories-title,
#marketplace-filter-price-title,
#marketplace-filter-features-title,
#marketplace-filter-formats-title {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.6) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 20px 28px;
    margin: 0;
    color: var(--z-text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    position: relative;
    user-select: none;
}

#marketplace-filter-categories-title:hover,
#marketplace-filter-price-title:hover,
#marketplace-filter-features-title:hover,
#marketplace-filter-formats-title:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(229, 90, 46, 0.1) 100%);
    color: var(--z-accent);
}

#marketplace-filter-categories-title i,
#marketplace-filter-price-title i,
#marketplace-filter-features-title i,
#marketplace-filter-formats-title i {
    color: var(--z-accent);
    font-size: 0.9rem;
    margin-right: 8px;
}

.filter-title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-count {
    background: rgba(255, 107, 53, 0.2);
    color: var(--z-accent);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.filter-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem !important;
    color: var(--z-text-sec) !important;
}

/* Filter Content Areas */
#marketplace-filter-categories-content,
#marketplace-filter-price-content,
#marketplace-filter-features-content,
#marketplace-filter-formats-content {
    padding: 24px 28px;
    background: linear-gradient(180deg, rgba(45, 55, 72, 0.4) 0%, rgba(26, 32, 44, 0.6) 100%);
    display: block;
}



/* ===== PRICE RANGE SECTION ===== */

#marketplace-price-range {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#marketplace-price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#marketplace-price-min-group,
#marketplace-price-max-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#marketplace-price-min-group label,
#marketplace-price-max-group label {
    color: var(--z-text-sec);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#marketplace-price-min,
#marketplace-price-max {
    background: rgba(45, 55, 72, 0.8);
    border: 1px solid rgba(74, 85, 104, 0.4);
    color: var(--z-text);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 100%;
}

#marketplace-price-min:focus,
#marketplace-price-max:focus {
    outline: none;
    border-color: var(--z-accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

#marketplace-price-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#marketplace-preset-free,
#marketplace-preset-1-25,
#marketplace-preset-26-100,
#marketplace-preset-100-plus {
    background: rgba(45, 55, 72, 0.6);
    border: 1px solid rgba(74, 85, 104, 0.4);
    color: var(--z-text-sec);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

#marketplace-preset-free:hover,
#marketplace-preset-1-25:hover,
#marketplace-preset-26-100:hover,
#marketplace-preset-100-plus:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.4);
    color: var(--z-accent);
    transform: translateY(-1px);
}

#marketplace-preset-free.active,
#marketplace-preset-1-25.active,
#marketplace-preset-26-100.active,
#marketplace-preset-100-plus.active {
    background: linear-gradient(135deg, var(--z-accent), var(--z-accent-dark));
    border-color: var(--z-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

#marketplace-preset-free i {
    color: #48bb78;
}

/* ===== FEATURES SECTION ===== */

#marketplace-feature-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#marketplace-feature-free,
#marketplace-feature-featured,
#marketplace-feature-trending,
#marketplace-feature-verified {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(45, 55, 72, 0.4);
    border: 1px solid rgba(74, 85, 104, 0.3);
}

#marketplace-feature-free:hover,
#marketplace-feature-featured:hover,
#marketplace-feature-trending:hover,
#marketplace-feature-verified:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
}

#marketplace-feature-free input,
#marketplace-feature-featured input,
#marketplace-feature-trending input,
#marketplace-feature-verified input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

#marketplace-checkmark-free,
#marketplace-checkmark-featured,
#marketplace-checkmark-trending,
#marketplace-checkmark-verified {
    width: 20px;
    height: 20px;
    background: rgba(45, 55, 72, 0.8);
    border: 2px solid rgba(74, 85, 104, 0.5);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#marketplace-checkmark-free::after,
#marketplace-checkmark-featured::after,
#marketplace-checkmark-trending::after,
#marketplace-checkmark-verified::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform-origin: center;
    transition: transform 0.2s ease;
}

#marketplace-feature-free input:checked ~ #marketplace-checkmark-free,
#marketplace-feature-featured input:checked ~ #marketplace-checkmark-featured,
#marketplace-feature-trending input:checked ~ #marketplace-checkmark-trending,
#marketplace-feature-verified input:checked ~ #marketplace-checkmark-verified {
    background: linear-gradient(135deg, var(--z-accent), var(--z-accent-dark));
    border-color: var(--z-accent);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

#marketplace-feature-free input:checked ~ #marketplace-checkmark-free::after,
#marketplace-feature-featured input:checked ~ #marketplace-checkmark-featured::after,
#marketplace-feature-trending input:checked ~ #marketplace-checkmark-trending::after,
#marketplace-feature-verified input:checked ~ #marketplace-checkmark-verified::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

#marketplace-feature-free-info,
#marketplace-feature-featured-info,
#marketplace-feature-trending-info,
#marketplace-feature-verified-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

#marketplace-feature-free-info i,
#marketplace-feature-featured-info i,
#marketplace-feature-trending-info i,
#marketplace-feature-verified-info i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

#marketplace-feature-free-info i {
    color: #48bb78;
}

#marketplace-feature-featured-info i {
    color: #ffd700;
}

#marketplace-feature-trending-info i {
    color: #ff4757;
}

#marketplace-feature-verified-info i {
    color: #4299e1;
}

#marketplace-feature-free-info span,
#marketplace-feature-featured-info span,
#marketplace-feature-trending-info span,
#marketplace-feature-verified-info span {
    color: var(--z-text);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== FILE FORMATS SECTION ===== */

#marketplace-format-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#marketplace-format-blend,
#marketplace-format-fbx,
#marketplace-format-obj,
#marketplace-format-gltf {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid rgba(74, 85, 104, 0.2);
}

#marketplace-format-blend:hover,
#marketplace-format-fbx:hover,
#marketplace-format-obj:hover,
#marketplace-format-gltf:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
}

#marketplace-format-blend input,
#marketplace-format-fbx input,
#marketplace-format-obj input,
#marketplace-format-gltf input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

#marketplace-checkmark-blend,
#marketplace-checkmark-fbx,
#marketplace-checkmark-obj,
#marketplace-checkmark-gltf {
    width: 18px;
    height: 18px;
    background: rgba(45, 55, 72, 0.8);
    border: 2px solid rgba(74, 85, 104, 0.5);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#marketplace-checkmark-blend::after,
#marketplace-checkmark-fbx::after,
#marketplace-checkmark-obj::after,
#marketplace-checkmark-gltf::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform-origin: center;
    transition: transform 0.2s ease;
}

#marketplace-format-blend input:checked ~ #marketplace-checkmark-blend,
#marketplace-format-fbx input:checked ~ #marketplace-checkmark-fbx,
#marketplace-format-obj input:checked ~ #marketplace-checkmark-obj,
#marketplace-format-gltf input:checked ~ #marketplace-checkmark-gltf {
    background: linear-gradient(135deg, var(--z-accent), var(--z-accent-dark));
    border-color: var(--z-accent);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

#marketplace-format-blend input:checked ~ #marketplace-checkmark-blend::after,
#marketplace-format-fbx input:checked ~ #marketplace-checkmark-fbx::after,
#marketplace-format-obj input:checked ~ #marketplace-checkmark-obj::after,
#marketplace-format-gltf input:checked ~ #marketplace-checkmark-gltf::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

#marketplace-format-blend-name,
#marketplace-format-fbx-name,
#marketplace-format-obj-name,
#marketplace-format-gltf-name {
    color: var(--z-text);
    font-weight: 500;
    font-size: 0.85rem;
    flex: 1;
}

/* ===== QUALITY LEVEL (PILLS) ===== */
#marketplace-filter-quality {position:relative;}
#marketplace-quality-options {display:flex;flex-wrap:wrap;gap:.55rem;padding:.25rem .35rem .5rem;}
.quality-pill {position:relative;display:inline-flex;align-items:center;gap:.45rem;padding:.55rem .75rem .55rem .65rem;border:1px solid rgba(0,0,0,0.08);border-radius:999px;font:500 .7rem/1 'Inter',system-ui,sans-serif;color:#374151;background:linear-gradient(145deg,#fff,#f5f7fa);cursor:pointer;user-select:none;transition:.25s;box-shadow:0 1px 2px rgba(0,0,0,.06);}
body.marketplace-professional-theme.dark .quality-pill{background:linear-gradient(145deg,#262b35,#1d2129);border-color:rgba(255,255,255,0.08);color:var(--z-text-sec);}
.quality-pill:hover{border-color:var(--category-color,#6366f1);box-shadow:0 2px 6px -2px rgba(0,0,0,.25);transform:translateY(-2px);}
.quality-pill:active{transform:translateY(0);} 
.quality-pill input{position:absolute;opacity:0;pointer-events:none;}
/* Visual wrapper */
.quality-pill .pill-visual{position:relative;display:inline-flex;align-items:center;gap:.55rem;font-weight:600;letter-spacing:.35px;padding-right:.15rem;}
.quality-pill .pill-icon{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,var(--category-color,#6366f1) 0%,var(--category-color,#4f46e5) 100%);color:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,0.35),0 0 0 1px rgba(255,255,255,0.4) inset;font-size:.7rem;transition:.35s;flex-shrink:0;}
body.marketplace-professional-theme.dark .quality-pill .pill-icon{box-shadow:0 2px 5px -1px rgba(0,0,0,0.7),0 0 0 1px rgba(255,255,255,0.08) inset;}
.quality-pill .pill-text{display:flex;flex-direction:column;line-height:1;}
.quality-pill .pill-label{font-weight:600;font-size:.65rem;text-transform:uppercase;letter-spacing:.6px;}
.quality-pill .pill-sub{font-weight:500;font-size:.55rem;opacity:.65;letter-spacing:.4px;}
.quality-pill .pill-count{background:rgba(99,102,241,.12);color:var(--category-color,#6366f1);padding:.25rem .45rem;border-radius:20px;font-size:.55rem;font-weight:700;min-width:24px;text-align:center;line-height:1;box-shadow:0 0 0 1px rgba(99,102,241,.25) inset;transition:.35s;}
body.marketplace-professional-theme.dark .quality-pill .pill-count{background:rgba(99,102,241,.18);}
/* Indicator layer */
.quality-pill .pill-indicator{position:absolute;inset:0;border-radius:inherit;background:linear-gradient(120deg,var(--category-color,#6366f1) 0%,var(--category-color,#4f46e5) 100%);opacity:0;transition:.4s;z-index:-1;filter:brightness(1.08);}
/* Checked State Enhancements */
.quality-pill input:checked + .pill-visual + .pill-indicator,
.quality-pill input:checked ~ .pill-indicator{opacity:.22;}
.quality-pill input:checked + .pill-visual .pill-label,
.quality-pill input:checked ~ .pill-visual .pill-label{color:var(--z-bg);}
body.marketplace-professional-theme.dark .quality-pill input:checked + .pill-visual .pill-label{color:var(--z-text);}
.quality-pill input:checked + .pill-visual .pill-icon{transform:scale(1.08) rotate(8deg);box-shadow:0 4px 10px -2px rgba(0,0,0,.4),0 0 0 1px rgba(255,255,255,0.7) inset;}
.quality-pill input:checked + .pill-visual .pill-count{background:linear-gradient(135deg,var(--category-color,#6366f1) 0%,var(--category-color,#4f46e5) 100%);color:#fff;box-shadow:0 2px 6px -2px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,0.35) inset;}
/* Focus Accessibility */
.quality-pill input:focus-visible + .pill-visual{outline:2px solid var(--category-color,#6366f1);outline-offset:3px;border-radius:inherit;}
body.marketplace-professional-theme.dark .quality-pill input:focus-visible + .pill-visual{outline:2px solid var(--category-color,#818cf8);}
/* Hover transitions refined */
.quality-pill:hover .pill-icon{transform:translateY(-2px);}
.quality-pill:hover .pill-count{background:rgba(99,102,241,.22);}
body.marketplace-professional-theme.dark .quality-pill:hover .pill-count{background:rgba(129,140,248,.28);}
/* Reduced Motion Support */
@media (prefers-reduced-motion:reduce){
    .quality-pill,.quality-pill .pill-icon,.quality-pill .pill-count{transition:none!important;}
}
.quality-actions{display:flex;justify-content:flex-end;padding:0 .35rem .25rem;}
#marketplace-quality-clear{background:none;border:none;font:600 .65rem/1 'Inter',system-ui,sans-serif;color:var(--category-color,#6366f1);cursor:pointer;letter-spacing:.5px;padding:.35rem .55rem;border-radius:6px;position:relative;}
#marketplace-quality-clear:hover{background:rgba(99,102,241,0.08);} 
body.marketplace-professional-theme.dark #marketplace-quality-clear:hover{background:rgba(99,102,241,0.15);} 
#marketplace-quality-clear:active{transform:translateY(1px);} 
@media (prefers-reduced-motion:reduce){.quality-pill{transition:none!important;}}

/* ===== QUALITY HEADER ENHANCED ===== */
#marketplace-filter-quality-title.quality-title-enhanced { /* overrides base section title visuals */
    display:flex;
    align-items:center;
    gap:14px;
    background:linear-gradient(135deg, rgba(52,73,94,0.6) 0%, rgba(44,62,80,0.82) 100%);
    padding:18px 24px;
    position:relative;
    font:600 .95rem/1 'Inter',system-ui,sans-serif;
    letter-spacing:.4px;
    color:var(--z-text);
}
#marketplace-filter-quality-title.quality-title-enhanced:hover {background:linear-gradient(135deg, rgba(255,107,53,0.12) 0%, rgba(229,90,46,0.12) 100%); color:var(--z-accent);}
#marketplace-filter-quality-title.quality-title-enhanced:focus-visible {outline:2px solid var(--z-accent); outline-offset:3px; border-radius:14px;}

/* Icon wrapper with subtle glow */
.qt-icon-wrap {position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:14px;background:linear-gradient(145deg,var(--category-color,#6366f1),var(--category-color,#4f46e5));color:#fff;font-size:1rem;flex-shrink:0;box-shadow:0 4px 14px -4px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,0.2) inset;overflow:hidden;}
.qt-icon-wrap i {position:relative;z-index:2;}
.qt-icon-wrap .qt-glow {position:absolute;inset:-30%;background:conic-gradient(from 0deg, rgba(255,255,255,.35), transparent 40%, rgba(255,255,255,.25) 70%, transparent 100%);animation:qtSpinGlow 6s linear infinite;opacity:.6;mix-blend-mode:overlay;}
@keyframes qtSpinGlow {to {transform:rotate(360deg);} }
@media (prefers-reduced-motion:reduce){ .qt-icon-wrap .qt-glow {animation:none;} }

/* Text grouping */
.qt-text-group {display:flex;flex-direction:column;line-height:1;min-width:0;}
.qt-main {font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.9px;}
.qt-sub {font-size:.58rem;font-weight:500;opacity:.7;letter-spacing:.6px;margin-top:3px;}

/* Active count badge */
.qt-count-badge {background:linear-gradient(135deg,var(--category-color,#6366f1),var(--category-color,#4f46e5));color:#fff;font:600 .6rem/1 'Inter',system-ui,sans-serif;padding:.4rem .55rem;border-radius:30px;min-width:26px;text-align:center;box-shadow:0 4px 10px -3px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.25) inset;display:inline-flex;align-items:center;justify-content:center;transition:.35s;} 
.qt-count-badge[hidden]{display:none!important;}

/* Chevron */
.qt-chevron {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:12px;transition:.4s cubic-bezier(.4,0,.2,1);color:var(--z-text-sec);background:rgba(255,255,255,0.05);box-shadow:0 0 0 1px rgba(255,255,255,0.08) inset;}
.qt-chevron i {transition:transform .45s cubic-bezier(.4,0,.2,1);} 
#marketplace-filter-quality-title[aria-expanded="false"] .qt-chevron i {transform:rotate(-90deg);} 
#marketplace-filter-quality-title.quality-title-enhanced:hover .qt-chevron {color:var(--z-accent);}

/* Dark theme adjustments */
body.marketplace-professional-theme.dark #marketplace-filter-quality-title.quality-title-enhanced {background:linear-gradient(135deg, rgba(22,27,34,.75) 0%, rgba(44,62,80,.85) 100%);color:var(--z-text);}
body.marketplace-professional-theme.dark .qt-icon-wrap {box-shadow:0 4px 14px -4px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.08) inset;}
body.marketplace-professional-theme.dark .qt-count-badge {box-shadow:0 4px 12px -3px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.1) inset;}
body.marketplace-professional-theme.dark #marketplace-filter-quality-title.quality-title-enhanced:hover {color:var(--z-accent);}

/* High contrast & reduced motion considerations */
@media (prefers-contrast:high){ .qt-icon-wrap {box-shadow:0 0 0 2px #fff inset;} }
@media (prefers-reduced-motion:reduce){ .qt-chevron i {transition:none;} }


/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
    #marketplace-content-layout {
        grid-template-columns: 280px 1fr;
        gap: 24px;
    }
    
    #marketplace-filters-sidebar {
        top: 100px;
        max-height: calc(100vh - 120px);
    }
    
    #marketplace-sidebar-header {
        padding: 20px 24px;
    }
    
    #marketplace-filter-categories-content,
    #marketplace-filter-price-content,
    #marketplace-filter-features-content,
    #marketplace-filter-formats-content {
        padding: 20px 24px;
    }
}

@media (max-width: 992px) {
    #marketplace-content-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    #marketplace-filters-sidebar {
        display: none;
    }
}

/* ===== MOBILE FILTER ADAPTATIONS ===== */

@media (max-width: 768px) {
    #marketplace-mobile-filter-body .enhanced-category-list {
        max-height: 300px;
    }
    
    #marketplace-mobile-filter-body .category-link-enhanced {
        padding: 10px 14px;
        gap: 10px;
    }
    
    #marketplace-mobile-filter-body .category-icon-enhanced {
        width: 28px;
        height: 28px;
    }
    
    #marketplace-mobile-filter-body .subcategory-link-enhanced {
        padding: 6px 10px;
        gap: 8px;
    }
    
    #marketplace-mobile-filter-body .subcategory-icon {
        width: 20px;
        height: 20px;
    }
    
    #marketplace-mobile-filter-body #marketplace-price-presets {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    #marketplace-mobile-filter-body .category-actions-footer {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===== ACCESSIBILITY FEATURES ===== */

/* Focus States */
#marketplace-category-search:focus,
#marketplace-price-min:focus,
#marketplace-price-max:focus,
.category-link-enhanced:focus,
.subcategory-link-enhanced:focus,
.category-action-btn:focus,
.recent-cat-chip:focus,
#marketplace-reset-filters:focus {
    outline: 2px solid var(--z-accent);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    #marketplace-filters-sidebar {
        border-width: 2px;
        border-color: var(--z-surface-3);
    }
    
    .category-link-enhanced,
    .subcategory-link-enhanced {
        border: 1px solid rgba(74, 85, 104, 0.4);
    }
    
    .category-link-enhanced.active,
    .subcategory-link-enhanced.active {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .category-link-enhanced,
    .subcategory-link-enhanced,
    .category-icon-enhanced,
    .category-indicator,
    .subcategory-icon,
    .subcategory-indicator,
    #marketplace-checkmark-free,
    #marketplace-checkmark-featured,
    #marketplace-checkmark-trending,
    #marketplace-checkmark-verified,
    #marketplace-checkmark-blend,
    #marketplace-checkmark-fbx,
    #marketplace-checkmark-obj,
    #marketplace-checkmark-gltf {
        transition: none;
    }
    
    .category-link-enhanced:hover,
    .subcategory-link-enhanced:hover {
        transform: none;
    }
}

/* Dark Mode Enhanced */
@media (prefers-color-scheme: dark) {
    #marketplace-filters-sidebar {
        background: linear-gradient(135deg, var(--z-bg-deep) 0%, var(--z-surface-1) 25%, var(--z-surface-2) 75%, var(--z-bg) 100%);
        border-color: rgba(48, 54, 61, 0.6);
    }
    
    #marketplace-sidebar-header {
        background: linear-gradient(135deg, var(--z-bg) 0%, var(--z-bg-deep) 100%);
    }
    
    #marketplace-filter-categories-content,
    #marketplace-filter-price-content,
    #marketplace-filter-features-content,
    #marketplace-filter-formats-content {
        background: linear-gradient(180deg, rgba(13, 17, 23, 0.6) 0%, rgba(21, 32, 43, 0.8) 100%);
    }
}

/* Print Styles */
@media print {
    #marketplace-filters-sidebar {
        display: none !important;
    }
    
    #marketplace-content-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ===== LOADING STATES ===== */

.filters-loading #marketplace-sidebar-content {
    opacity: 0.5;
    pointer-events: none;
}

.filters-loading .category-link-enhanced,
.filters-loading .subcategory-link-enhanced {
    background: linear-gradient(90deg, var(--z-surface-2) 25%, var(--z-surface-3) 50%, var(--z-surface-2) 75%);
    background-size: 200% 100%;
    animation: filtersLoading 1.5s infinite;
    color: transparent;
}

@keyframes filtersLoading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =============================================================
   CATEGORIES SECTION - PROFESSIONAL ENHANCEMENT ( -847 SUFFIX )
   Glassmorphic, accessible, performant. Mirrors existing palette
   Accent: var(--z-accent)  |  BG gradient + subtle depth + focus states
   All selectors are *scoped* with -847 to avoid collisions.
============================================================= */

/* Wrapper & Title */
#marketplace-filter-categories-847 { position: relative; border-bottom: 1px solid rgba(74,85,104,0.2); }
#marketplace-filter-categories-title-847 {
    background: linear-gradient(135deg, rgba(52,73,94,0.65) 0%, rgba(44,62,80,0.85) 100%);
    padding: 20px 28px; margin:0; display:flex; align-items:center; gap:12px;
    font-size:1rem; font-weight:600; color:var(--z-text); cursor:pointer; user-select:none;
    transition:all .35s cubic-bezier(.4,0,.2,1); position:relative;
}
#marketplace-filter-categories-title-847:hover { color:var(--z-accent); background:linear-gradient(135deg, rgba(255,107,53,0.12) 0%, rgba(229,90,46,0.12) 100%); }
#marketplace-filter-categories-title-847 i { color:var(--z-accent); font-size:.9rem; }
.filter-title-actions-847 { margin-left:auto; display:flex; align-items:center; gap:12px; }
.filter-count-847 { background:rgba(255,107,53,.22); color:var(--z-accent); padding:4px 8px; border-radius:12px; font-size:.75rem; font-weight:600; line-height:1; min-width:26px; text-align:center; box-shadow:0 0 0 1px rgba(255,107,53,.25) inset; }
.filter-toggle-icon-847 { transition:transform .35s ease; color:var(--z-text-sec); font-size:.8rem; }
#marketplace-filter-categories-title-847.collapsed .filter-toggle-icon-847 { transform:rotate(-90deg); }

/* Subcategory Toggle Button (modern design) */
.category-sub-toggle-847 {
        --toggle-bg: linear-gradient(135deg, rgba(52,73,94,.55) 0%, rgba(44,62,80,.85) 100%);
        --toggle-border: rgba(74,85,104,.45);
        --toggle-size: 30px;
        width: var(--toggle-size);
        height: var(--toggle-size);
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--toggle-bg);
        border: 1px solid var(--toggle-border);
        border-radius: 12px;
        cursor: pointer;
        color: #ff7a48;
        position: relative;
        flex-shrink: 0;
        transition: background .45s cubic-bezier(.4,0,.2,1),
                                border-color .45s cubic-bezier(.4,0,.2,1),
                                transform .45s cubic-bezier(.4,0,.2,1),
                                box-shadow .45s cubic-bezier(.4,0,.2,1),
                                color .45s cubic-bezier(.4,0,.2,1);
        box-shadow: 0 4px 14px -6px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.35), 0 0 0 1px rgba(255,107,53,.25) inset;
        backdrop-filter: blur(14px);
}
.category-sub-toggle-847:hover {
        background: linear-gradient(135deg, rgba(255,107,53,.25) 0%, rgba(229,90,46,.25) 100%);
        border-color: var(--z-accent);
        color: #fff;
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 6px 20px -6px rgba(255,107,53,.55), 0 2px 6px rgba(0,0,0,.4);
}
.category-sub-toggle-847:active { transform: translateY(-1px) scale(1.01); }
.category-sub-toggle-847[aria-expanded="true"] {
        background: linear-gradient(135deg,var(--z-accent),var(--z-accent-dark));
        border-color: var(--z-accent);
        color: #fff;
        box-shadow: 0 6px 18px -4px rgba(255,107,53,.6), 0 0 0 1px rgba(255,255,255,.25) inset;
}
.category-sub-toggle-847 i {
        font-size: .7rem;
        transition: transform .4s cubic-bezier(.4,0,.2,1), color .4s ease;
        pointer-events: none;
}
.category-sub-toggle-847[aria-expanded="true"] i { transform: rotate(90deg); }
.category-sub-toggle-847:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 3px; }

/* Compact + mobile adjustments */
@media (max-width: 992px) {
    .category-sub-toggle-847 { --toggle-size: 28px; border-radius: 10px; }
}
@media (max-width: 600px) {
    .category-sub-toggle-847 { --toggle-size: 26px; }
    .category-sub-toggle-847:hover { transform: translateY(-2px) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
    .category-sub-toggle-847, .category-sub-toggle-847 i { transition: none; }
}
@media (prefers-contrast: high) {
    .category-sub-toggle-847 { border-width: 2px; }
}

/* Content Container */
#marketplace-filter-categories-content-847 {
    padding:24px 24px 28px; display:block; background:linear-gradient(180deg, rgba(45,55,72,.55) 0%, rgba(26,32,44,.75) 100%);
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
    position:relative; overflow:hidden; animation:catFadeIn847 .45s ease;
}
@keyframes catFadeIn847 { from { opacity:0; transform:translateY(-6px);} to { opacity:1; transform:translateY(0);} }

/* Search Bar */
#marketplace-category-search-container-847 { margin-bottom:18px; }
.category-search-input-group-847 {
    position:relative; display:flex; align-items:center; background:rgba(45,55,72,.6);
    border:1px solid rgba(74,85,104,.45); border-radius:12px; padding:10px 14px 10px 40px;
    transition:all .3s ease; box-shadow:0 2px 4px rgba(0,0,0,.18), 0 4px 12px -4px rgba(0,0,0,.32) inset;
}
.category-search-input-group-847:hover { border-color:rgba(255,107,53,.45); background:rgba(45,55,72,.72); }
.category-search-input-group-847:focus-within { border-color:var(--z-accent); box-shadow:0 0 0 3px rgba(255,107,53,.18); }
.category-search-icon-847 { position:absolute; left:14px; color:var(--z-accent); font-size:.9rem; pointer-events:none; }
#marketplace-category-search-847 { width:100%; background:transparent; border:none; outline:none; color:var(--z-text); font-size:.85rem; font-weight:500; letter-spacing:.3px; }
#marketplace-category-search-847::placeholder { color:var(--z-text-muted); font-weight:400; }
#marketplace-category-search-clear-847 { position:absolute; right:8px; background:transparent; border:none; color:var(--z-text-sec); width:32px; height:32px; display:flex; align-items:center; justify-content:center; cursor:pointer; border-radius:8px; transition:all .25s ease; }
#marketplace-category-search-clear-847:hover { color:var(--z-accent); background:rgba(255,107,53,.12); }

/* List Wrapper */
#marketplace-category-list-847 { display:flex; flex-direction:column; gap:4px; max-height:320px; overflow-y:auto; padding-right:4px; scrollbar-width:thin; scrollbar-color:var(--z-surface-3) transparent; }
#marketplace-category-list-847::-webkit-scrollbar { width:6px; }
#marketplace-category-list-847::-webkit-scrollbar-track { background:transparent; }
#marketplace-category-list-847::-webkit-scrollbar-thumb { background:linear-gradient(to bottom,var(--z-accent),var(--z-accent-dark)); border-radius:4px; }
#marketplace-category-list-847::-webkit-scrollbar-thumb:hover { background:linear-gradient(to bottom,var(--z-accent-dark),var(--z-accent-dark)); }

.category-divider-847 { position:relative; margin:8px 0 6px; text-align:center; }
.category-divider-847::before, .category-divider-847::after { content:""; position:absolute; top:50%; width:38%; height:1px; background:linear-gradient(90deg,transparent,rgba(255,107,53,.35),transparent); }
.category-divider-847::before { left:0; }
.category-divider-847::after { right:0; }
.divider-text-847 { font-size:.65rem; letter-spacing:1.2px; text-transform:uppercase; color:var(--z-accent); font-weight:600; padding:2px 10px; background:rgba(45,55,72,.7); border:1px solid rgba(255,107,53,.35); border-radius:20px; box-shadow:0 0 0 2px rgba(26,32,44,.6); }
/* ==== CATEGORY ICON PROFESSIONAL COLOR PALETTE + WHITE TEXT OVERRIDES ==== */
#marketplace-category-list-847 .category-link-enhanced-847,
#marketplace-category-list-847 .category-link-enhanced-847 .category-name-enhanced-847,
#marketplace-category-list-847 .category-link-enhanced-847 .category-description-847,
#marketplace-category-list-847 .category-link-enhanced-847 .category-count-enhanced-847,
#marketplace-category-list-847 .subcategory-link-enhanced-847,
#marketplace-category-list-847 .subcategory-link-enhanced-847 .sub-name-847,
#marketplace-category-list-847 .subcategory-link-enhanced-847 .sub-meta-847 {
    color:#ffffff !important;
}
/* Base icon container tweak */
#marketplace-category-list-847 .category-icon-enhanced-847 {
    background:rgba(255,255,255,0.08);
    box-shadow:0 0 0 1px rgba(255,255,255,0.15) inset, 0 4px 10px -2px rgba(0,0,0,0.55);
}

/* Professional palette (loop order) */
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(1)  .category-icon-enhanced-847 { color:var(--z-info); background:var(--z-accent-glow); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(2)  .category-icon-enhanced-847 { color:var(--z-indigo-light); background:rgba(99,102,241,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(3)  .category-icon-enhanced-847 { color:var(--z-purple-light); background:var(--z-accent-glow); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(4)  .category-icon-enhanced-847 { color:var(--z-pink); background:rgba(236,72,153,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(5)  .category-icon-enhanced-847 { color:var(--z-accent); background:var(--z-accent-glow); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(6)  .category-icon-enhanced-847 { color:var(--z-success); background:var(--z-success-bg); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(7)  .category-icon-enhanced-847 { color:#0ea5e9; background:rgba(14,165,233,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(8)  .category-icon-enhanced-847 { color:#f43f5e; background:rgba(244,63,94,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(9)  .category-icon-enhanced-847 { color:var(--z-success); background:rgba(34,197,94,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(10) .category-icon-enhanced-847 { color:#14b8a6; background:rgba(20,184,166,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(11) .category-icon-enhanced-847 { color:#eab308; background:rgba(234,179,8,0.20); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(12) .category-icon-enhanced-847 { color:var(--z-danger); background:var(--z-danger-bg); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(13) .category-icon-enhanced-847 { color:#9333ea; background:rgba(147,51,234,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(14) .category-icon-enhanced-847 { color:#0d9488; background:rgba(13,148,136,0.18); }
#marketplace-category-list-847 .category-item-enhanced-847:nth-of-type(15) .category-icon-enhanced-847 { color:var(--z-text-muted); background:rgba(100,116,139,0.22); }

/* Hover keeps palette (avoid orange override) */
#marketplace-category-list-847 .category-link-enhanced-847:hover .category-icon-enhanced-847:not(.active) {
    filter:brightness(1.15);
}

/* Active state keeps contrast */
#marketplace-category-list-847 .category-link-enhanced-847.active .category-icon-enhanced-847 {
    background:rgba(0,0,0,0.35);
    color:#ffffff;
}

/* Subcategory icons inherit a soft neutral but keep white text */
#marketplace-category-list-847 .subcategory-icon-847 {
    color:#ffffff;
    background:rgba(255,255,255,0.12);
    box-shadow:0 0 0 1px rgba(255,255,255,0.15) inset;
}
#marketplace-category-list-847 .subcategory-link-enhanced-847.active .subcategory-icon-847 {
    background:rgba(0,0,0,0.4);
}

/* Force description & counts white with slight dim */
#marketplace-category-list-847 .category-description-847,
#marketplace-category-list-847 .category-count-enhanced-847 { color:rgba(255,255,255,0.85)!important; }
/* Category Items */
.category-item-enhanced-847 { position:relative; }
.category-link-enhanced-847 { 
    --catGrad: linear-gradient(135deg, rgba(52,73,94,.45) 0%, rgba(44,62,80,.75) 100%);
    display:flex; align-items:center; gap:14px; text-decoration:none; padding:12px 14px 12px 14px; border-radius:14px;
    background:var(--catGrad); border:1px solid rgba(74,85,104,.32); position:relative; transition:all .35s ease;
    color:var(--z-text-sec); font-size:.85rem; font-weight:500; line-height:1.1; overflow:hidden;
}
.category-link-enhanced-847:hover { border-color:rgba(255,107,53,.45); color:#fff; transform:translateY(-2px); box-shadow:0 6px 18px -6px rgba(0,0,0,.6), 0 0 0 1px rgba(255,107,53,.25); }
.category-link-enhanced-847.active { background:linear-gradient(135deg,var(--z-accent),var(--z-accent-dark)); color:#fff; border-color:var(--z-accent); box-shadow:0 4px 14px -4px rgba(255,107,53,.6); }
.category-link-enhanced-847.active .category-indicator-847 { background:#fff; transform:scale(1); opacity:1; }

.category-icon-enhanced-847 { width:32px; height:32px; border-radius:10px; background:radial-gradient(circle at 30% 30%, rgba(255,255,255,.15), rgba(255,255,255,.02)); display:flex; align-items:center; justify-content:center; color:var(--z-accent); font-size:1rem; flex-shrink:0; box-shadow:0 0 0 1px rgba(255,107,53,.35) inset, 0 4px 10px -2px rgba(0,0,0,.55); transition:all .35s ease; }
.category-link-enhanced-847:hover .category-icon-enhanced-847 { background:rgba(255,107,53,.18); color:var(--z-accent); }
.category-link-enhanced-847.active .category-icon-enhanced-847 { background:rgba(0,0,0,.25); color:#fff; box-shadow:0 0 0 1px rgba(255,255,255,.2) inset; }

.category-info-enhanced-847 { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.category-info-enhanced-847 .cat-name-847 { font-weight:600; font-size:.83rem; letter-spacing:.3px; color:inherit; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.category-info-enhanced-847 .cat-meta-847 { font-size:.65rem; font-weight:500; letter-spacing:.5px; text-transform:uppercase; color:var(--z-text-sec); opacity:.8; display:flex; gap:6px; }
.category-link-enhanced-847.active .category-info-enhanced-847 .cat-meta-847 { color:#ffe2d5; opacity:1; }

.category-indicator-847 { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,var(--z-accent),var(--z-accent-dark)); opacity:0; transform:scale(.4); transition:all .4s cubic-bezier(.4,0,.2,1); box-shadow:0 0 0 2px rgba(255,107,53,.25); }

/* Subcategory List */
[id^="marketplace-subcategory-list-"][id$="-847"] { margin:6px 0 10px 46px; display:flex; flex-direction:column; gap:4px; position:relative; padding-left:10px; }
[id^="marketplace-subcategory-list-"][id$="-847"]::before { content:""; position:absolute; left:0; top:4px; bottom:4px; width:2px; background:linear-gradient(180deg, rgba(255,107,53,.5), rgba(229,90,46,.15)); border-radius:4px; }
.subcategory-link-enhanced-847 { display:flex; align-items:center; gap:10px; padding:8px 10px; font-size:.75rem; color:var(--z-text-sec); text-decoration:none; border-radius:10px; position:relative; background:rgba(45,55,72,.35); border:1px solid rgba(74,85,104,.22); transition:all .3s ease; }
.subcategory-link-enhanced-847:hover { color:#fff; border-color:rgba(255,107,53,.45); background:rgba(52,73,94,.55); transform:translateX(4px); }
.subcategory-link-enhanced-847.active { background:linear-gradient(135deg,var(--z-accent),var(--z-accent-dark)); color:#fff; border-color:var(--z-accent); box-shadow:0 3px 10px -2px rgba(255,107,53,.55); }
.subcategory-icon-847 { width:22px; height:22px; border-radius:7px; background:rgba(255,107,53,.14); display:flex; align-items:center; justify-content:center; color:var(--z-accent); font-size:.65rem; flex-shrink:0; box-shadow:0 0 0 1px rgba(255,107,53,.35) inset; }
.subcategory-link-enhanced-847.active .subcategory-icon-847 { background:rgba(0,0,0,.25); color:#fff; }
.subcategory-info-847 { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.subcategory-info-847 .sub-name-847 { font-weight:600; font-size:.7rem; letter-spacing:.4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.subcategory-info-847 .sub-meta-847 { font-size:.55rem; text-transform:uppercase; letter-spacing:.6px; opacity:.7; }
.subcategory-indicator-847 { width:6px; height:6px; border-radius:50%; background:var(--z-accent); flex-shrink:0; opacity:0; transform:scale(.3); transition:all .3s ease; }
.subcategory-link-enhanced-847.active .subcategory-indicator-847 { opacity:1; transform:scale(1); background:#fff; box-shadow:0 0 0 2px rgba(255,107,53,.4); }

/* Category Actions Footer */
#marketplace-category-actions-847 { margin-top:18px; display:flex; justify-content:space-between; gap:12px; }
.category-actions-footer-847 { display:flex; width:100%; gap:12px; }
.category-action-btn-847 { flex:1; background:rgba(45,55,72,.55); border:1px solid rgba(74,85,104,.35); color:var(--z-text-sec); font-size:.65rem; letter-spacing:.8px; text-transform:uppercase; font-weight:600; padding:10px 12px; border-radius:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:all .3s ease; position:relative; overflow:hidden; }
.category-action-btn-847:hover { background:rgba(255,107,53,.18); color:var(--z-accent); border-color:rgba(255,107,53,.55); box-shadow:0 4px 12px -2px rgba(255,107,53,.4); transform:translateY(-2px); }
.category-action-btn-847:active { transform:translateY(0); }

/* Recent Categories */
#marketplace-recent-categories-847 { margin-top:28px; padding-top:20px; border-top:1px solid rgba(74,85,104,.25); }
.recent-categories-section-847 { display:flex; flex-direction:column; gap:12px; }
.recent-categories-title-847 { margin:0; font-size:.7rem; letter-spacing:1px; text-transform:uppercase; font-weight:700; color:var(--z-accent); display:flex; align-items:center; gap:8px; }
#marketplace-recent-categories-list-847 { display:flex; flex-wrap:wrap; gap:8px; }
.recent-cat-chip-847 { background:rgba(45,55,72,.55); border:1px solid rgba(74,85,104,.4); color:var(--z-text-sec); padding:6px 10px; border-radius:30px; font-size:.6rem; font-weight:600; letter-spacing:.6px; display:flex; align-items:center; gap:6px; cursor:pointer; position:relative; transition:all .3s ease; }
.recent-cat-chip-847:hover { background:rgba(255,107,53,.15); border-color:rgba(255,107,53,.55); color:var(--z-accent); transform:translateY(-2px); }
.recent-cat-chip-847:active { transform:translateY(0); }
.recent-cat-chip-847 .chip-remove-847 { background:transparent; border:none; color:var(--z-text-muted); cursor:pointer; font-size:.7rem; display:flex; align-items:center; justify-content:center; padding:0; transition:color .25s ease; }
.recent-cat-chip-847:hover .chip-remove-847 { color:var(--z-accent); }

/* Empty / No Categories */
.no-categories-message-847 { padding:16px; border:1px dashed rgba(74,85,104,.4); border-radius:10px; text-align:center; font-size:.75rem; color:var(--z-text-muted); background:rgba(45,55,72,.4); }
.no-categories-message-847 i { font-size:1rem; display:block; margin-bottom:6px; color:var(--z-text-sec); }

/* State Modifiers */
.category-link-enhanced-847.loading, .subcategory-link-enhanced-847.loading { position:relative; color:transparent !important; }
.category-link-enhanced-847.loading::after, .subcategory-link-enhanced-847.loading::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg, var(--z-surface-2) 25%, var(--z-surface-3) 50%, var(--z-surface-2) 75%); background-size:200% 100%; animation:filtersLoading 1.5s infinite; border-radius:inherit; }

/* Focus & Accessibility */
.category-link-enhanced-847:focus-visible, .subcategory-link-enhanced-847:focus-visible, .category-action-btn-847:focus-visible, .recent-cat-chip-847:focus-visible, #marketplace-category-search-847:focus { outline:2px solid var(--z-accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce) { .category-link-enhanced-847, .subcategory-link-enhanced-847, .category-action-btn-847, .recent-cat-chip-847 { transition:none; } }
@media (prefers-contrast: high) { .category-link-enhanced-847, .subcategory-link-enhanced-847 { border-width:2px; } }

/* Dark Mode Tweaks */
@media (prefers-color-scheme: dark) {
    #marketplace-filter-categories-content-847 { background:linear-gradient(180deg, rgba(13,17,23,.65) 0%, rgba(21,32,43,.85) 100%); }
    .category-link-enhanced-847 { --catGrad: linear-gradient(135deg, rgba(22,27,34,.7) 0%, rgba(44,62,80,.7) 100%); }
}

/* Responsive */
@media (max-width:1200px){ #marketplace-filter-categories-content-847 { padding:20px 20px 24px; } }
@media (max-width:768px){
    #marketplace-filter-categories-content-847 { padding:18px 18px 22px; }
    .category-link-enhanced-847 { padding:10px 12px; border-radius:12px; }
    .category-icon-enhanced-847 { width:28px; height:28px; }
    [id^="marketplace-subcategory-list-"][id$="-847"] { margin-left:40px; }
}
@media (max-width:480px){
    .category-link-enhanced-847 { padding:9px 10px; gap:10px; }
    .category-info-enhanced-847 .cat-name-847 { font-size:.78rem; }
    .recent-cat-chip-847 { font-size:.55rem; }
}

/* === Subcategory Container Aesthetic Upgrade (847 extension) === */
.subcategory-list-enhanced-847 {
    --subcat-bg: linear-gradient(145deg, rgba(45,55,72,0.55) 0%, rgba(26,32,44,0.75) 100%);
    --subcat-border: rgba(74,85,104,0.28);
    background: var(--subcat-bg);
    border: 1px solid var(--subcat-border);
    border-radius: 14px;
    padding: 14px 14px 16px 18px;
    margin: 10px 6px 14px 46px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px -6px rgba(0,0,0,0.55), 0 2px 4px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,107,53,0.15) inset;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color .4s ease, background .5s ease, box-shadow .5s ease;
}
.subcategory-list-enhanced-847::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 15%, rgba(255,107,53,0.18), transparent 60%),
                radial-gradient(circle at 82% 85%, rgba(229,90,46,0.15), transparent 65%);
    opacity: .85;
    pointer-events: none;
}
.subcategory-list-enhanced-847:hover { border-color: rgba(255,107,53,0.45); box-shadow:0 6px 20px -6px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,107,53,0.25) inset; }

.subcategory-header-847 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
    padding: 4px 4px 10px;
    position: relative;
}
.subcategory-header-847::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,107,53,0.45), transparent);
}
.subcategory-title-847 { font-size: .68rem; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color:var(--z-accent); display:flex; align-items:center; gap:6px; }
.subcategory-title-847 i { font-size:.65rem; }
.subcategory-total-count-847 { font-size:.58rem; font-weight:600; letter-spacing:.6px; background:rgba(255,107,53,.15); color:var(--z-accent); padding:4px 8px; border-radius:30px; box-shadow:0 0 0 1px rgba(255,107,53,.3) inset; }

/* Animated collapse container (JS sets inline height) */
.subcategory-list-enhanced-847[data-animating="true"] { overflow: hidden; }

/* Refined subcategory link visuals */
.subcategory-link-enhanced-847 { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.subcategory-link-enhanced-847::before {
    content:""; position:absolute; inset:0; background:linear-gradient(120deg, rgba(255,107,53,.15), rgba(255,107,53,0) 40%, rgba(255,107,53,.15)); opacity:0; transition:opacity .4s ease; pointer-events:none;
}
.subcategory-link-enhanced-847:hover::before { opacity:.35; }

/* Micro interaction pulse on active */
.subcategory-link-enhanced-847.active { animation: subcatActivate847 .9s cubic-bezier(.65,.05,.36,1); }
@keyframes subcatActivate847 { 0% { box-shadow:0 0 0 0 rgba(255,107,53,.7); } 70% { box-shadow:0 0 0 6px rgba(255,107,53,0); } 100% { box-shadow:0 0 0 0 rgba(255,107,53,0); } }

/* Smooth appear for inner items */
.subcategory-link-enhanced-847 { opacity:0; transform:translateY(4px); animation: subitemFade847 .45s forwards; }
.subcategory-link-enhanced-847:nth-child(2) { animation-delay:.05s; }
.subcategory-link-enhanced-847:nth-child(3) { animation-delay:.1s; }
.subcategory-link-enhanced-847:nth-child(4) { animation-delay:.15s; }
.subcategory-link-enhanced-847:nth-child(5) { animation-delay:.2s; }
@keyframes subitemFade847 { to { opacity:1; transform:translateY(0); } }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    .subcategory-link-enhanced-847 { animation:none; transform:none; }
    .subcategory-link-enhanced-847.active { animation:none; }
}

/* Dark mode subtle adjustments */
@media (prefers-color-scheme: dark) {
    .subcategory-list-enhanced-847 { --subcat-bg: linear-gradient(145deg, rgba(13,17,23,0.7) 0%, rgba(21,32,43,0.85) 100%); }
}

/* ===== MODERN SIDEBAR STYLES ===== */

.modern-sidebar {
    background: var(--z-surface-1);
    border: 1px solid var(--z-surface-2);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    position: sticky;
    top: 90px;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--z-surface-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--z-surface-2);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-filters-btn {
    background: transparent;
    border: 1px solid var(--z-surface-3);
    color: var(--z-text-sec);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.reset-filters-btn:hover {
    background: var(--z-surface-3);
    color: #fff;
    border-color: var(--z-text-muted);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--z-surface-1);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--z-surface-3);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--z-text-muted);
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid var(--z-surface-2);
}

.filter-section-title {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--z-text);
    font-weight: 500;
    transition: background 0.2s;
}

.filter-section-title:hover {
    background: var(--z-surface-2);
}

.filter-section-title .title-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-section-title i {
    color: var(--z-text-sec);
    width: 16px;
    text-align: center;
}

.filter-section-content {
    padding: 0 1.25rem 1.25rem;
}

/* Categories */
.category-search-wrapper {
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

.category-search-input-group {
    position: relative;
}

.category-search-input {
    width: 100%;
    background: var(--z-surface-2);
    border: 1px solid var(--z-surface-3);
    border-radius: 8px;
    padding: 0.6rem 2.5rem 0.6rem 2.5rem;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-search-input:focus {
    outline: none;
    border-color: var(--z-accent);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--z-text-sec);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--z-text-sec);
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--z-accent);
}

.category-list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.category-item-wrapper {
    margin-bottom: 4px;
    position: relative;
}

.category-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.category-item-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--z-text-sec);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.category-item:hover {
    color: #fff;
}

.category-item.active {
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.15) 0%, transparent 100%);
    color: var(--z-accent);
    border-left-color: var(--z-accent);
    border-radius: 0 8px 8px 0;
}

.category-icon {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.category-item:hover .category-icon,
.category-item.active .category-icon {
    opacity: 1;
}

.category-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.category-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    color: var(--z-text-muted);
    transition: all 0.2s;
}

.category-item:hover .category-count,
.category-item.active .category-count {
    background: rgba(255, 107, 53, 0.2);
    color: #ff9f7c;
}

.subcategory-toggle {
    background: transparent;
    border: none;
    color: var(--z-text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    margin-right: 4px;
}

.subcategory-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.subcategory-toggle[aria-expanded="true"] {
    transform: rotate(90deg);
    color: var(--z-accent);
}

.subcategory-list {
    margin-left: 22px;
    padding-left: 12px;
    border-left: 1px solid rgba(74, 85, 104, 0.3);
    margin-top: 4px;
    margin-bottom: 8px;
}

.subcategory-item {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--z-text-sec);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    margin-bottom: 2px;
    position: relative;
    text-decoration: none;
    transition: all 0.2s;
}

.subcategory-item::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 50%;
    width: 10px;
    height: 1px;
    background: rgba(74, 85, 104, 0.3);
    transition: background 0.2s;
}

.subcategory-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.subcategory-item:hover::before {
    background: var(--z-text-sec);
}

.subcategory-item.active {
    color: var(--z-accent);
    background: rgba(255, 107, 53, 0.1);
    font-weight: 500;
}

.subcategory-item.active::before {
    background: var(--z-accent);
}

.subcategory-count {
    font-size: 0.75rem;
    opacity: 0.5;
}

.badge-new {
    background: #e53e3e;
    color: white;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

/* Price Range */
.price-slider-wrapper {
    position: relative;
    height: 40px;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
}

.slider-track {
    width: 100%;
    height: 4px;
    background: var(--z-surface-3);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.range-input {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #3182ce;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.price-inputs-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-input-group {
    position: relative;
    flex: 1;
}

.currency-symbol {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--z-text-sec);
    font-size: 0.9rem;
}

.price-input {
    width: 100%;
    background: var(--z-surface-2);
    border: 1px solid var(--z-surface-3);
    border-radius: 6px;
    padding: 0.5rem 0.5rem 0.5rem 1.8rem;
    color: #fff;
    font-size: 0.9rem;
}

.price-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.preset-btn {
    background: var(--z-surface-2);
    border: 1px solid var(--z-surface-3);
    color: var(--z-text-sec);
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: var(--z-surface-3);
    color: #fff;
}

/* Checkboxes */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0;
}

.custom-checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--z-surface-3);
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox-wrapper input:checked ~ .checkmark {
    background: #3182ce;
    border-color: #3182ce;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    color: var(--z-text-sec);
    font-size: 0.95rem;
}

.custom-checkbox-wrapper:hover .checkbox-label {
    color: #fff;
}

/* Rating */
.rating-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0;
}

.rating-option input {
    margin-right: 0.75rem;
}

.rating-stars {
    color: #ecc94b;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.rating-text {
    color: var(--z-text-sec);
    font-size: 0.9rem;
}

/* Active Filters */
.active-filters-container {
    padding: 1rem 1.25rem;
    background: var(--z-surface-2);
    border-bottom: 1px solid var(--z-surface-3);
}

.active-filters-header {
    font-size: 0.85rem;
    color: var(--z-text-sec);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.active-filter-tag {
    background: #3182ce;
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.active-filter-tag i {
    cursor: pointer;
    opacity: 0.8;
}

.active-filter-tag i:hover {
    opacity: 1;
}

