/* =====================================================
   TechZone Shop Filter — Fixed Sidebar & Toggle Styles
   ===================================================== */

/* 1. Hide GTranslate when any offcanvas panel is open */
body.offcanvas-opened .gtranslate_wrapper,
body.offcanvas-opened #gt-widget,
body.offcanvas-opened .gt_float_switcher,
body.offcanvas-opened [class*="gtranslate"],
body.filter-sidebar-panel-opened .gtranslate_wrapper,
body.filter-sidebar-panel-opened #gt-widget,
body.filter-sidebar-panel-opened .gt_float_switcher,
body.filter-sidebar-panel-opened [class*="gtranslate"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================
   2. Toggle Button in Toolbar
   ============================ */
.tz-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 7px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: all 0.25s ease;
    margin-right: 15px;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
    vertical-align: middle;
}

.tz-filter-toggle:hover {
    border-color: #333;
    background: #f8f8f8;
}

.tz-filter-toggle.active {
    background: #222;
    color: #fff;
    border-color: #222;
}

.tz-filter-toggle__icon {
    display: inline-flex;
    align-items: center;
    width: 14px;
    height: 14px;
}

.tz-filter-toggle__icon svg {
    width: 100%;
    height: 100%;
}

.tz-filter-toggle__check {
    display: none;
    width: 13px;
    height: 13px;
    margin-left: 2px;
}

.tz-filter-toggle.active .tz-filter-toggle__check {
    display: inline-flex;
    align-items: center;
}

/* ============================
   3. Flex Wrapper (sidebar + products)
   ============================ */
.tz-shop-flex {
    display: contents; /* default: don't change layout */
}

/* ============================
   4. Fixed Filter Sidebar — hidden by default
   ============================ */
.tz-fixed-filter {
    display: none;
}

/* ========================================
   5. ACTIVE STATE — body.tz-filter-fixed
   ======================================== */

/* Turn the flex wrapper into an actual flex container */
body.tz-filter-fixed .tz-shop-flex {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    width: 100%;
}

/* Show the fixed filter column */
body.tz-filter-fixed .tz-fixed-filter {
    display: block;
    flex: 0 0 250px;
    width: 250px;
    min-width: 250px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    padding-right: 10px;
    border-right: 1px solid #eee;
}

body.tz-filter-fixed .tz-fixed-filter::-webkit-scrollbar {
    width: 3px;
}

body.tz-filter-fixed .tz-fixed-filter::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

body.tz-filter-fixed .tz-fixed-filter::-webkit-scrollbar-track {
    background: transparent;
}

/* Products take remaining space */
body.tz-filter-fixed .ecomus-shop-content {
    flex: 1 1 0%;
    min-width: 0;
}

/* Force 3 columns in the product grid when sidebar is visible */
body.tz-filter-fixed .ecomus-shop-content ul.products li.product {
    width: calc(33.333% - 16px) !important;
    flex: 0 0 calc(33.333% - 16px) !important;
    max-width: calc(33.333% - 16px) !important;
}

/* Hide the slide-out filter button when fixed filter is showing */
body.tz-filter-fixed .catalog-toolbar__filter-button[data-target="filter-sidebar-panel"] {
    display: none;
}

/* ============================
   6. Widget styling inside fixed filter
   ============================ */
body.tz-filter-fixed .tz-fixed-filter .widget {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

body.tz-filter-fixed .tz-fixed-filter .widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.tz-filter-fixed .tz-fixed-filter .widget-title,
body.tz-filter-fixed .tz-fixed-filter h2.widget-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.tz-filter-fixed .tz-fixed-filter .widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.tz-filter-fixed .tz-fixed-filter .widget ul li {
    padding: 4px 0;
    font-size: 14px;
}

body.tz-filter-fixed .tz-fixed-filter .widget ul li a {
    color: #333;
    text-decoration: none;
}

body.tz-filter-fixed .tz-fixed-filter .widget ul li a:hover {
    color: #000;
    text-decoration: underline;
}

/* ============================
   7. Responsive — disable on tablet & mobile
   ============================ */
@media (max-width: 1024px) {
    .tz-filter-toggle {
        display: none !important;
    }

    body.tz-filter-fixed .tz-fixed-filter {
        display: none !important;
    }

    body.tz-filter-fixed .tz-shop-flex {
        display: contents;
    }

    body.tz-filter-fixed .ecomus-shop-content ul.products li.product {
        width: unset !important;
        flex: unset !important;
        max-width: unset !important;
    }
}

/* ============================
   8. Transitions
   ============================ */
.tz-fixed-filter,
.ecomus-shop-content,
.tz-shop-flex {
    transition: all 0.3s ease;
}
