﻿/* ===== PRODUCT LIST PAGE STYLES - SCOPED ĐỂ KHÔNG ẢNH HƯỞNG HEADER ===== */

/* ===== PRODUCT LIST SCOPED VARIABLES ===== */
.product-list-page,
.product-list-page * {
    /* Scoped variables chỉ áp dụng cho trang product list */
    --pl-primary-green: #28a745;
    --pl-primary-green-light: #34ce57;
    --pl-primary-green-dark: #1e7e34;
    --pl-secondary-green: #20c997;
    --pl-accent-green: #17a2b8;
    --pl-light-green-bg: #d4edda;
    --pl-very-light-green: #f8f9fa;
    /* Màu trung tính scoped */
    --pl-white: #ffffff;
    --pl-off-white: #fafafa;
    --pl-light-gray: #f8f9fa;
    --pl-gray: #6c757d;
    --pl-dark-gray: #495057;
    --pl-text-dark: #2c3e50;
    --pl-text-muted: #6c757d;
    /* Màu chức năng scoped */
    --pl-success: #28a745;
    --pl-warning: #fd7e14;
    --pl-error: #dc3545;
    --pl-info: #17a2b8;
    /* Hiệu ứng scoped */
    --pl-shadow-sm: 0 2px 4px rgba(40, 167, 69, 0.08);
    --pl-shadow-md: 0 4px 8px rgba(40, 167, 69, 0.12);
    --pl-shadow-lg: 0 8px 20px rgba(40, 167, 69, 0.15);
    --pl-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --pl-border-radius: 12px;
    --pl-border-radius-sm: 8px;
    --pl-border-radius-lg: 16px;
    --pl-border-light: #e3f2e6;
}

/* ===== MAIN CONTAINER ===== */
.product-list-page {
    background: linear-gradient(135deg, #fafffe 0%, #f0fdf4 100%);
    min-height: calc(100vh - 200px);
    padding: 1.5rem;
}

    /* ===== BREADCRUMB STYLES ===== */
    .product-list-page .breadcrumb {
        background: linear-gradient(135deg, var(--pl-light-green-bg), #e8f8ea);
        border: 1px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius);
        padding: 1rem 1.5rem;
        box-shadow: var(--pl-shadow-sm);
        backdrop-filter: blur(10px);
        margin-bottom: 1.5rem;
    }

    .product-list-page .breadcrumb-item a {
        color: var(--pl-primary-green);
        text-decoration: none;
        font-weight: 600;
        transition: var(--pl-transition);
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
    }

        .product-list-page .breadcrumb-item a:hover {
            color: var(--pl-primary-green-dark);
            background: rgba(40, 167, 69, 0.1);
            transform: translateY(-1px);
        }

    .product-list-page .breadcrumb-item.active {
        color: #155724;
        font-weight: 600;
    }

    .product-list-page .breadcrumb-item + .breadcrumb-item::before {
        color: var(--pl-primary-green);
        font-weight: bold;
    }

    /* ===== FILTER SIDEBAR ===== */
    .product-list-page .filter-sidebar {
        background: var(--pl-white);
        border: 1px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius-lg);
        box-shadow: var(--pl-shadow-md);
        position: sticky;
        top: 20px;
        overflow: hidden;
        padding: 1.5rem;
    }

    .product-list-page .filter-title {
        color: #155724;
        font-weight: 800;
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 3px solid var(--pl-light-green-bg);
        display: flex;
        align-items: center;
    }

        .product-list-page .filter-title i {
            color: var(--pl-primary-green);
            margin-right: 0.5rem;
            font-size: 1.4rem;
        }

    .product-list-page .filter-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--pl-border-light);
    }

        .product-list-page .filter-section:last-of-type {
            border-bottom: none;
            margin-bottom: 1rem;
        }

        .product-list-page .filter-section h5 {
            color: #155724;
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            position: relative;
            padding-left: 1rem;
        }

            .product-list-page .filter-section h5::before {
                content: '';
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                width: 4px;
                height: 20px;
                background: linear-gradient(135deg, var(--pl-primary-green), var(--pl-secondary-green));
                border-radius: 2px;
            }

    /* ===== FORM CONTROLS ===== */
    .product-list-page .form-check {
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--pl-border-radius-sm);
        transition: var(--pl-transition);
    }

        .product-list-page .form-check:hover {
            background: var(--pl-very-light-green);
        }

    .product-list-page .form-check-input {
        width: 1.2rem;
        height: 1.2rem;
        border: 2px solid var(--pl-primary-green);
        border-radius: 4px;
        margin-top: 0.1rem;
    }

        .product-list-page .form-check-input:checked {
            background-color: var(--pl-primary-green);
            border-color: var(--pl-primary-green);
            box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
        }

    .product-list-page .form-check-label {
        color: var(--pl-text-dark);
        font-weight: 500;
        cursor: pointer;
        line-height: 1.4;
        margin-left: 0.5rem;
    }

    .product-list-page .form-select {
        border: 2px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius-sm);
        padding: 0.75rem 1rem;
        font-weight: 500;
        color: var(--pl-text-dark);
        transition: var(--pl-transition);
        background-color: var(--pl-white);
    }

        .product-list-page .form-select:focus {
            border-color: var(--pl-primary-green);
            box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
            outline: none;
        }

    .product-list-page .form-control {
        border: 2px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius-sm);
        padding: 0.5rem 0.75rem;
        font-weight: 500;
        transition: var(--pl-transition);
    }

        .product-list-page .form-control:focus {
            border-color: var(--pl-primary-green);
            box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
            outline: none;
        }

    /* ===== PRICE RANGE ===== */
    .product-list-page .price-range {
        padding: 1rem;
        background: var(--pl-very-light-green);
        border-radius: var(--pl-border-radius-sm);
        border: 1px solid var(--pl-border-light);
    }

    .product-list-page .form-range {
        height: 8px;
        background: linear-gradient(to right, var(--pl-light-green-bg), var(--pl-primary-green));
        border-radius: 4px;
        outline: none;
        margin-bottom: 1rem;
        -webkit-appearance: none;
        appearance: none;
    }

        .product-list-page .form-range::-webkit-slider-thumb {
            width: 20px;
            height: 20px;
            background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
            border-radius: 50%;
            border: 3px solid var(--pl-white);
            box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
        }

        .product-list-page .form-range::-moz-range-thumb {
            width: 20px;
            height: 20px;
            background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
            border-radius: 50%;
            border: 3px solid var(--pl-white);
            box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
            cursor: pointer;
            border: none;
        }

    /* ===== BUTTONS ===== */
    .product-list-page .btn-primary {
        background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
        border: 2px solid var(--pl-primary-green);
        color: var(--pl-white);
        font-weight: 700;
        padding: 0.75rem 1.5rem;
        border-radius: var(--pl-border-radius);
        transition: var(--pl-transition);
        box-shadow: var(--pl-shadow-sm);
        position: relative;
        overflow: hidden;
    }

        .product-list-page .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }

        .product-list-page .btn-primary:hover {
            background: linear-gradient(45deg, var(--pl-primary-green-dark), var(--pl-primary-green));
            border-color: var(--pl-primary-green-dark);
            transform: translateY(-2px);
            box-shadow: var(--pl-shadow-lg);
            color: var(--pl-white);
        }

            .product-list-page .btn-primary:hover::before {
                left: 100%;
            }

    .product-list-page .btn-outline-primary {
        background: transparent;
        border: 2px solid var(--pl-primary-green);
        color: var(--pl-primary-green);
        font-weight: 600;
        padding: 0.5rem 1rem;
        border-radius: var(--pl-border-radius-sm);
        transition: var(--pl-transition);
    }

        .product-list-page .btn-outline-primary:hover {
            background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
            border-color: var(--pl-primary-green);
            color: var(--pl-white);
            transform: translateY(-2px);
            box-shadow: var(--pl-shadow-md);
        }

    /* ===== PRODUCT CONTROLS ===== */
    .product-list-page .product-controls {
        background: var(--pl-white);
        border: 1px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius);
        padding: 1.25rem 1.5rem;
        box-shadow: var(--pl-shadow-sm);
        margin-bottom: 1.5rem;
    }

    .product-list-page .results-count {
        color: var(--pl-text-dark);
        font-weight: 600;
        font-size: 1rem;
        margin: 0;
    }

        .product-list-page .results-count strong {
            color: var(--pl-primary-green);
            font-weight: 800;
        }

    /* ===== PRODUCT CARDS ===== */
    .product-list-page .product-card {
        background: var(--pl-white);
        border: 1px solid var(--pl-border-light);
        border-radius: var(--pl-border-radius-lg);
        box-shadow: var(--pl-shadow-sm);
        transition: var(--pl-transition);
        overflow: hidden;
        position: relative;
        height: 100%;
    }

        .product-list-page .product-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--pl-shadow-lg);
            border-color: var(--pl-primary-green);
        }

    .product-list-page .product-badge {
        position: absolute;
        top: 15px;
        left: 15px;
        background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
        color: var(--pl-white);
        padding: 0.4rem 0.8rem;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 700;
        z-index: 2;
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
        letter-spacing: 0.5px;
    }

    /* ===== PRODUCT IMAGE CONTAINER ===== */
    .product-list-page .product-image-container {
        position: relative;
        overflow: hidden;
        height: 250px;
        cursor: pointer;
    }

        .product-list-page .product-image-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--pl-transition);
        }

        .product-list-page .product-image-container:hover img {
            transform: scale(1.05);
        }

    .product-list-page .quick-view-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(32, 201, 151, 0.9));
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: var(--pl-transition);
        color: var(--pl-white);
        font-weight: 700;
        backdrop-filter: blur(5px);
    }

        .product-list-page .quick-view-overlay i {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
            animation: plPulse 2s ease-in-out infinite;
        }

@keyframes plPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.product-list-page .quick-view-overlay span {
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.product-list-page .product-image-container:hover .quick-view-overlay,
.product-list-page .quick-view-overlay.overlay-hover {
    opacity: 1;
}

/* ===== PRODUCT CARD BODY ===== */
.product-list-page .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-list-page .card-title {
    color: #155724;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-list-page .shop-name {
    color: var(--pl-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

    .product-list-page .shop-name i {
        color: var(--pl-primary-green);
        margin-right: 0.5rem;
    }

.product-list-page .price {
    color: var(--pl-primary-green-dark);
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(40, 167, 69, 0.1);
}

/* ===== NO PRODUCTS STATE ===== */
.product-list-page .no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--pl-white);
    border: 2px dashed var(--pl-border-light);
    border-radius: var(--pl-border-radius-lg);
    color: var(--pl-text-muted);
}

    .product-list-page .no-products i {
        color: var(--pl-gray);
        margin-bottom: 1.5rem;
        opacity: 0.7;
    }

    .product-list-page .no-products h4 {
        color: var(--pl-text-dark);
        font-weight: 700;
        margin-bottom: 1rem;
    }

    .product-list-page .no-products p {
        font-size: 1.1rem;
        line-height: 1.6;
        max-width: 400px;
        margin: 0 auto;
    }

/* ===== PAGINATION ===== */
.product-list-page .pagination {
    border-radius: var(--pl-border-radius);
    overflow: hidden;
    box-shadow: var(--pl-shadow-sm);
}

.product-list-page .page-item {
    margin: 0 2px;
}

.product-list-page .page-link {
    background: var(--pl-white);
    border: 2px solid var(--pl-border-light);
    color: var(--pl-primary-green);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: var(--pl-border-radius-sm);
    transition: var(--pl-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

    .product-list-page .page-link:hover {
        background: var(--pl-light-green-bg);
        border-color: var(--pl-primary-green);
        color: var(--pl-primary-green-dark);
        transform: translateY(-2px);
        box-shadow: var(--pl-shadow-sm);
    }

.product-list-page .page-item.active .page-link {
    background: linear-gradient(45deg, var(--pl-primary-green), var(--pl-secondary-green));
    border-color: var(--pl-primary-green);
    color: var(--pl-white);
    box-shadow: var(--pl-shadow-md);
}

.product-list-page .page-item.disabled .page-link {
    background: var(--pl-light-gray);
    border-color: var(--pl-border-light);
    color: var(--pl-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== ALERT STYLES ===== */
.product-list-page .alert {
    border-radius: var(--pl-border-radius);
    border: none;
    font-weight: 600;
    box-shadow: var(--pl-shadow-sm);
}

.product-list-page .alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

    .product-list-page .alert-danger i {
        color: var(--pl-error);
    }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
    .product-list-page .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .product-list-page .product-controls {
        text-align: center;
    }

    .product-list-page .results-count {
        font-size: 0.95rem;
    }
}

@media (max-width: 767.98px) {
    .product-list-page {
        padding: 1rem;
    }

        .product-list-page .filter-sidebar {
            padding: 1.5rem;
        }

        .product-list-page .filter-title {
            font-size: 1.2rem;
        }

        .product-list-page .product-image-container {
            height: 220px;
        }

        .product-list-page .card-body {
            padding: 1.25rem;
        }

        .product-list-page .card-title {
            font-size: 1rem;
        }

        .product-list-page .price {
            font-size: 1.2rem;
        }

        .product-list-page .quick-view-overlay i {
            font-size: 2rem;
        }

        .product-list-page .quick-view-overlay span {
            font-size: 1rem;
        }
}

@media (max-width: 575.98px) {
    .product-list-page .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .product-list-page .filter-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .product-list-page .form-check {
        padding: 0.4rem 0.5rem;
    }

    .product-list-page .btn-primary {
        padding: 0.7rem 1.25rem;
        font-size: 0.95rem;
    }

    .product-list-page .product-controls {
        padding: 1rem;
    }

    .product-list-page .results-count {
        font-size: 0.9rem;
    }

    .product-list-page .product-image-container {
        height: 200px;
    }

    .product-list-page .page-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: 40px;
    }

    .product-list-page .no-products {
        padding: 3rem 1.5rem;
    }

        .product-list-page .no-products h4 {
            font-size: 1.25rem;
        }

        .product-list-page .no-products p {
            font-size: 1rem;
        }
}

/* ===== LOADING STATES ===== */
.product-list-page .btn.loading i.fa-spinner {
    animation: plSpin 1s linear infinite;
}

@keyframes plSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ACCESSIBILITY ===== */
.product-list-page .btn:focus,
.product-list-page .form-check-input:focus,
.product-list-page .form-control:focus,
.product-list-page .form-select:focus,
.product-list-page .form-range:focus {
    outline: 3px solid rgba(40, 167, 69, 0.3);
    outline-offset: 2px;
}

.product-list-page .product-image-container:focus {
    outline: 3px solid rgba(40, 167, 69, 0.3);
    outline-offset: 2px;
}

/* ===== ANIMATION ENHANCEMENTS ===== */
.product-list-page .product-card {
    animation: plFadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

    .product-list-page .product-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .product-list-page .product-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .product-list-page .product-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .product-list-page .product-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    .product-list-page .product-card:nth-child(5) {
        animation-delay: 0.5s;
    }

    .product-list-page .product-card:nth-child(6) {
        animation-delay: 0.6s;
    }

@keyframes plFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOADING MODAL STYLES ===== */
.product-list-page #loadingModal .modal-content {
    border: none;
    border-radius: var(--pl-border-radius-lg);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.2);
}

.product-list-page #loadingModal .spinner-border {
    border-color: var(--pl-light-green-bg);
    border-right-color: var(--pl-primary-green);
}

/* ===== PRINT STYLES ===== */
@media print {
    .product-list-page {
        background: white;
    }

        .product-list-page .filter-sidebar,
        .product-list-page .pagination {
            display: none;
        }

        .product-list-page .product-card {
            box-shadow: none;
            border: 1px solid #ccc;
            break-inside: avoid;
            margin-bottom: 1rem;
        }
}

/* ===== HOVER EFFECTS ENHANCEMENT ===== */
.product-list-page .form-check:hover .form-check-label {
    color: var(--pl-primary-green);
    transform: translateX(2px);
}

.product-list-page .filter-section h5:hover::before {
    background: linear-gradient(135deg, var(--pl-secondary-green), var(--pl-accent-green));
    width: 6px;
}

/* ===== PRICE RANGE DISPLAY ===== */
.product-list-page .price-range .d-flex span {
    color: var(--pl-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== SMOOTH SCROLL ===== */
.product-list-page .pagination .page-link {
    scroll-margin-top: 100px;
}

/* ===== TOOLTIP SUPPORT ===== */
.product-list-page [data-bs-toggle="tooltip"] {
    cursor: help;
}

.product-list-page .bestseller-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f) !important;
}