/* Modern Categories Styling - Reduced Gradient */
.modern-categories-header {
    width: 100%;
    background: var(--color-primary);
    border: none;
    padding: 15px 20px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modern-categories-header:hover {
    background: var(--color-primary);
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modern-categories-header .header-text {
    font-size: 16px;
    font-weight: 600;
}

.modern-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.modern-category-item {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.modern-category-item:last-child {
    border-bottom: none;
}

.modern-category-item:hover {
    background: #f8fafc;
    transform: translateX(2px);
}

.modern-category-link {
    display: block;
    padding: 14px 18px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.modern-category-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.modern-category-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.modern-category-link:hover::before {
    transform: scaleY(1);
}

.category-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.category-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #94a3b8;
}

.modern-category-link:hover .category-arrow {
    color: var(--color-primary);
    transform: translateX(3px);
}

.has-subcategory .category-arrow {
    opacity: 1;
}

.modern-subcategory-container {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.modern-subcategory-container .modern-category-item {
    border-bottom: 1px solid #e2e8f0;
}

.modern-subcategory-container .modern-category-link {
    padding: 12px 18px 12px 35px;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}

.modern-subcategory-container .modern-category-link:hover {
    background: white;
    color: var(--color-primary);
}

.modern-subcategory-container .modern-category-link::before {
    left: 32px;
    width: 2px;
}

/* Modern Filters Styling */
.modern-filters-header {
    background: var(--color-primary);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.modern-filters-header .widget_title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modern-filters-header .fa-filter {
    color: white;
    font-size: 14px;
}

.modern-filters-container {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.filter-section {
    border-bottom: 1px solid #f1f5f9;
    padding: 0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-header:hover {
    background: #f1f5f9;
}

.filter-header.collapsed .filter-chevron {
    transform: rotate(-90deg);
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.filter-icon {
    color: var(--color-primary);
    font-size: 12px;
}

.filter-chevron {
    color: #6b7280;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-content {
    padding: 16px 20px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-filter-item {
    border-bottom: 1px solid #f1f5f9;
}

.modern-filter-item:last-child {
    border-bottom: none;
}

/* Modern Checkbox Styling */
.modern-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.modern-checkbox {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.modern-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    font-weight: 400;
    transition: color 0.3s ease;
}

.modern-checkbox-label:hover {
    color: var(--color-primary);
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-checkbox:checked + .modern-checkbox-label .checkmark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.modern-checkbox:checked + .modern-checkbox-label .checkmark::after {
    opacity: 1;
}

.modern-checkbox:hover + .modern-checkbox-label .checkmark {
    border-color: var(--color-primary);
}

.option-text {
    flex: 1;
}

/* Price Range Slider Styling */
.price-range-wrapper {
    margin-top: 20px;
    padding: 0 5px;
}

.price-range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.min-price-label,
.max-price-label {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    min-width: 50px;
    text-align: center;
    font-size: 12px;
}

.slider-wrapper {
    margin-top: 10px;
    position: relative;
    padding: 10px 0;
}

.slider-wrapper .slider {
    background: #e2e8f0;
    border-radius: 6px;
    height: 6px;
    position: relative;
    overflow: visible;
    margin: 0 10px;
}

.slider-wrapper .slider-track {
    background: #e2e8f0;
    height: 6px;
    border-radius: 6px;
    position: relative;
    width: 100%;
}

.slider-wrapper .slider-track-low,
.slider-wrapper .slider-track-high {
    background: #e2e8f0;
    height: 6px;
    border-radius: 6px;
    position: absolute;
    top: 0;
}

.slider-wrapper .slider-selection {
    background: var(--color-primary);
    height: 6px;
    border-radius: 6px;
    position: absolute;
    top: 0;
}

.slider-wrapper .slider-handle {
    background: var(--color-primary);
    border: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    margin-left: -8px;
}

.slider-wrapper .slider-handle:hover {
    background: var(--color-primary-darker);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.slider-wrapper .slider-handle.round {
    border-radius: 50%;
}

/* Ensure the input range is properly styled */
.input-range {
    width: 100%;
    height: 6px;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 2;
    cursor: pointer;
}

/* Mobile Menu Styling */
.navbar-toggler.mobile {
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.navbar-toggler.mobile:hover {
    background: var(--color-primary);
    filter: brightness(1.1);
    transform: scale(1.05);
}

.navbar-toggler.mobile:focus {
    box-shadow: 0 0 0 2px rgba(var(--color-primary), 0.25);
}

/* Mobile Categories Menu */
#categories-mobile-menu {
    padding: 10px 0;
}

#categories-mobile-menu .modern-category-item {
    margin: 0 10px;
    border-radius: 6px;
    overflow: hidden;
}

#categories-mobile-menu .modern-category-link {
    padding: 12px 16px;
    font-size: 14px;
}

/* Mobile-Specific Improvements */
@media (max-width: 991.98px) {
    .mobile-categories-toggle,
    .mobile-filters-toggle {
        margin-bottom: 15px;
    }
    
    .mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        background: var(--color-primary);
        border: 1px solid var(--color-primary);
        color: white;
    }
    
    .mobile-toggle-btn:hover {
        background: var(--color-primary);
        filter: brightness(1.1);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        color: white;
    }

    .mobile-toggle-btn:focus {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: white;
        box-shadow: 0 0 0 2px rgba(var(--color-primary), 0.25);
    }

    .mobile-toggle-btn[aria-expanded="true"] {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: white;
    }
    
    .mobile-categories-content,
    .mobile-filters-content {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-top: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }
    
    .mobile-categories-list {
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .mobile-categories-list .modern-category-item {
        border-bottom: 1px solid #f1f5f9;
        margin: 0;
    }
    
    .mobile-categories-list .modern-category-item:last-child {
        border-bottom: none;
    }
    
    .mobile-categories-list .modern-category-link {
        padding: 12px 16px;
        font-size: 13px;
        color: #374151;
        display: block;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .mobile-categories-list .modern-category-link:hover {
        background: #f8fafc;
        color: var(--color-primary);
        text-decoration: none;
    }
    
    .mobile-categories-list .category-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-categories-list .category-name {
        font-size: 13px;
        font-weight: 500;
    }
    
    .mobile-categories-list .category-arrow {
        font-size: 10px;
        color: #9ca3af;
    }
    
    .mobile-categories-list .modern-subcategory-container {
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }
    
    .mobile-categories-list .modern-subcategory-container .modern-category-link {
        padding: 10px 16px 10px 32px;
        font-size: 12px;
        color: #6b7280;
        font-weight: 400;
    }
    
    .mobile-filters-content .filter-section {
        border-bottom: 1px solid #f1f5f9;
    }
    
    .mobile-filters-content .filter-section:last-child {
        border-bottom: none;
    }
    
    .mobile-filters-content .filter-header {
        padding: 12px 16px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-filters-content .filter-header:hover {
        background: #f1f5f9;
    }
    
    .mobile-filters-content .filter-header.collapsed .filter-chevron {
        transform: rotate(-90deg);
    }
    
    .mobile-filters-content .filter-title {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }
    
    .mobile-filters-content .filter-chevron {
        color: #6b7280;
        font-size: 10px;
        transition: transform 0.3s ease;
    }
    
    .mobile-filters-content .filter-content {
        padding: 12px 16px;
    }
    
    .mobile-filters-content .filter-options {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-filters-content .modern-checkbox-label {
        font-size: 12px;
        color: #4b5563;
    }
    
    .mobile-filters-content .checkmark {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
    
    .mobile-filters-content .price-range-wrapper {
        margin-top: 15px;
        padding: 0 5px;
    }
    
    .mobile-filters-content .price-range-labels {
        margin-bottom: 12px;
        font-size: 11px;
    }
    
    .mobile-filters-content .min-price-label,
    .mobile-filters-content .max-price-label {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 45px;
    }
    
    .mobile-filters-content .slider-wrapper {
        padding: 8px 0;
        margin-top: 8px;
    }
    
    .mobile-filters-content .slider-wrapper .slider {
        height: 4px;
        margin: 0 8px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-track {
        height: 4px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-track-low,
    .mobile-filters-content .slider-wrapper .slider-track-high {
        height: 4px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-selection {
        height: 4px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-handle {
        width: 14px;
        height: 14px;
        border-width: 2px;
        margin-left: -7px;
    }
    
    .mobile-filters-content .input-range {
        height: 4px;
    }
    
    /* Hide desktop categories and filters on mobile */
    .d-lg-none {
        display: block !important;
    }
    
    .d-none.d-lg-block {
        display: none !important;
    }
    
    /* Improve mobile product header */
    .product_header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch !important;
    }
    
    .product_header_left,
    .product_header_right {
        width: 100%;
    }
    
    .product_header_left .custom_select {
        justify-content: center;
    }
    
    .product_header_right {
        display: flex;
        justify-content: center;
        gap: 15px;
    }
    
    .products_view {
        display: flex;
        gap: 5px;
    }
    
    .products_view .shorting_icon {
        padding: 8px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        color: #6b7280;
        transition: all 0.3s ease;
        text-decoration: none;
        background: white;
    }
    
    .products_view .shorting_icon:hover {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
        text-decoration: none;
    }
    
    .products_view .shorting_icon.active {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }
    
    /* Mobile pagination improvements */
    .pagination-ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination-ul li {
        margin: 0 2px;
    }
    
    .pagination-ul li a {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 36px;
        text-align: center;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        color: #6b7280;
        text-decoration: none;
        background: white;
        transition: all 0.3s ease;
    }

    .pagination-ul li a:hover {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }

    .pagination-ul li.active a {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }
    
    /* Mobile results per page */
    .col-lg-6 {
        margin-bottom: 15px;
    }
    
    .col-lg-6 .d-flex {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .col-lg-6 label {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .col-lg-6 select {
        min-width: 80px;
    }
}

/* Touch-friendly improvements */
@media (max-width: 767.98px) {
    .mobile-toggle-btn {
        padding: 14px 18px;
        font-size: 15px;
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: white;
    }
    
    .mobile-categories-list .modern-category-link {
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .mobile-categories-list .modern-subcategory-container .modern-category-link {
        padding: 12px 18px 12px 36px;
        font-size: 13px;
    }
    
    .mobile-filters-content .filter-header {
        padding: 14px 18px;
    }
    
    .mobile-filters-content .filter-content {
        padding: 14px 18px;
    }
    
    .mobile-filters-content .modern-checkbox-label {
        font-size: 13px;
        padding: 4px 0;
    }
    
    .mobile-filters-content .checkmark {
        width: 18px;
        height: 18px;
        margin-right: 12px;
    }
    
    .mobile-filters-content .price-range-wrapper {
        padding: 0 3px;
    }
    
    .mobile-filters-content .slider-wrapper {
        padding: 12px 0;
    }
    
    .mobile-filters-content .slider-wrapper .slider {
        margin: 0 6px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-handle {
        width: 16px;
        height: 16px;
        margin-left: -8px;
    }
    
    .mobile-filters-content .slider-wrapper .slider-handle:hover {
        transform: translateY(-50%) scale(1.2);
    }
}

/* Animation improvements */
.mobile-categories-content,
.mobile-filters-content {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.mobile-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mobile-categories-list:empty::after {
    content: "Loading...";
    display: block;
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 13px;
}

/* Scrollbar styling for mobile categories */
.mobile-categories-list::-webkit-scrollbar {
    width: 4px;
}

.mobile-categories-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.mobile-categories-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.mobile-categories-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* General button improvements */
.btn-primary {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
}

.btn-primary:hover {
    background: var(--color-primary) !important;
    filter: brightness(1.1) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
}

.btn-primary:focus {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(var(--color-primary), 0.25) !important;
}

.btn-outline-primary {
    background: transparent !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
}

.btn-outline-primary:focus {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(var(--color-primary), 0.25) !important;
}