﻿/* =====================
   60. SHOP FILTERS - iOS Style
===================== */

.bcg-filters-ios {
    position: relative;
    background: transparent;
    border-radius: 10px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.75rem;
    animation: fadeInUp 0.4s ease-out;
}

.filter-section:last-of-type {
    margin-bottom: 0;
}

/* Filter Title */
.filter-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: #86868b;
    margin: 0 0 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-price-display {
    font-size: 11px;
    font-weight: 600;
    color: #1d1d1f;
    text-transform: none;
    letter-spacing: 0;
}

/* Filter Options Container */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* iOS Style Checkbox Option */
.filter-option-ios {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.filter-option-ios:hover {
    background: #f5f5f7;
    transform: translateX(2px);
}

.filter-option-ios:active {
    transform: scale(0.98);
}

/* Hide default checkbox */
.filter-option-ios input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

/* Custom Checkmark */
.filter-checkmark {
    position: relative;
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: #ffffff;
    border: 2px solid #d2d2d7;
    border-radius: 10px;
    margin-right: 3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-option-ios input[type="checkbox"]:checked~.filter-checkmark {
    background: linear-gradient(135deg, #f7a736 0%, #d98e2a 100%);
    border-color: #f7a736;
    box-shadow: 0 2px 8px rgba(247, 167, 54, 0.3);
}

/* Checkmark icon */
.filter-checkmark::after {
    content: "";
    position: absolute;
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 3px;
}

.filter-option-ios input[type="checkbox"]:checked~.filter-checkmark::after {
    display: block;
}

/* Filter Label */
.filter-label {
    font-size: 15px;
    font-weight: 500;
    color: #1d1d1f;
    flex: 1;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.filter-option-ios input[type="checkbox"]:checked~.filter-label {
    color: #f7a736;
    font-weight: 600;
}

.filter-count {
    font-size: 13px;
    color: #86868b;
    font-weight: 400;
    margin-left: 6px;
}

/* Disabled filter options (when count is 0) */
.filter-option-ios.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f7;
    pointer-events: none;
}

.filter-option-ios.disabled:hover {
    background: #f5f5f7;
    transform: none;
}

.filter-option-ios.disabled .filter-checkmark {
    background: #e8e8ed;
    border-color: #d2d2d7;
}

.filter-option-ios.disabled .filter-label,
.filter-option-ios.disabled .filter-count {
    color: #86868b;
}

.filter-option-ios input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

/* Categories - scrollable if many */
.filter-categories {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.filter-categories::-webkit-scrollbar {
    width: 6px;
}

.filter-categories::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 10px;
}

.filter-categories::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.filter-categories::-webkit-scrollbar-thumb:hover {
    background: #b8b8bd;
}

/* Price Slider */
.filter-price-slider {
    position: relative;
    padding: 24px 8px 8px;
}

.price-slider-track {
    position: relative;
    height: 4px;
    background: #e5e5ea;
    border-radius: 10px;
    margin-bottom: 8px;
}

.price-slider-range {
    position: absolute;
    height: 4px;
    background: linear-gradient(90deg, #f7a736 0%, #ffb950 100%);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.price-slider-input {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 24px;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.price-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #f7a736;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(247, 167, 54, 0.4);
}

.price-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.price-slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #f7a736;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider-input::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.price-slider-input.js-price-max {
    pointer-events: all;
}

/* Clear Filters Button */
.filter-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e5ea;
}

.btn-clear-filters {
    width: 100%;
    padding: 12px 20px;
    background: #f5f5f7;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-filters:hover {
    background: #e5e5ea;
    transform: translateY(-1px);
}

.btn-clear-filters:active {
    transform: scale(0.98);
}

.btn-clear-filters.has-active-filters {
    background: linear-gradient(135deg, #f7a736 0%, #d98e2a 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(247, 167, 54, 0.3);
}

.btn-clear-filters.has-active-filters:hover {
    background: linear-gradient(135deg, #d98e2a 0%, #c27d1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 167, 54, 0.4);
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active Filter Indicator */
.filter-option-ios.has-value {
    background: #fef4e6;
    border-left: 3px solid #f7a736;
}

/* =====================
   PRODUCTS LOADING OVERLAY
===================== */
.shop-products-wrapper {
    position: relative;
    min-height: 400px;
}

.products-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    z-index: 100;
    border-radius: 10px;
}

.loading-spinner {
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

.loading-spinner .spinner-border {
    width: 64px;
    height: 64px;
    border-width: 5px;
    border-color: #f7a736;
    border-right-color: transparent;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: 0.3px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Disable interactions during loading */
body.bcg-filters-loading .bcg-filters-ios,
body.bcg-filters-loading .bcg-toolbar-final {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

/* Responsive */
@media (max-width: 991px) {
    .bcg-filters-ios {
        padding: 0;
    }

    .filter-section {
        margin-bottom: 1.5rem;
    }

    /* Offcanvas specific styles */
    .offcanvas .bcg-filters-ios {
        padding: 0;
    }

    .offcanvas-body {
        padding: 20px;
    }

    .offcanvas-header {
        border-bottom: 1px solid #e5e5ea;
        padding: 20px;
    }

    .offcanvas-title {
        font-size: 18px;
        font-weight: 700;
        color: #1d1d1f;
    }

    /* Mobile filter button badge */
    .btn-filter-pill {
        position: relative;
    }

    .filter-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: linear-gradient(135deg, #f7a736 0%, #d98e2a 100%);
        color: #ffffff;
        font-size: 11px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(247, 167, 54, 0.4);
        animation: badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes badgePop {
        0% {
            transform: scale(0);
        }

        50% {
            transform: scale(1.2);
        }

        100% {
            transform: scale(1);
        }
    }
}

/* Dark Mode Support (optional) */
/* @media (prefers-color-scheme: dark) {
    .filter-option-ios {
        background: #1c1c1e;
        color: #f5f5f7;
    }

    .filter-option-ios:hover {
        background: #2c2c2e;
    }

    .filter-label {
        color: #f5f5f7;
    }

    .filter-checkmark {
        background: #2c2c2e;
        border-color: #48484a;
    }

    .btn-clear-filters {
        background: #1c1c1e;
        color: #f5f5f7;
    }

    .btn-clear-filters:hover {
        background: #2c2c2e;
    }
}
*/

/* ========================================
   Hierarchical Categories
   ======================================== */

.filter-category-group {
    margin-bottom: 0;
}

.filter-category-group .filter-option-ios {
    position: relative;
    padding-right: 0px;
}

.category-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    z-index: 2;
}

.category-toggle:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.category-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-subcategories {
    padding-left: 0;
    margin-top: 0;
    border-left: 2px solid #e0e0e0;
    margin-left: 15px;
}

.filter-subcategory {
    margin-left: 8px;
    font-size: 0.95em;
}

.filter-subcategory .filter-label {
    font-weight: 400;
    color: #666;
}

.filter-subcategory:hover .filter-label {
    color: #000;
}

/* ========================================
   Active Filter Pills (Toolbar)
   ======================================== */

/* ========================================
   Offcanvas Footer (Mobile)
   ======================================== */
.offcanvas-footer {
    background: #fff;
    border-top: 1px solid #e5e5e5;
}

.btn-apply {
    background-color: var(--brand-gold);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.btn-apply:hover {
    background-color: #b89d6a;
    color: #fff;
    transform: translateY(-1px);
}

.btn-apply:active {
    transform: translateY(0);
}

.active-filters-container {
    flex: 1;
    min-height: 38px;
    padding: 0 20px;
}

.active-filter-pill {
    display: inline-flex;
    align-items: center;
    /*background: #f0f0f0;*/
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.active-filter-pill:hover {
    background: #e0e0e0;
    border-color: #c0c0c0;
}

.active-filter-pill .pill-label {
    margin-right: 8px;
    font-weight: 500;
}

.active-filter-pill .pill-remove {
    background: transparent !important;
    border: none;
    border-radius: 10px;
    width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.active-filter-pill .pill-remove:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

.active-filter-pill .pill-remove i {
    font-size: 10px;
}

.btn-clear-all-pills {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-clear-all-pills:hover {
    background: #f5f5f5;
    border-color: #c0c0c0;
    color: #000;
}

.btn-clear-all-pills i {
    font-size: 11px;
}

/* Responsive adjustments for pills */
@media (max-width: 991px) {
    .active-filters-container {
        display: none !important;
        /* Hide on mobile - filters are in offcanvas */
    }
}

@media (max-width: 1200px) {
    .active-filter-pill {
        font-size: 12px;
        padding: 5px 10px;
    }

    .btn-clear-all-pills {
        font-size: 12px;
        padding: 5px 12px;
    }
}

.bcg-load-more-wrap {
    padding-bottom: 1.5rem;

}

.bcg-load-more-btn {
    min-width: 180px;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    border: 2px solid #000;
    background-color: transparent;
    color: #000;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bcg-load-more-btn:hover,
.bcg-load-more-btn:focus-visible {
    border-color: #000;
    background-color: #000;
    color: #fff;
}

.bcg-load-more-btn.is-loading {
    opacity: 0.85;
}
