/* Products List Page Styles - Following design-system.md standards */

/* Header Section */
.products-list-header {
    margin-top: 3.25rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

/* Title and Description */
.products-list-title {
    font-family: var(--font-primary);
    font-size: 48px;
    font-weight: 800;
    line-height: 68px;
    color: var(--mau-chu-dao);
    margin-bottom: 1rem;
}

.products-list-description {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 400;
    line-height: 26px;
    color: #242424;
    margin-bottom: 0;
}

/* CTA Button */
.products-list-cta-btn {
    margin-top: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.products-list-cta-btn i {
    font-size: 18px;
}

.products-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.products-search-input {
    width: 100%;
    height: 48px;
    padding: 0 50px 0 20px;
    border: 2px solid var(--mau-chu-dao);
    border-radius: 100px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    color: #242424;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.products-search-input:focus {
    outline: none;
    border-color: var(--mau-phu1);
}

.products-search-input::placeholder {
    color: #666;
}

.products-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: var(--mau-phu1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.products-search-btn:hover {
    opacity: 0.8;
}

.products-search-btn i {
    font-size: 18px;
}

.products-results-info {
    color: #242424;
    margin: 0;
}

.products-controls {
    flex-wrap: wrap;
}

.products-sort-select {
    padding: 10px 16px;
    border: 2px solid var(--mau-chu-dao);
    border-radius: 100px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    color: #242424;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23244a9a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.products-sort-select:focus {
    outline: none;
    border-color: var(--mau-phu1);
}

.products-view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--mau-chu-dao);
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--mau-chu-dao);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background-color: var(--mau-chu-dao);
    color: #ffffff;
}

.view-toggle-btn.active {
    background-color: var(--mau-chu-dao);
    color: #ffffff;
}

.view-toggle-btn i {
    font-size: 18px;
}

/* Main Content */
.products-list-main {
    margin-bottom: 6.25rem;
}

/* Sidebar Filters */
.products-sidebar {
    background-color: #ffffff;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
}

@media (max-width: 991px) {
    .products-sidebar-desktop {
        display: none;
    }
    
    .filter-offcanvas-body {
        padding: 0;
    }
    
    .filter-offcanvas-body .products-sidebar {
        box-shadow: none;
        padding: 16px;
        position: static;
        border-radius: 0;
    }
}

.filter-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e6e7e8;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 24px;
}

.filter-section-title {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 800;
    color: var(--mau-chu-dao);
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: var(--mau-phu1);
}

.filter-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--mau-phu1);
}

.filter-label {
    flex: 1;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    color: #242424;
    cursor: pointer;
}

.filter-count {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 400;
    color: #666;
    min-width: 30px;
    text-align: right;
}

.filter-clear-btn {
    width: 100%;
    margin-top: 16px;
}

/* Product Grid/List */
.products-grid {
    min-height: 400px;
}

.products-loading {
    padding: 60px 20px;
}

.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.products-list.list-view {
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Product Card */
.product-card {
    background-color: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.product-card.list-view-item {
    flex-direction: row;
    height: auto;
}

.product-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-color: #f5f8f9;
}

/* Thêm class has-brand-banner để xử lý hiển thị banner không che ảnh */
.product-card-image-wrapper.has-brand-banner {
    padding-top: calc(75% + 40px);
}

.product-card.list-view-item .product-card-image-wrapper {
    width: 300px;
    padding-top: 0;
    height: 200px;
    flex-shrink: 0;
}

.product-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.product-card-image-wrapper.has-brand-banner .product-card-image {
    top: 40px;
    height: calc(100% - 40px);
}

.product-card.list-view-item .product-card-image {
    border-radius: 20px 0 0 20px;
}

/* Brand Banner - Slanted style với background image SVG */
.product-card-brand-banner {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    background-image: url('/image/icons/title_bar.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    z-index: 2;
    width: 82%;
    min-height: 38px; /* Đảm bảo chiều cao đủ cho SVG */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.product-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card.list-view-item .product-card-content {
    flex: 1;
    justify-content: center;
}

/* Rating removed - no longer needed */

.product-card-name {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 800;
    color: var(--mau-chu-dao);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card.list-view-item .product-card-name {
    -webkit-line-clamp: 1;
}

.product-card-description {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card-price {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 800;
    color: var(--mau-chu-dao);
    margin-top: auto;
}

.product-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #e6e7e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card.list-view-item .product-card-footer {
    border-top: none;
    padding-top: 0;
}

.product-card-btn {
    padding: 10px 24px;
    background-color: transparent;
    color: var(--mau-phu1);
    border: 2px solid var(--mau-phu1);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.product-card-btn:hover {
    background-color: var(--mau-phu1);
    color: #ffffff;
    opacity: 1;
}

/* Empty State */
.products-empty {
    padding: 60px 20px;
    text-align: center;
}

/* Pagination */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    border: 2px solid var(--mau-chu-dao);
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--mau-chu-dao);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background-color: var(--mau-chu-dao);
    color: #ffffff;
}

.pagination-btn.active {
    background-color: var(--mau-chu-dao);
    color: #ffffff;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 991px) {
    .products-sidebar {
        position: static;
        margin-bottom: 32px;
    }

    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .product-card.list-view-item {
        flex-direction: column;
    }

    .product-card.list-view-item .product-card-image-wrapper {
        width: 100%;
        height: 200px;
    }

    .product-card.list-view-item .product-card-image {
        border-radius: 20px 20px 0 0;
    }
}

@media (max-width: 768px) {
    .products-list-header {
        margin-top: 4rem;
        padding: 1.5rem 0 1rem 0;
    }

    .products-list-title {
        font-size: 24px;
        line-height: 32px;
        font-weight: 700;
        margin-bottom: 0.75rem;
        text-align: center;
    }

    .products-list-description {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 24px;
        padding: 0 20px;
        text-align: center;
    }

    .products-list-cta-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .products-controls {
        justify-content: center;
        margin-top: 16px;
    }

    .products-search-wrapper {
        margin-bottom: 12px;
    }

    .product-card-brand-banner {
        padding: 6px 20px;
        font-size: 12px;
    }

    /* Mobile Filter Button */
    .btn-filter-mobile {
        background-color: #ffffff;
        color: var(--mau-chu-dao);
        border: 2px solid var(--mau-chu-dao);
        border-radius: 100px;
        height: 48px;
        padding: 0 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 16px;
        transition: all 0.2s ease;
        position: relative;
        flex-shrink: 0;
    }
    
    .btn-filter-mobile i {
        font-size: 18px;
    }

    .btn-filter-mobile:active, .btn-filter-mobile:hover {
        background-color: var(--mau-chu-dao);
        color: #ffffff;
    }

    .filter-badge {
        position: absolute;
        top: -8px;
        right: 10px;
        background-color: #dc3545;
        color: white;
        font-size: 11px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        border: 2px solid white;
    }
}

@media (max-width: 567px) {
    .products-list-title {
        font-size: 24px;
        line-height: 32px;
        margin-bottom: 0.5rem;
        text-align: center;
        font-weight: 700;
    }

    .products-list-description {
        font-size: 14px;
        line-height: 22px;
        margin-bottom: 20px;
        text-align: center;
        padding: 0 10px;
    }

    .products-list-cta-btn {
        font-size: 14px;
        padding: 8px 20px;
    }

    .products-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .filter-section {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .product-card-content {
        padding: 12px;
    }

    .product-card-footer {
        padding: 10px 12px;
    }

    .product-card-name {
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .product-card-description {
        display: none;
    }

    .product-card-price {
        font-size: 16px;
    }

    .product-card-btn {
        padding: 8px 10px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }

    .product-card-brand-banner {
        padding: 5px 16px;
        font-size: 10px;
        max-width: 85%;
        min-height: unset;
    }
}

