/**
 * Destoon Mall List Page Styles
 * Category filtering, sorting, and pagination styles
 */

/* Product List Wrapper */
#product-list-wrapper {
    min-height: 400px;
    transition: opacity 0.3s ease;
    position: relative;
}

#product-list-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Product Grid */
.product-grid {
    transition: opacity 0.3s ease;
}

/* Product Grid Layout */
.pro_centerList {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.product-grid-item {
    position: relative;
    top: 0;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.product-grid-item:hover {
    top: -0.5rem;
    text-decoration: none;
}

.product-grid-item .pro-img {
    border-radius: 0.25rem;
    overflow: hidden;
}

.product-grid-item .pro-name {
    font-size: 0.875rem;
    color: #333;
}

.product-grid-item .pro-name .pro-icon {
    width: 2rem;
    height: 1rem;
    margin-right: 0.5rem;
}

.product-grid-item .pro-price {
    font-size: 1.25rem;
    color: #ff5b00;
    font-weight: 600;
}

.product-grid-item .pro-sold {
    font-size: 0.75rem;
    color: #666;
}

/* Fixed Ratio Image Container */
.fixed-ratio {
    display: block;
    position: relative;
    overflow: hidden;
}

.fixed-ratio.square::before {
    content: "\0020";
    display: block;
    padding: 50% 0;
}

.fixed-ratio > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.object-fit-contain {
    object-fit: contain;
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sort Options */
.sort-option {
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.sort-option:hover {
    color: #f09007;
    text-decoration: none;
}

.sort-option.active {
    color: #f09007;
    background-color: #f8f9fa;
    font-weight: 500;
}

.price-arrows {
    margin-left: 4px;
}

.price-arrows svg {
    margin: 1px 0;
}

/* Layout Stability */
.container {
    position: relative;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f09007;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination Styles */
.custom-pagination .pagination-container {
    gap: 8px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: #f09007;
    color: #f09007;
    text-decoration: none;
}

.page-btn.active {
    background-color: #f09007;
    border-color: #f09007;
    color: #fff;
    font-weight: 500;
}

.page-btn.disabled {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

.page-btn.disabled:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

.page-btn.prev-btn,
.page-btn.next-btn {
    padding: 6px 16px;
    gap: 4px;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #999;
    font-size: 14px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.page-jump {
    align-items: center;
    gap: 8px;
}

.jump-input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.jump-input:focus {
    border-color: #f09007;
    box-shadow: 0 0 0 2px rgba(240, 144, 7, 0.2);
}

.jump-go-btn {
    height: 36px;
    padding: 6px 16px;
    background-color: #f09007;
    border: 1px solid #f09007;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.jump-go-btn:hover {
    background-color: #e08006;
    border-color: #e08006;
}

/* Category Filter Styles */
.filter-option {
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-option:hover {
    color: #f09007;
    text-decoration: none;
}

.filter-option.active {
    color: #f09007;
    font-weight: 500;
}

.filter-option .count {
    color: #999;
    font-size: 0.9em;
}

.filter-option.active .count {
    color: #f09007;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .pro_centerList {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .pro_centerList {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pro_centerList {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pagination-info,
    .page-jump {
        margin-top: 8px;
        margin-left: 0 !important;
    }
    
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .jump-input {
        width: 50px;
        height: 32px;
    }
    
    .jump-go-btn {
        height: 32px;
        padding: 4px 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .pro_centerList {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .product-grid-item .pro-price {
        font-size: 1rem;
    }
    
    .product-grid-item .pro-name {
        font-size: 0.75rem;
    }
}
