/**
 * Modern Products Grid CSS
 * File: assets/css/products-grid.css
 */

:root {
    --color-button-text: #FFFFFF;
    --color-button-text-hover: #6b6b6b;
    --color-bg: #043284;
    --color-button-background-gradient-one: #B10707;
    --color-button-background-gradient-two: #810707;
    --color-button-box-shadow: #DE7171;
    --color-border-box: #F6F6F6;
    --color-bg-card: #E5E7F0;
    --color-bg-card-hover: #69B5F8;
    --color-bg-card-hover-two: #2B2EEE;
    --color-icon: #C7E3F3;
    /* Màu nền mặc định */
}

/* Reset & Container */
.products-sidebar-wrapper {
    display: flex;
    gap: 0;
    margin: 0;
}

/* Sidebar Styles */
.product-categories-sidebar {
    flex: 0 0 320px;
    padding: 20px;
    border-right: 3px solid #ffffff;
    position: sticky;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0;
}

.category-filter {
    font-family: "UTM Daxline";
    display: block;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--color-button-text-hover);
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 24px;
    font-weight: 700;
    background: transparent;
}

.category-filter:hover {
    color: var(--color-bg);
}

.category-filter.active {
    color: var(--color-bg);
}

/* Products Grid Container */
.products-grid-container {
    flex: 1;
    padding: 35px 0px 10px 40px;
}

#products-grid-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* Product Item Card */
.product-item {
    overflow: visible !important;
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 0;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Product Image */
.product-item a:first-child {
    display: block;
    position: relative;
    overflow: hidden;
}

.product-item img {
    max-width: 100%;
    height: 250px !important;
    object-fit: contain;
    border-radius: 0;
    margin-bottom: 0;
    transition: transform 0.3s ease;
}

.product-item:hover img {
    transform: scale(1.05);
}

/* Product Info */
.product-item h4 {
    text-align: left;
    font-family: "UTM Daxline";
    font-size: 15px;
    margin: 0;
    padding: 5px 10px 5px 20px;
    min-height: auto;
    font-weight: 400;
    color: #000000;
    letter-spacing: 0.5px;
}

/* Price */
.product-item .price {
    font-family: "UTM Daxline";
    text-align: left;
    font-size: 32px;
    font-weight: 700;
    color: var(--color-bg);
    margin: 0;
    padding: 0px 10px 0px 20px;
}

.product-item .price .woocommerce-Price-amount {
    color: var(--color-bg);
}

/* Add to Cart Button */
.product-item .open-product-popup.product-popup-add-to-cart {
    position: absolute !important;
    bottom: -20px !important;
    /* âm để nó đè ra ngoài */
    right: 10px !important;

    width: 50px !important;
    height: 50px !important;

    background: linear-gradient(to right, var(--color-bg-card-hover), var(--color-bg-card-hover-two)) !important;
    color: #fff !important;

    border-radius: 10px 10px 50% 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 999;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);

    transition: all 0.3s ease;
}

.product-item .open-product-popup.product-popup-add-to-cart svg {
    width: 30px !important;
    height: 30px !important;
    fill: var(--color-icon) !important;
    pointer-events: none !important;
}

.product-item .open-product-popup.product-popup-add-to-cart:hover {
    background: linear-gradient(to right, var(--color-button-background-gradient-one), var(--color-button-background-gradient-two)) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(65, 105, 225, 0.4) !important;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 50px;
}

.pagination.arrows-only {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

.pagination.arrows-only a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
}

.pagination.arrows-only a svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-bg);
}

.pagination.arrows-only a:hover {
    background: var(--color-bg-card-hover);
}

/* Loading State */
#products-grid-content.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

#products-grid-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4169e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* No Products */
.no-products {
    text-align: center;
    padding: 80px 40px;
    font-size: 16px;
    color: #999;
    background: #ffffff;
    border-radius: 16px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .products-grid-container {
        padding: 30px 40px;
    }
}

@media (max-width: 992px) {
    .products-sidebar-wrapper {
        flex-direction: column;
    }

    .product-categories-sidebar {
        flex: 1;
        max-width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 30px 20px;
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .category-filter {
        border-left: none;
        border: 2px solid #e5e5e5;
        border-radius: 25px;
        padding: 10px 20px;
    }

    .category-filter.active {
        border-color: #1a1a1a;
        background: #1a1a1a;
        color: #fff;
    }

    .products-grid-container {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-item .add-to-cart {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .product-item .add-to-cart::before {
        font-size: 18px;
    }

    .pagination a,
    .pagination span {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* Smooth Transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix for Elementor */
.elementor-widget-container>.products-sidebar-wrapper {
    width: 100%;
    max-width: 100%;
}