/* ===================================
   Shop Controls Section - Clean & Elegant
   =================================== */

.shop-controls-wrapper {
    background: #fff;
    padding: 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 114, 0.1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0 15px;
}

/* ===================================
   Left Controls Group
   =================================== */

.controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* Filter Toggle Button - Clean Design */
.filter-toggle-btn {
    background: #b9d432;
    color: #000072;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(185, 212, 50, 0.25);
    position: relative;
    overflow: hidden;
}

.filter-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.filter-toggle-btn:hover::before {
    left: 100%;
}

.filter-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(185, 212, 50, 0.35);
    background: #a8c52d;
}

.filter-toggle-btn:active {
    transform: translateY(0);
}

.filter-toggle-btn i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.filter-toggle-btn:hover i {
    transform: rotate(90deg);
}

.filter-toggle-btn .active-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 2px;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        background: rgba(255, 255, 255, 0.3);
    }
    50% {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Products Count Display */
.products-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.products-count:hover {
    border-color: #000072;
    background: #f0f0f0;
}

.products-count i {
    color: #000072;
    font-size: 14px;
}

.products-count span {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
}

.products-count strong {
    color: #000072;
    font-size: 14px;
    font-weight: 700;
}

/* ===================================
   Sort Form - Minimal & Clean
   =================================== */

.sort-form {
    display: flex;
    align-items: center;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 0px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.sort-wrapper:hover {
    border-color: #000072;
    background: #f0f0f0;
}

.sort-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s ease;
}

.sort-wrapper:hover .sort-label {
    color: #000072;
}

.sort-label i {
    font-size: 13px;
    color: #000072;
    transition: transform 0.3s ease;
}

.sort-wrapper:hover .sort-label i {
    transform: scale(1.1);
}

.sort-select {
    background: transparent;
    border: none;
    padding: 4px 30px 4px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23d4a574' d='M5 8L0 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 180px;
    transition: all 0.3s ease;
}

.sort-select:hover {
    color: #f4a460;
}

.sort-select option {
    background: #fff;
    color: #2c3e50;
    padding: 12px 16px;
    font-weight: 600;
}

.sort-select option:hover {
    background: #fff8e5;
    color: #f4a460;
}

.sort-select option:checked {
    background: linear-gradient(135deg, #f4a460 0%, #d4a574 100%);
    color: #fff;
    font-weight: 700;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 991px) {
    .shop-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .controls-left {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .filter-toggle-btn {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }

    .products-count {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }

    .sort-wrapper {
        width: 100%;
    }

    .sort-form {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .shop-controls-wrapper {
        padding: 14px 0;
        margin-bottom: 20px;
    }

    .shop-controls {
        gap: 12px;
    }

    .controls-left {
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }

    .filter-toggle-btn {
        padding: 10px 14px;
        font-size: 12px;
        flex: 1;
        white-space: nowrap;
    }

    .filter-toggle-btn i {
        font-size: 12px;
    }

    .filter-toggle-btn span {
        display: inline;
    }

    .filter-toggle-btn .active-badge {
        font-size: 7px;
        padding: 2px 4px;
    }

    .products-count {
        padding: 10px 11px;
        flex: 1;
    }

    .products-count i {
        font-size: 13px;
    }

    .products-count span {
        font-size: 11px;
    }

    .products-count strong {
        font-size: 13px;
    }

    .sort-wrapper {
        padding: 9px 11px;
        width: 100%;
        flex-direction: row;
        /* flex-wrap: nowrap; */
    }

    .sort-label {
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .sort-label i {
        font-size: 12px;
    }

    .sort-label span {
        display: inline;
    }

    .sort-select {
        padding: 5px 28px 5px 7px;
        font-size: 12px;
        min-width: auto;
        flex: 1;
    }

    /* Tom Select sort dropdown on mobile */
    .ts-wrapper.sort-select .ts-control {
        padding: 6px 9px;
        font-size: 12px;
        min-height: 30px;
    }

    /* Sort dropdown options on mobile */
    .sort-option-item,
    .sort-item-selected {
        font-size: 12px;
    }

    .sort-option-item i,
    .sort-item-selected i {
        font-size: 11px;
    }

    .sort-option-item span,
    .sort-item-selected span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .shop-controls-wrapper {
        padding: 12px 0;
    }

    .shop-controls {
        gap: 10px;
    }

    .controls-left {
        flex-direction: column;
        gap: 8px;
    }

    .filter-toggle-btn {
        padding: 11px 16px;
        font-size: 11px;
        width: 100%;
    }

    .filter-toggle-btn i {
        font-size: 11px;
    }

    .filter-toggle-btn .active-badge {
        font-size: 7px;
        padding: 1px 4px;
    }

    .products-count {
        padding: 9px 12px;
        width: 100%;
    }

    .products-count i {
        font-size: 12px;
    }

    .products-count span {
        font-size: 10px;
    }

    .products-count strong {
        font-size: 12px;
    }

    .sort-wrapper {
        flex-direction: row;
        padding: 8px 10px;
    }

    .sort-label {
        font-size: 10px;
    }

    .sort-label i {
        font-size: 11px;
    }

    .sort-select {
        font-size: 11px;
        padding: 5px 26px 5px 7px;
    }

    .ts-wrapper.sort-select .ts-control {
        padding: 5px 7px;
        font-size: 11px;
        min-height: 28px;
    }

    /* Sort dropdown options on small mobile */
    .sort-option-item,
    .sort-item-selected {
        font-size: 11px;
    }

    .sort-option-item i,
    .sort-item-selected i {
        font-size: 10px;
    }

    .sort-option-item span,
    .sort-item-selected span {
        font-size: 11px;
    }
}

/* ===================================
   Filters Container
   =================================== */

.filters-container {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0e9dc;
}

.filters-header {
    background: linear-gradient(135deg, #f4a460 0%, #d4a574 100%);
    padding: 20px;
    border-bottom: 3px solid #c89865;
}

.filters-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.filters-form {
    padding: 24px;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #f0e9dc;
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-label {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.filter-label i {
    color: #d4a574;
    font-size: 16px;
}

/* Category Select */
.category-wrapper {
    position: relative;
}

.category-dropdown-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(0, 0, 114, 0.05);
    border: 1px solid #e0e0e0;
    color: #000072;
    font-size: 13px;
    cursor: pointer;
    z-index: 2000;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-dropdown-btn:hover {
    background: rgba(0, 0, 114, 0.1);
    color: #000072;
    border-color: #000072;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 114, 0.15);
}

.category-dropdown-btn i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

.category-dropdown-btn.dropdown-open {
    background: #000072;
    color: #fff;
    border-color: #000072;
    box-shadow: 0 3px 10px rgba(0, 0, 114, 0.25);
}

.category-dropdown-btn.dropdown-open i {
    transform: rotate(180deg) scale(1.1);
}

/* Availability Section - Inside Category Card */
.availability-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
}

.availability-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.availability-header i {
    color: #000072;
    font-size: 12px;
}

.availability-label {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.availability-wrapper {
    position: relative;
}

.availability-dropdown-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(0, 0, 114, 0.05);
    border: 1px solid #e0e0e0;
    color: #000072;
    font-size: 13px;
    cursor: pointer;
    z-index: 2000;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.availability-dropdown-btn:hover {
    background: rgba(0, 0, 114, 0.1);
    color: #000072;
    border-color: #000072;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 114, 0.15);
}

.availability-dropdown-btn i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

.availability-dropdown-btn.dropdown-open {
    background: #000072;
    color: #fff;
    border-color: #000072;
    box-shadow: 0 3px 10px rgba(0, 0, 114, 0.25);
}

.availability-dropdown-btn.dropdown-open i {
    transform: rotate(180deg) scale(1.1);
}

/* Availability Tom Select Options */
.availability-option-item,
.availability-item-selected {
    display: flex;
    align-items: center;
    gap: 8px;
}

.availability-option-item i {
    width: 14px;
    text-align: center;
    font-size: 11px;
}

.availability-option-item span {
    flex: 1;
    font-size: 12px;
}

.availability-item-selected {
    font-size: 12px;
    font-weight: 500;
}

.availability-item-selected i {
    font-size: 11px;
}

/* Tom Select Customization */
.ts-wrapper {
    width: 100%;
    position: relative;
}

.ts-wrapper .ts-control {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 40px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

/* Fix for horizontal layout dropdown */
body > .ts-dropdown {
    position: absolute !important;
    z-index: 10000 !important;
}

.ts-wrapper .ts-control .item {
    color: #2c3e50;
    font-weight: 600;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
    border-color: #000072;
    box-shadow: 0 0 0 3px rgba(0, 0, 114, 0.08);
    background: #f8f9fa;
}

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

.ts-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 6px;
    background: #ffffff;
    overflow: hidden;
    animation: dropdownEntrance 0.3s ease;
}

@keyframes dropdownEntrance {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ts-dropdown .optgroup-header {
    background: #000072;
    color: #fff;
    font-weight: 600;
    padding: 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ts-dropdown .option {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    line-height: 1.3;
}

.ts-dropdown .option:last-child {
    border-bottom: none;
}

/* Hierarchical Indentation */
.ts-dropdown .option[data-level="0"] {
    padding: 8px 12px;
    font-weight: 700;
    font-size: 12px;
    color: #1a1a1a;
    background: #f0f8ff;
    border-left: 3px solid #000072;
    margin: 1px 0;
}

.ts-dropdown .option[data-level="1"] {
    padding: 7px 12px 7px 28px;
    font-weight: 600;
    font-size: 11px;
    color: #2c3e50;
    background: #ffffff;
    position: relative;
    border-left: 2px solid transparent;
}

/* .ts-dropdown .option[data-level="1"]::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: #6c757d;
    transform: translateY(-50%);
} */

.ts-dropdown .option[data-level="2"] {
    padding: 6px 12px 6px 40px;
    font-weight: 500;
    font-size: 11px;
    color: #495057;
    background: #ffffff;
    position: relative;
    border-left: 2px solid transparent;
}

/* .ts-dropdown .option[data-level="2"]::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    width: 8px;
    height: 1px;
    background: #9ca3af;
    transform: translateY(-50%);
} */

/* Icons for hierarchy levels */
/* .ts-dropdown .option[data-level="0"] .option-text::before {
    content: "\f07b";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    color: #000072;
    font-size: 11px;
    display: inline-block;
    width: 14px;
    text-align: center;
} */

/* .ts-dropdown .option[data-level="1"] .option-text::before {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    color: #6c757d;
    font-size: 10px;
    display: inline-block;
    width: 12px;
    text-align: center;
} */

/* .ts-dropdown .option[data-level="2"] .option-text::before {
    content: "\f101";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    color: #9ca3af;
    font-size: 9px;
    display: inline-block;
    width: 10px;
    text-align: center;
} */

.ts-dropdown .option.active {
    background: rgba(0, 0, 114, 0.05);
    color: #1a1a1a;
}

.ts-dropdown .option:hover {
    background: rgba(185, 212, 50, 0.1);
    color: #1a1a1a;
}

.ts-dropdown .option[data-level="0"]:hover {
    border-left-color: #b9d432;
}

.ts-dropdown .option.selected {
    background: #000072;
    color: #fff;
    font-weight: 700;
    border-left-color: #b9d432 !important;
}

.ts-dropdown .option.selected .option-text::before {
    color: #fff;
}

.ts-dropdown .option.selected .option-parent {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ts-dropdown .option.selected .option-parent i {
    color: rgba(255, 255, 255, 1);
}

/* Scrollbar styling for dropdown */
.ts-dropdown .ts-dropdown-content {
    max-height: 250px;
    overflow-y: auto;
}

.ts-dropdown .ts-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.ts-dropdown .ts-dropdown-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
    background: #000072;
    border-radius: 3px;
    border: 1px solid #f8f9fa;
}

.ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #b9d432;
}

/* Custom Option Item Rendering */
.option-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.option-text {
    font-size: 12px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    font-weight: inherit;
}

.option-parent {
    font-size: 9px;
    color: #6c757d;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
    padding: 2px 6px;
    background: rgba(0, 0, 114, 0.05);
    border-radius: 3px;
    width: fit-content;
    border: 1px solid rgba(0, 0, 114, 0.1);
}

.option-parent i {
    font-size: 8px;
    margin-right: 3px;
    color: #000072;
}

/* Selected Item Styling */
.item-selected {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-selected::before {
    content: "\f07b";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #000072;
    font-size: 11px;
}

/* Enhance spacing for items with parent info */
.ts-dropdown .option:has(.option-parent) {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Better visual separation between levels */
.ts-dropdown .option[data-level="0"] + .option[data-level="0"] {
    margin-top: 4px;
}

.ts-dropdown .option:hover .option-parent {
    background: rgba(185, 212, 50, 0.1);
    color: #2c3e50;
    border-color: rgba(185, 212, 50, 0.2);
}

.ts-dropdown .option.selected .option-parent {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ts-dropdown .option.selected .option-parent i {
    color: rgba(255, 255, 255, 1);
}

/* Search highlight */
.ts-dropdown .option .highlight {
    background: #b9d432;
    color: #000072;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* Tom Select Placeholder */
.ts-wrapper .ts-control input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Empty/No Results State */
.ts-dropdown .no-results {
    padding: 30px 16px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
}

.ts-dropdown .no-results::before {
    content: "\f002";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 24px;
    color: #d0d0d0;
    display: block;
    margin-bottom: 8px;
}

.ts-dropdown .no-results::after {
    content: 'Try adjusting your search';
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    font-style: italic;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Loading state */
.ts-wrapper.loading .ts-control::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 35px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #000072;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Divider between category groups */
.ts-dropdown .option[data-level="0"]:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 14px;
}

/* Animations */
@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Removed complex pulse animations for better performance */

/* Improve touch targets for mobile */
@media (pointer: coarse) {
    .ts-dropdown .option {
        padding: 10px 12px;
        min-height: 40px;
    }
}

/* Keyboard navigation indicator */
.ts-dropdown .option:focus,
.ts-dropdown .option.active:focus {
    outline: 2px solid #000072;
    outline-offset: -2px;
}

/* Better focus state for control */
.ts-wrapper .ts-control:focus-within {
    border-color: #000072;
    box-shadow: 0 0 0 3px rgba(0, 0, 114, 0.08);
}

/* Smooth scrolling in dropdown */
.ts-dropdown .ts-dropdown-content {
    scroll-behavior: smooth;
}

/* Removed complex option entrance animations for better performance */

/* Price Range */
.price-range-inputs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #faf8f4;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e8dcc8;
    transition: all 0.3s ease;
}

.price-input-wrapper:hover {
    border-color: #d4a574;
    background: #fff8e5;
}

.price-input-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.price-range-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #d4a574 0%, #f4a460 100%);
    cursor: pointer;
}

.price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #f4a460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(244, 164, 96, 0.4);
}

.price-range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #f4a460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(244, 164, 96, 0.4);
}

.price-value {
    font-size: 16px;
    font-weight: 700;
    color: #f4a460;
    text-align: center;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #f4a460;
    display: inline-block;
}

.price-separator {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #d4a574;
    padding: 8px 0;
}

/* Filter Select (Availability) */
.filter-select {
    width: 100%;
    background: #faf8f4;
    border: 2px solid #e8dcc8;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #d4a574;
    background: #fff8e5;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

/* Apply Filter Button */
.filter-actions {
    margin-top: 24px;
}

.apply-filter-btn {
    width: 100%;
    background: linear-gradient(135deg, #f4a460 0%, #d4a574 100%);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(244, 164, 96, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apply-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 164, 96, 0.4);
    background: linear-gradient(135deg, #f4a460 0%, #c89865 100%);
}

.apply-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(244, 164, 96, 0.3);
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet */
@media (max-width: 991px) {
    .shop-controls-wrapper {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .filter-toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .sort-select {
        min-width: 160px;
        font-size: 13px;
        padding: 8px 12px;
    }

    #filtersSection {
        margin-bottom: 20px;
    }

    .filters-container {
        margin-top: 15px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .shop-controls-wrapper {
        padding: 12px 0;
        margin-bottom: 15px;
    }

    .shop-controls {
        flex-direction: column;
        gap: 14px;
        align-items: stretch !important;
    }

    .filter-toggle-btn {
        justify-content: center;
        width: 100%;
    }

    .sort-form {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .sort-label {
        width: 46px;
        height: 46px;
        font-size: 14px;
        border-radius: 12px;
    }

    .sort-select {
        flex: 1;
        min-width: auto;
        padding: 13px 40px 13px 18px;
        font-size: 14px;
        background-position: right 14px center;
        border-radius: 12px;
    }

    .sort-select:hover {
        transform: translateY(-1px) scale(1.015);
    }

    .sort-select:focus {
        transform: translateY(-2px) scale(1.02);
    }
}

    .filters-header {
        padding: 16px;
    }

    .filters-title {
        font-size: 16px;
    }

    .filters-form {
        padding: 18px;
    }

    .filter-group {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .filter-label {
        font-size: 14px;
    }

    .price-input-wrapper {
        padding: 12px;
    }

    .price-value {
        font-size: 14px;
        padding: 4px 10px;
    }

    .apply-filter-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .filter-toggle-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .sort-label {
        width: 42px;
        height: 42px;
        font-size: 17px;
        border-radius: 10px;
    }

    .sort-label:hover {
        transform: scale(1.08) rotate(-5deg);
    }

    .sort-select {
        font-size: 13px;
        padding: 11px 36px 11px 16px;
        background-position: right 12px center;
        border-radius: 10px;
    }

    .sort-select:hover {
        transform: translateY(-1px) scale(1.01);
    }

    .sort-select:focus {
        transform: translateY(-1px) scale(1.015);
    }

    .sort-select option {
        padding: 14px 16px;
        font-size: 13px;
    }

    .filters-form {
        padding: 15px;
    }

    .filter-label {
        font-size: 13px;
    }

    .filter-label i {
        font-size: 14px;
    }

    /* Category dropdown mobile adjustments */
    .ts-wrapper .ts-control {
        padding: 12px 40px 12px 14px;
        min-height: 46px;
        font-size: 14px;
    }

    .ts-dropdown {
        border-radius: 12px;
    }

    .ts-dropdown .option {
        padding: 10px 14px;
    }

    .ts-dropdown .option[data-level="0"] {
        font-size: 14px;
        padding: 12px 14px;
        border-left-width: 3px;
    }

    .ts-dropdown .option[data-level="1"] {
        padding-left: 36px;
        font-size: 13px;
    }

    .ts-dropdown .option[data-level="2"] {
        padding-left: 52px;
        font-size: 12px;
    }

    .option-text {
        font-size: 13px;
    }

    .option-parent {
        font-size: 10px;
        padding: 3px 6px;
    }

    .ts-dropdown .option:hover {
        transform: translateX(2px);
    }

    .ts-dropdown .option[data-level="0"]:hover {
        transform: translateX(0);
    }

    .ts-dropdown .option[data-level="0"] .option-text::before {
        font-size: 14px;
        margin-right: 8px;
    }

    .ts-dropdown .option[data-level="1"] .option-text::before {
        font-size: 12px;
        margin-right: 8px;
    }

    .ts-dropdown .option[data-level="2"] .option-text::before {
        font-size: 10px;
        margin-right: 6px;
    }
}

/* Products Section Min Height */
.shop-products-section {
    min-height: 600px;
    padding-bottom: 60px;
}

@media (max-width: 991px) {
    .shop-products-section {
        min-height: auto;
        padding-bottom: 40px;
    }
}

@media (max-width: 767px) {
    .shop-products-section {
        padding-bottom: 30px;
    }
}

/* ===================================
   No Products State
   =================================== */

.no-products-state {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, #fff8e5 0%, #ffefc7 100%);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.no-products-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #f4a460 0%, #d4a574 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(244, 164, 96, 0.3);
    animation: floatIcon 3s ease-in-out infinite;
}

.no-products-icon i {
    font-size: 50px;
    color: #fff;
}

.no-products-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
}

.no-products-text {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 30px;
}

.no-products-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f4a460 0%, #d4a574 100%);
    color: #fff;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 164, 96, 0.3);
}

.no-products-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 164, 96, 0.4);
    color: #fff;
    background: linear-gradient(135deg, #f4a460 0%, #c89865 100%);
}

.no-products-btn i {
    transition: transform 0.3s ease;
}

.no-products-btn:hover i {
    transform: rotate(180deg);
}

/* Float Animation */
@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Responsive No Products State */
@media (max-width: 767px) {
    .no-products-state {
        padding: 60px 30px;
    }

    .no-products-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 24px;
    }

    .no-products-icon i {
        font-size: 40px;
    }

    .no-products-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .no-products-text {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .no-products-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .no-products-state {
        padding: 40px 20px;
    }

    .no-products-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .no-products-icon i {
        font-size: 32px;
    }

    .no-products-title {
        font-size: 20px;
    }

    .no-products-text {
        font-size: 13px;
    }

    .no-products-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Animation for Filter Section */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#filtersSection {
    animation: slideDown 0.3s ease-out;
}

/* ===================================
   Modern Card-Based Horizontal Filters
   =================================== */

.filters-container-horizontal {
    background: #ffffff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0e0e0;
    padding: 20px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filters-container-horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        #b9d432 20%,
        #000072 50%,
        #b9d432 80%,
        transparent 100%
    );
    border-radius: 12px 12px 0 0;
    animation: shimmerBar 3s ease-in-out infinite;
}

@keyframes shimmerBar {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.filters-container-horizontal:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.filters-form-horizontal {
    width: 100%;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: stretch;
    position: relative;
}

/* ===================================
   Filter Card Design
   =================================== */

.filter-card {
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #b9d432, #000072, #b9d432);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

/* .filter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(244, 164, 96, 0.2);
    border-color: rgba(244, 164, 96, 0.3);
} */

/* .filter-card:hover::before {
    opacity: 1;
} */

.filter-card.has-value {
    background: #f0f8ff;
    border-color: #b9d432;
    box-shadow: 0 2px 8px rgba(185, 212, 50, 0.15);
}

.filter-card.has-value::after {
    content: '●';
    position: absolute;
    top: 12px;
    right: 12px;
    color: #b9d432;
    font-size: 12px;
    animation: pulseIndicator 2s ease-in-out infinite;
}

/* ===================================
   Filter Card Header
   =================================== */

.filter-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-icon-wrapper {
    width: 36px;
    height: 36px;
    background: #000072;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 114, 0.2);
    transition: all 0.3s ease;
}


.filter-icon-wrapper i {
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.filter-card:hover .filter-icon-wrapper i {
    transform: scale(1.1);
}

.filter-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.filter-card:hover .filter-label {
    color: #000072;
}

.filter-subtitle {
    font-size: 10px;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.3;
}

.filter-card-body {
    flex: 1;
}

/* ===================================
   Category Select - Enhanced
   =================================== */

.filter-card .category-wrapper {
    position: relative;
    z-index: 100;
}

.filter-card .ts-wrapper {
    position: relative;
    z-index: 100;
}

.filter-card .ts-wrapper .ts-control {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    min-height: 40px;
    transition: all 0.3s ease;
}

.filter-card .ts-wrapper .ts-control:hover,
.filter-card .ts-wrapper.focus .ts-control {
    border-color: #000072;
    background: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(0, 0, 114, 0.05);
}

/* ===================================
   Price Range - Modern Design
   =================================== */

.price-range-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-display {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.price-badge {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.price-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #b9d432;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.price-badge:hover::before {
    transform: scaleX(1);
}

.price-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 114, 0.1);
    border-color: #000072;
}

.price-label {
    font-size: 9px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-amount {
    font-size: 18px;
    font-weight: 800;
    color: #000072;
    line-height: 1;
    font-family: 'Arial', sans-serif;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.price-amount::before {
    content: '';
    font-size: 18px;
    vertical-align: super;
    margin-right: 2px;
    opacity: 0.7;
}

.price-divider {
    font-size: 20px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.price-divider i {
    animation: slideHorizontal 2s ease-in-out infinite;
}

@keyframes slideHorizontal {
    0%, 100% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}

.price-sliders {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slider-wrapper {
    position: relative;
}

.price-range-slider {
    width: 100%;
    height: 6px;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #b9d432 0%, #b9d432 50%, #e0e0e0 50%, #e0e0e0 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-range-slider:hover {
    transform: scaleY(1.1);
}

.price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000072;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 114, 0.25);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.price-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 114, 0.35);
    border-color: #b9d432;
}

.price-range-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.price-range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000072;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 114, 0.25);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.price-range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 114, 0.35);
    border-color: #b9d432;
}

/* RTL Support for Price Range Sliders */
[dir="rtl"] .price-range-slider {
    transform: scaleX(-1);
}

[dir="rtl"] .price-range-slider::-webkit-slider-thumb {
    transform: scaleX(-1);
}

[dir="rtl"] .price-range-slider::-moz-range-thumb {
    transform: scaleX(-1);
}

[dir="rtl"] .price-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2) scaleX(-1);
}

[dir="rtl"] .price-range-slider::-webkit-slider-thumb:active {
    transform: scale(1.05) scaleX(-1);
}

[dir="rtl"] .price-range-slider::-moz-range-thumb:hover {
    transform: scale(1.2) scaleX(-1);
}

[dir="rtl"] .price-display {
    flex-direction: row-reverse;
}

/* RTL Support for Filter Cards */
[dir="rtl"] .filter-card-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-icon-wrapper {
    margin-left: 10px;
    margin-right: 0;
}

[dir="rtl"] .filter-card.has-value::after {
    right: auto;
    left: 12px;
}

/* RTL Support for Category Dropdown */
[dir="rtl"] .category-dropdown-btn {
    right: auto;
    left: 10px;
}

/* RTL Support for Availability Dropdown */
[dir="rtl"] .availability-dropdown-btn {
    right: auto;
    left: 10px;
}

[dir="rtl"] .ts-wrapper .ts-control {
    padding: 10px 14px 10px 40px;
}

[dir="rtl"] .filter-card .ts-wrapper .ts-control {
    padding: 10px 14px 10px 40px;
}

/* RTL Support for Controls */
[dir="rtl"] .controls-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .shop-controls {
    flex-direction: row-reverse;
}

/* RTL Support for Dropdown Options */
[dir="rtl"] .ts-dropdown .option[data-level="0"] {
    border-left: none;
    border-right: 3px solid #000072;
}

[dir="rtl"] .ts-dropdown .option[data-level="0"]:hover {
    border-right-color: #b9d432;
}

[dir="rtl"] .ts-dropdown .option[data-level="1"] {
    padding: 7px 28px 7px 12px;
}

[dir="rtl"] .ts-dropdown .option[data-level="1"]::before {
    left: auto;
    right: 16px;
}

[dir="rtl"] .ts-dropdown .option[data-level="2"] {
    padding: 6px 40px 6px 12px;
}

[dir="rtl"] .ts-dropdown .option[data-level="2"]::before {
    left: auto;
    right: 24px;
}

[dir="rtl"] .ts-dropdown .option.selected {
    border-left: none;
    border-right-color: #b9d432 !important;
}

[dir="rtl"] .option-parent {
    flex-direction: row-reverse;
}

[dir="rtl"] .option-parent i {
    margin-right: 0;
    margin-left: 4px;
}

[dir="rtl"] .ts-dropdown .option[data-level="0"] .option-text::before,
[dir="rtl"] .ts-dropdown .option[data-level="1"] .option-text::before,
[dir="rtl"] .ts-dropdown .option[data-level="2"] .option-text::before {
    margin-right:6px;
    margin-left: 6px;
}

[dir="rtl"] .item-selected::before , [dir="rtl"] .availability-item-selected i::before{
    margin-right: 5px;
    margin-left: 5px;
}

/* RTL Support for Sort Wrapper */
[dir="rtl"] .sort-wrapper {
    flex-direction: row-reverse;
}

[dir="rtl"] .sort-label {
    flex-direction: row-reverse;
}

/* ===================================
   Filter Actions - Buttons
   =================================== */

.filter-actions-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-width: 140px;
}

.apply-filter-btn,
.clear-filter-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.apply-filter-btn {
    background: #b9d432;
    color: #000072;
    box-shadow: 0 3px 10px rgba(185, 212, 50, 0.3);
}

.apply-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
}

.apply-filter-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 5px 16px rgba(185, 212, 50, 0.4);
    background: #a8c52d;
}

.apply-filter-btn:hover::before {
    left: 100%;
}

.apply-filter-btn:active {
    transform: translateY(-1px) scale(1);
}

.apply-filter-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.apply-filter-btn:hover i {
    transform: rotate(360deg) scale(1.1);
}

.clear-filter-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    box-shadow: 0 1px 4px rgba(220, 53, 69, 0.15);
}

.clear-filter-btn:hover {
    background: #dc3545;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(220, 53, 69, 0.25);
}

.clear-filter-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.clear-filter-btn:hover i {
    transform: rotate(90deg) scale(1.1);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-actions-group {
        grid-column: span 2;
        flex-direction: row;
        justify-content: center;
    }
    
    .apply-filter-btn,
    .clear-filter-btn {
        max-width: 250px;
    }
}

@media (max-width: 991px) {
    .filters-container-horizontal {
        padding: 32px 28px;
        border-radius: 20px;
    }
    
    .filters-grid {
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .filters-container-horizontal {
        padding: 18px 14px;
        border-radius: 14px;
    }

    /* .filters-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    } */

    .filter-card {
        padding: 14px;
    }

    .filter-icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .filter-icon-wrapper i {
        font-size: 16px;
    }

    .filter-label {
        font-size: 11px;
        letter-spacing: 0.2px;
    }

    .filter-subtitle {
        font-size: 9px;
    }

    .price-display {
        gap: 8px;
    }

    .price-badge {
        padding: 8px 6px;
    }

    .price-label {
        font-size: 7px;
    }

    .price-amount {
        font-size: 17px;
    }

    .price-divider {
        font-size: 14px;
    }

    .filter-actions-group {
        flex-direction: column;
        width: 100%;
        min-width: auto;
    }

    .apply-filter-btn,
    .clear-filter-btn {
        max-width: 100%;
        height: 48px;
        font-size: 12px;
    }

    .apply-filter-btn i,
    .clear-filter-btn i {
        font-size: 12px;
    }

    /* Tom Select dropdowns on mobile */
    .ts-wrapper .ts-control {
        padding: 9px 38px 9px 11px;
        min-height: 40px;
        font-size: 12px;
    }

    .ts-wrapper .ts-control .item {
        font-size: 12px;
    }

    .ts-dropdown {
        max-height: 280px;
    }

    .ts-dropdown .option {
        padding: 11px 12px;
        font-size: 12px;
        min-height: 42px;
    }

    .option-text {
        font-size: 12px;
    }

    .option-parent {
        font-size: 8px;
        padding: 2px 5px;
    }

    .item-selected {
        font-size: 12px;
    }

    /* Availability dropdown */
    .availability-label {
        font-size: 11px;
    }

    .availability-option-item span {
        font-size: 11px;
    }

    .availability-item-selected span {
        font-size: 11px;
    }

    /* Category dropdown button on mobile */
    .category-dropdown-btn,
    .availability-dropdown-btn {
        padding: 7px;
        right: 8px;
    }

    /* Price sliders touch-friendly */
    .price-range-slider {
        height: 8px;
    }

    .price-range-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        border-width: 3px;
    }

    .price-range-slider::-moz-range-thumb {
        width: 22px;
        height: 22px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .filters-container-horizontal {
        padding: 14px 10px;
        border-radius: 12px;
    }

    .filters-grid {
        gap: 12px;
    }

    .filter-card {
        padding: 12px;
    }

    .filter-icon-wrapper {
        width: 32px;
        height: 32px;
    }

    .filter-icon-wrapper i {
        font-size: 14px;
    }

    .filter-label {
        font-size: 10px;
        letter-spacing: 0.1px;
    }

    .filter-subtitle {
        font-size: 8px;
    }

    .price-badge {
        padding: 8px 5px;
    }

    .price-label {
        font-size: 7px;
    }

    .price-amount {
        font-size: 16px;
    }

    .price-divider {
        font-size: 12px;
    }

    .apply-filter-btn,
    .clear-filter-btn {
        height: 46px;
        font-size: 11px;
    }

    .apply-filter-btn i,
    .clear-filter-btn i {
        font-size: 11px;
    }

    /* Tom Select on small mobile */
    .ts-wrapper .ts-control {
        padding: 8px 34px 8px 9px;
        min-height: 38px;
        font-size: 11px;
    }

    .ts-wrapper .ts-control .item {
        font-size: 11px;
    }

    .ts-dropdown .option {
        padding: 12px 10px;
        font-size: 11px;
        min-height: 44px;
    }

    .option-text {
        font-size: 11px;
    }

    .option-parent {
        font-size: 7px;
        padding: 2px 4px;
    }

    .item-selected {
        font-size: 11px;
    }

    .availability-label {
        font-size: 10px;
    }

    .availability-option-item span,
    .availability-item-selected span {
        font-size: 10px;
    }

    .category-dropdown-btn,
    .availability-dropdown-btn {
        padding: 6px;
        right: 6px;
    }

    /* Price sliders extra touch-friendly */
    .price-range-slider {
        height: 10px;
    }

    .price-range-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .price-range-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .price-sliders {
        gap: 10px;
    }
}

/* ===================================
   Fix Overflow for Dropdowns
   =================================== */

#filtersSection {
    position: relative;
    z-index: 50;
    overflow: visible !important;
}

.filters-container-horizontal,
.filters-form-horizontal,
.filters-grid {
    overflow: visible !important;
}

/* Ensure body dropdowns are properly positioned */
body > .ts-dropdown {
    position: absolute !important;
    z-index: 10000 !important;
}

/* ===================================
   Additional Animations
   =================================== */

@keyframes sortIconBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-10deg);
    }
    75% {
        transform: scale(1.1) rotate(10deg);
    }
}

/* ===================================
   Mobile Touch Optimization
   =================================== */

@media (max-width: 767px) {
    /* Prevent text selection on buttons */
    .filter-toggle-btn,
    .products-count,
    .apply-filter-btn,
    .clear-filter-btn,
    .category-dropdown-btn,
    .availability-dropdown-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        user-select: none;
        -webkit-user-select: none;
    }

    /* Prevent text overflow */
    .filter-label,
    .filter-subtitle,
    .option-text,
    .item-selected,
    .availability-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Allow wrapping for multi-line content */
    .filter-subtitle {
        white-space: normal;
        line-height: 1.3;
    }

    /* Ensure dropdowns don't cause horizontal scroll */
    .ts-dropdown {
        max-width: calc(100vw - 32px);
        left: 50% !important;
        transform: translateX(-50%);
    }

    /* Better touch targets for filter cards */
    .filter-card {
        touch-action: manipulation;
    }

    /* Optimize scrolling in dropdowns */
    .ts-dropdown .ts-dropdown-content {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent zoom on input focus (iOS) */
    .ts-wrapper .ts-control input {
        font-size: 16px !important;
    }

    .ts-wrapper .ts-control input::placeholder {
        font-size: 12px !important;
    }

    /* Compact button text */
    .apply-filter-btn span,
    .clear-filter-btn span {
        font-size: inherit;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    /* Smaller placeholder text */
    .ts-wrapper .ts-control input::placeholder {
        font-size: 11px !important;
    }
}

@media (max-width: 374px) {
    /* Even smaller placeholder text */
    .ts-wrapper .ts-control input::placeholder {
        font-size: 10px !important;
    }
}

/* ===================================
   Ultra Small Screens (< 375px)
   =================================== */

@media (max-width: 374px) {
    .shop-controls-wrapper {
        padding: 10px 0;
    }

    .filter-toggle-btn {
        padding: 9px 12px;
        font-size: 10px;
    }

    .filter-toggle-btn i {
        font-size: 10px;
    }

    .filter-toggle-btn .active-badge {
        font-size: 6px;
        padding: 1px 3px;
    }

    .products-count {
        padding: 8px 10px;
    }

    .products-count span,
    .products-count strong {
        font-size: 9px;
    }

    .products-count i {
        font-size: 11px;
    }

    .sort-wrapper {
        padding: 7px 8px;
    }

    .sort-label {
        font-size: 9px;
    }

    .sort-label span {
        display: none;
    }

    .sort-label i {
        font-size: 12px;
    }

    .ts-wrapper.sort-select .ts-control {
        padding: 4px 5px;
        font-size: 9px;
        min-height: 26px;
    }

    /* Sort dropdown options on ultra-small screens */
    .sort-option-item,
    .sort-item-selected {
        font-size: 10px;
    }

    .sort-option-item i,
    .sort-item-selected i {
        font-size: 9px;
    }

    .sort-option-item span,
    .sort-item-selected span {
        font-size: 10px;
    }

    .ts-wrapper.sort-select .ts-dropdown .option {
        padding: 10px 8px;
        font-size: 10px;
    }

    .filters-container-horizontal {
        padding: 12px 8px;
    }

    .filter-card {
        padding: 10px;
    }

    .filter-icon-wrapper {
        width: 28px;
        height: 28px;
    }

    .filter-icon-wrapper i {
        font-size: 12px;
    }

    .filter-label {
        font-size: 9px;
        letter-spacing: 0.1px;
    }

    .filter-subtitle {
        font-size: 7px;
    }

    .price-badge {
        padding: 7px 4px;
    }

    .price-label {
        font-size: 6px;
    }

    .price-amount {
        font-size: 14px;
    }

    .price-divider {
        font-size: 11px;
    }

    .apply-filter-btn,
    .clear-filter-btn {
        height: 42px;
        font-size: 10px;
        gap: 4px;
    }

    .apply-filter-btn i,
    .clear-filter-btn i {
        font-size: 10px;
    }

    .ts-wrapper .ts-control {
        padding: 7px 32px 7px 8px;
        min-height: 36px;
        font-size: 10px;
    }

    .ts-wrapper .ts-control .item {
        font-size: 10px;
    }

    .ts-dropdown .option {
        padding: 10px 9px;
        font-size: 10px;
        min-height: 40px;
    }

    .option-text {
        font-size: 10px;
    }

    .option-parent {
        font-size: 7px;
    }

    .availability-label {
        font-size: 9px;
    }
}