/**
 * GCS Product Filters - Frontend Styles
 */

.gcs-product-filters {
    font-size: 1.5rem;
    color: #000;
}

/* Filter Cards */
.gcs-filter-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.gcs-filter-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
}

.gcs-filter-card.collapsed .card-header {
    border-bottom: none;
}

.gcs-filter-header:hover {
    background-color: #e9ecef;
}

.gcs-toggle-icon {
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.gcs-filter-card .card-body {
    padding: 1rem;
    font-size: 1.4rem;
}

/* Active Filters - Card Style */
.gcs-active-filters {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    padding: 1rem;
}

.gcs-active-filters>div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.gcs-active-filters strong {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.gcs-active-tags {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    order: 3;
}

.gcs-active-filters .gcs-clear-all {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
    background-color: #FFF;
    border: 1px solid #FFF;
    color: #bd2130;
    flex-shrink: 0;
    order: 2;
}

.gcs-active-filters .gcs-clear-all:hover {
    background-color: #FFF;
    border-color: #bd2130;
}

.gcs-active-filters .badge {
    font-size: 1.1rem;
    font-weight: normal;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    background-color: #111 !important;
    color: #fff !important;
}

.gcs-active-filters .badge:hover {
    background-color: #bd2130 !important;
    color: #fff !important;
}

.gcs-active-filters .btn-close {
    font-size: 1.1rem;
    padding: 0;
    width: 0.75rem;
    height: 0.75rem;
    opacity: 0.8;
}

.gcs-active-filters .btn-close:hover {
    opacity: 1;
}

/* Filter Options */
.gcs-filter-options {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hierarchical Terms */
.gcs-parent-term {
    font-weight: 700;
}

.gcs-child-terms {
    margin-left: 25px;
    display: block !important;
}

.gcs-child-term {
    padding-left: 0 !important;
}

.gcs-filter-options::-webkit-scrollbar {
    width: 6px;
}

.gcs-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gcs-filter-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.gcs-filter-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form Controls */
.gcs-filter-option {
    padding: 0.25rem 0;
}

.gcs-filter-option label {
    cursor: pointer;
    margin-bottom: 0;
    width: 100%;
    color: #000;
}

.gcs-count {
    color: #000;
    font-size: 1rem;
    font-weight: 700;
}

.gcs-term-search {
    margin-bottom: 0.5rem !important;
    font-size: 1.4rem !important;
}

/* Sort Select */
.gcs-sort-select {
    width: 100%;
    font-size: 1.4rem;
    color: #000;
}

/* Search Input */
.gcs-search-input {
    width: 100%;
    font-size: 1.4rem !important;
    color: #000;
}

/* Loading State */
.gcs-filter-loading {
    pointer-events: none;
}

.gcs-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 300px;
    z-index: 1000;
    text-align: center;
    background: rgba(255, 255, 255, .90);
    padding: 50px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gcs-loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-color: var(--brand-accent);
    border-right-color: transparent !important;
}

.gcs-loading-spinner p {
    margin: 0;
    color: #666;
    font-weight: 700;
    font-size: 1.8rem;
}

/* Bootstrap Collapse Animation */
.collapse {
    transition: height 0.2s ease;
}

.collapsing {
    transition: height 0.2s ease;
}

.woocommerce nav.woocommerce-pagination {
    margin-top: 1em;
    font-size: 1.3rem !important;
}

/* Parent Category Separators - Greyed out but still clickable */
.gcs-parent-disabled label {
    color: #000;
}

.gcs-parent-disabled .gcs-count {
    color: #000;
}

/* ========================================
   MOBILE OFFCANVAS FILTER BUTTON & STYLES
   ======================================== */

/* Floating Filter Button - Bottom Left */
.gcs-mobile-filter-btn {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100050;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--brand-dark);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gcs-mobile-filter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.gcs-mobile-filter-btn:active {
    transform: scale(0.75);
}

/* Show button only on mobile/tablet */
@media (max-width: 991px) {
    .gcs-mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide sidebar on mobile by default */
    .gcs-product-filters-sidebar {
        display: none;
    }
}

/* Offcanvas Overlay */
.gcs-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gcs-filters-overlay.show {
    display: block;
    opacity: 1;
}

/* Offcanvas Filters Panel */
.gcs-filters-offcanvas {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background-color: #fff;
    z-index: 100045;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.gcs-filters-offcanvas.show {
    left: 0;
}

/* Offcanvas Loading Indicator */
.gcs-offcanvas-loading {
    background-color: var(--brand-dark);
    color: #fff;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gcs-offcanvas-loading .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}


/* Offcanvas Header */
.gcs-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--brand-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gcs-offcanvas-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
}

.gcs-offcanvas-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.gcs-offcanvas-close:hover {
    opacity: 1;
}

/* Offcanvas Body */
.gcs-offcanvas-body {
    padding: 1rem;
}

/* Desktop - Keep normal layout */
@media (min-width: 992px) {

    .gcs-filters-overlay,
    .gcs-filters-offcanvas {
        display: none !important;
    }
}

/* Responsive - Adjust for smaller mobile */
@media (max-width: 767px) {
    .gcs-filter-card .card-header {
        padding: 0.5rem 0.75rem;
    }

    .gcs-filter-card .card-body {
        padding: 0.75rem;
    }

    .gcs-filter-options {
        max-height: 150px;
    }
}

@media (min-width: 768px) {
    .gcs-loading-spinner {
        padding: 50px 20px;
    }
}

/* Body scroll lock when offcanvas is open */
body.gcs-offcanvas-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}