/* Category & Product List Page Styles */
.category-page {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.filter-sidebar * {
    box-sizing: border-box;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-clear {
    color: #3b82f6;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.filter-clear:hover {
    text-decoration: underline;
}

/* Search Filter */
.filter-search {
    margin-bottom: 2rem;
}

.filter-search h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.search-input-group {
    position: relative;
    width: 100%;
}

.search-input-group input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input-group button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
}

/* Price Filter */
.filter-price {
    margin-bottom: 2rem;
}

.filter-price h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.price-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.price-inputs input {
    flex: 1;
    min-width: 0; /* Important for flex child to shrink */
    padding: 0.5rem 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.price-inputs input:focus {
    outline: none;
    border-color: #3b82f6;
}

.price-inputs span {
    color: #64748b;
    flex-shrink: 0;
}

/* Category Filter */
.filter-category {
    margin-bottom: 2rem;
}

.filter-category h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.filter-category h6 i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.filter-category.collapsed h6 i {
    transform: rotate(-90deg);
}

.filter-category.collapsed .filter-options {
    display: none;
}

.filter-options {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.filter-options::-webkit-scrollbar {
    width: 4px;
}

.filter-options::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.filter-options li {
    margin-bottom: 0.75rem;
}

.filter-options li a {
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    transition: all 0.2s ease;
    word-break: break-word;
}

.filter-options li a:hover {
    color: #3b82f6;
    padding-left: 0.5rem;
}

.filter-options li.active a {
    color: #3b82f6;
    font-weight: 600;
}

/* Rating Filter */
.filter-rating {
    margin-bottom: 2rem;
}

.filter-rating h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.filter-rating h6 i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.filter-rating.collapsed h6 i {
    transform: rotate(-90deg);
}

.filter-rating.collapsed .rating-option {
    display: none;
}

.rating-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.rating-option input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

.rating-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

.rating-stars {
    color: #fbbf24;
}

/* Products Container */
.products-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Toolbar */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-toggle-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-dropdown label {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.sort-dropdown select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.25rem;
}

.view-toggle button {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.view-toggle button.active {
    background: #3b82f6;
    color: white;
}

/* Product Grid (List Layout - Smaller) */
.product-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.product-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    height: auto;
}

.product-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.product-card-image {
    position: relative;
    width: 220px;
    min-width: 220px;
    height: 150px;
    background: #f1f5f9;
    overflow: hidden;
    flex-shrink: 0;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.product-version {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
}

.product-card-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.product-card-header {
    flex-grow: 1;
}

.product-author {
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-stars-small {
    display: flex;
    gap: 0.1rem;
    color: #fbbf24;
    font-size: 0.8rem;
}

.rating-count {
    color: #64748b;
    font-size: 0.75rem;
}

.product-sale-info {
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.product-price-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.product-preview-btn {
    background: #1e293b;
    color: white;
    padding: 0.45rem 1rem;
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.product-preview-btn:hover {
    background: #3b82f6;
    transform: scale(1.05);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #475569;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: #94a3b8;
}

/* Mobile Filter Sidebar */
@media (max-width: 991px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease;
        margin-bottom: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .filter-sidebar.show-mobile {
        left: 0;
    }
    
    .filter-sidebar.show-mobile::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

@media (max-width: 768px) {
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .product-card {
        flex-direction: column;
    }
    
    .product-card-image {
        width: 100%;
        height: 180px;
    }
    
    .product-card-body {
        padding: 1rem;
    }
}

/* Custom Scrollbar for Filter Sidebar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

