/**
 * WooCommerce Category List Styles
 *
 * @package Woo_Category_List
 */

/* Wrapper */
.woo-category-list-wrapper {
    position: relative;
    width: 100%;
}

/* Grid Layout */
.woo-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.woo-category-grid.columns-1 {
    grid-template-columns: repeat(1, 1fr);
}

.woo-category-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.woo-category-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.woo-category-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Category Item */
.woo-category-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e5e5e5;
}

.woo-category-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Category Link */
.woo-category-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 15px;
}

/* Category Image */
.woo-category-image {
    flex-shrink: 0;
    width: 60px;
    min-width: 60px;
}

.woo-category-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Category Content */
.woo-category-content {
    flex: 1;
    min-width: 0;
}

/* Category Title */
.woo-category-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.woo-category-item:hover .woo-category-title {
    color: #0073aa;
}

/* Category Count */
.woo-category-count {
    display: inline-block;
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
}

/* Category Description */
.woo-category-description {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #888888;
    line-height: 1.5;
}

/* No Results */
.woo-category-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 14px;
}

/* Pagination */
.woo-category-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.woo-category-pagination a.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.woo-category-pagination a.pagination-link:hover {
    background-color: #f0f0f0;
    border-color: #cccccc;
    color: #0073aa;
}

.woo-category-pagination a.pagination-link.active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
}

.woo-category-pagination a.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loader */
.woo-category-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading State */
.woo-category-list-wrapper.loading .woo-category-grid {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .woo-category-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .woo-category-grid.columns-3,
    .woo-category-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .woo-category-item {
        padding: 12px;
    }
    
    .woo-category-link {
        gap: 12px;
    }
    
    .woo-category-image,
    .woo-category-image img {
        width: 50px;
        min-width: 50px;
        height: 50px;
    }
    
    .woo-category-title {
        font-size: 14px;
    }
    
    .woo-category-count {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .woo-category-grid,
    .woo-category-grid.columns-2,
    .woo-category-grid.columns-3,
    .woo-category-grid.columns-4 {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .woo-category-pagination {
        gap: 6px;
    }
    
    .woo-category-pagination a.pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* Animation for fade in */
.woo-category-item {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Support */
[dir="rtl"] .woo-category-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .woo-category-content {
    text-align: right;
}
