/**
 * Category Cascade Selector Styles
 * Preserves store filtering functionality
 */

.wc-category-select {
    padding: 20px 0;
}

.wc-category-select .selectors-row {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.wc-category-select .selector-wrapper {
    flex: 1;
    min-width: 200px;
}

.wc-category-select .selector-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wc-category-select .category-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s;
}

.wc-category-select .category-select:hover:not(:disabled) {
    border-color: #999;
}

.wc-category-select .category-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.wc-category-select .category-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Custom Select with Images */
.wc-category-select .selector-wrapper.has-images {
    position: relative;
}

.wc-category-select .category-select option {
    padding: 8px 8px 8px 40px;
    background-repeat: no-repeat;
    background-position: 5px center;
    background-size: 25px 25px;
}

.wc-category-select .category-select-custom {
    position: relative;
    cursor: pointer;
}

.wc-category-select .category-select-custom .select-display {
    width: 100%;
    padding: 10px 30px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 0.3s;
    position: relative;
}

.wc-category-select .category-select-custom .select-display::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.wc-category-select .category-select-custom .select-display:hover {
    border-color: #999;
}

.wc-category-select .category-select-custom .select-display.open {
    border-color: #0073aa;
}

.wc-category-select .category-select-custom .cat-image {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border-radius: 3px;
}

.wc-category-select .category-select-custom .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.wc-category-select .category-select-custom .dropdown-options.open {
    display: block;
}

.wc-category-select .category-select-custom .dropdown-option {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wc-category-select .category-select-custom .dropdown-option:hover {
    background-color: #f5f5f5;
}

.wc-category-select .category-select-custom .dropdown-option.selected {
    background-color: #e8f4f8;
}

.wc-category-select .category-select-custom .dropdown-option img {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border-radius: 3px;
}

/* Breadcrumbs */
.wc-category-select .breadcrumbs-container {
    margin-bottom: 20px;
    margin-top: 15px;
}

.wc-category-select .breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    font-size: 14px;
}

.wc-category-select .breadcrumb-item {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s;
}

.wc-category-select .breadcrumb-item:hover {
    color: #005a87;
    text-decoration: underline;
}

.wc-category-select .breadcrumb-separator {
    color: #999;
    margin: 0 5px;
}

.wc-category-select .breadcrumb-current {
    color: #333;
    font-weight: 600;
}

/* Products Container */
#products-container {
    margin-top: 30px;
}

.products-header {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid #ddd;
}

.product-count {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Grid Layout */
.products-grid .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.products-grid .product-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    transition: all 0.3s;
    text-align: center;
}

.products-grid .product-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Row Layout */
.products-rows .products-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
}

.products-rows .product-item {
    display: flex;
    gap: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    transition: all 0.3s;
    align-items: center;
}

.products-rows .product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Product Elements */
.product-item .product-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.products-rows .product-item .product-image {
    width: 120px;
    margin-bottom: 0;
}

.product-item .product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-item .product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.product-item .product-title a:hover {
    color: #0073aa;
}

.product-item .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2ecc71;
    margin-bottom: 10px;
}

.product-item .product-sku {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.product-item .product-stock {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
}

.product-item .in-stock {
    background-color: #d4edda;
    color: #155724;
}

.product-item .out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

/* Pagination */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 0 0 4px 4px;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #005a87;
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Store Filter Badge */
.store-filter-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #0073aa;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-category-select .selectors-row {
        flex-direction: column;
    }
    
    .wc-category-select .selector-wrapper {
        width: 100%;
    }
    
    .products-grid .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .products-rows .product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .products-rows .product-item .product-image {
        width: 100%;
        max-width: 200px;
    }
}