/* ==============================================
   Category Page Styles
   ============================================== */

/* Page Header */
.page-header {
    border-bottom: 1px solid var(--gray-200);
}

.category-stats .badge {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Category Groups */
.categories-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.category-group {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.category-group:hover {
    box-shadow: var(--shadow-md);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.category-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.category-header .lot-count {
    font-size: 0.875rem;
    color: var(--gray-600);
    background-color: var(--gray-100);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

/* Subcategory Lists */
.subcategory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s ease;
}

.subcategory-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateX(5px);
}

.subcategory-name {
    font-weight: 500;
}

.subcategory-count {
    font-size: 0.875rem;
    color: var(--gray-600);
    background-color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.subcategory-item:hover .subcategory-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Category Featured */
.category-featured {
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: 100%;
}

.category-featured h6 {
    color: var(--gray-800);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.featured-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brand-link {
    display: inline-block;
    background-color: var(--white);
    color: var(--gray-700);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.brand-link:hover {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-card {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card h5 {
    color: var(--gray-900);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

/* Popular Searches */
.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-tag {
    display: inline-block;
    background-color: var(--gray-100);
    color: var(--gray-700);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-tag:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Recent Items */
.recent-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.recent-item:hover {
    background-color: var(--gray-100);
}

.recent-item img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.recent-info {
    flex: 1;
}

.recent-info h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.recent-info p {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

/* Tips List */
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tip-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.tip-item i {
    font-size: 1.125rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.tip-item p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 991px) {
    .categories-grid {
        gap: 1.5rem;
    }
    
    .category-group {
        padding: 1.5rem;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .category-header h3 {
        font-size: 1.25rem;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
    
    .category-featured {
        margin-top: 1rem;
    }
}

@media (max-width: 767px) {
    .category-group {
        padding: 1rem;
    }
    
    .category-header h3 {
        font-size: 1.125rem;
    }
    
    .subcategory-item {
        padding: 0.625rem 0.75rem;
    }
    
    .subcategory-name {
        font-size: 0.875rem;
    }
    
    .subcategory-count {
        font-size: 0.75rem;
    }
    
    .category-featured {
        padding: 1rem;
    }
    
    .sidebar-card {
        padding: 1rem;
    }
    
    .recent-item {
        padding: 0.5rem;
    }
    
    .recent-item img {
        width: 50px;
        height: 50px;
    }
    
    .recent-info h6 {
        font-size: 0.8125rem;
    }
    
    .recent-info p {
        font-size: 0.8125rem;
    }
}

/* Search Header on Category Page */
.search-header .search-form .form-control,
.search-header .search-form .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    padding: 0.625rem 1rem;
}

.search-header .search-form .form-control:focus,
.search-header .search-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Breadcrumb */
.breadcrumb-section {
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-color);
}

/* Loading State */
.category-group.loading {
    opacity: 0.6;
    pointer-events: none;
}

.category-group.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hover Effects */
.category-group:hover .category-header h3 {
    color: var(--primary-color);
}

.sidebar-card:hover {
    box-shadow: var(--shadow-md);
}

/* Icon Styling */
.category-header i {
    color: var(--primary-color);
}

/* Badge Styling */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-success {
    background-color: #22c55e !important;
}