/* Slider */
.slider {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--spacing-small, 8px);
    margin-top: var(--spacing-medium, 16px);
    margin-bottom: var(--spacing-medium, 16px);
}

.slider-l {
    grid-area: 1 / 1 / span 2 / span 1;
    max-height: 320px;
    min-height: 320px;
    border-radius: var(--border-radius, 5px);
    width: 100%;
}

.slider-r {
    max-height: 155px;
    border-radius: var(--border-radius, 5px);
}

.slider img {
    width: 100%;
    min-height: 100%;  
    border-radius: var(--border-radius, 5px);
}

.slider-l .swiper-button-next, .slider-l .swiper-button-prev {
    color: var(--text-color, #3f3f3f) !important;
    background: var(--secondary-color, #fff); 
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%; 
    display: flex;
    justify-content: center;
    align-items: center;
}
  
.slider-l .swiper-button-next::after, .slider-l .swiper-button-prev::after {
    font-size: 10px !important; /* chỉnh size icon mũi tên */
    font-weight: bold;
}

.slider-l .swiper-pagination-bullet {
    background-color: var(--secondary-color, #fff) !important;
    opacity: 1 !important; 
}
  
.slider-l .swiper-pagination-bullet-active {
    background-color: var(--primary-color, #ED1C25) !important;
    width: 24px !important;
    border-radius: 4px !important;
}

/* Banner */
.banner {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-large, 24px);
}

.banner-item {
    border-radius: var(--border-radius, 5px);
    max-height: 200px;
    flex: 1;
}

.banner-item:nth-child(2), .banner-item:nth-child(3) {
    margin: 0 var(--spacing-small, 8px);
}

.banner-item:nth-child(2) {
    margin-right: 0;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius, 5px);
}

/* Sản phẩm khuyến mãi */
.promotion-product {
    background: url('../../images/promotion-bg.png') no-repeat center top;
    background-size: 100% auto;
    border-radius: var(--border-radius, 5px);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: var(--spacing-medium, 16px);
    padding: 75px var(--spacing-small, 8px) var(--spacing-large, 24px) var(--spacing-small, 8px);
}

/* Banner trang trí */
.banner-style {
    border-radius: var(--border-radius, 5px);
    margin-bottom: var(--spacing-large, 24px);
}

.banner-style img {
    border-radius: var(--border-radius, 5px);
    max-height: 180px;
    min-height: 150px;
    width: 100%;
    object-fit: cover;
}

/* Sản phẩm bán chạy */
.top-selling {
    background: url('../../images/top-sell-bg.png') no-repeat center top;
    background-size: 100% auto;
    background-color: var(--primary-color, #ED1C25);
    border-radius: var(--border-radius, 5px);
    padding: var(--spacing-small, 8px) !important;
    margin-bottom: var(--spacing-large, 24px);
}

.top-selling h2 {
    padding: var(--spacing-medium, 16px) 0 var(--spacing-medium, 24px) var(--spacing-small, 8px);
}

/* Sản phẩm theo thể loại */
.category-feature {
    margin-bottom: var(--spacing-large, 24px);
    background-color: var(--secondary-color, #fff);
    border-radius: var(--border-radius, 5px);
    padding: var(--spacing-small, 8px) !important;
    padding-bottom: var(--spacing-medium) !important;
}

.category-feature-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-small, 8px) var(--spacing-small, 8px) var(--spacing-medium, 16px) var(--spacing-small, 8px);
    border-bottom: 1px solid #CDCFD0;
}

.category-feature-title a {
    color: var(--text-color, #333);
    text-decoration: none;
}

.category-feature-title a:hover {
    color: var(--text-light, #ED1C25);
}

.category-feature-product {
    padding-top: var(--spacing-small, 8px);
}

/* Bài viết */
.news-home {
    margin-bottom: var(--spacing-large, 24px);
    background-color: var(--secondary-color, #fff);
    border-radius: var(--border-radius, 5px);
    font-size: var(--font-size-md, 14px);
    padding: var(--spacing-medium, 16px);
}

.news-home h2 {
    padding-bottom: var(--spacing-medium, 16px);
}

.list-news {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: var(--spacing-medium, 16px);
}

.news-item img {
    max-height: 168px;
    min-height: 168px;
    object-fit: cover;
    border-radius: var(--border-radius);
    width: 100%;
    height: auto;
}

.box-info h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Số dòng hiển thị */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.box-info > div {
    color: #888;
}

.box-info h4 a {
    color: var(--text-color, #333);
    text-decoration: none;
    font-weight: normal;
    font-size: var(--font-size, 16px);
}

.box-info .author {
    font-size: var(--font-size, 16px) !important;
}

/* Desktop */
@media (max-width: 1200px) {
    .promotion-product {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .list-news img {
        max-height: 140px;
        min-height: 140px;
    }
    .slider-r {
        min-height: 80px;
    }
}

/* Tablet lớn */
@media (max-width: 992px) {
    .slider {
        padding: 0 var(--spacing-medium, 16px);
        grid-template-columns: 1fr;
    }

    .slider-l {
        min-height: 100px;
        aspect-ratio: 2.9 / 1;
    }

    .slider img{
        min-height: 0;
    }
    
    .slider-r {
        display: none;
    }

    .slider-l, .slide-r, .slider img {
        border-radius: var(--border-radius-md, 10px);
    }
    .banner, .banner-style {
        padding: 0 var(--spacing-medium, 16px);
        border-radius: var(--border-radius-md, 10px);
    }

    .banner-item, .banner img, .banner-style img{
        border-radius: var(--border-radius-md, 10px);
    }

    .promotion-product, .top-selling, .category-feature, .news-home {
        margin-right: var(--spacing-medium, 16px) !important;
        margin-left: var(--spacing-medium, 16px) !important;
        border-radius: var(--border-radius-md, 10px);
    }

    .promotion-product {
        padding-top: 55px;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .list-news img {
        border-radius: var(--border-radius-md, 10px);
        max-height: 130px;
        min-height: 130px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .banner {
        display: none;
    }
    .promotion-product, .list-news {
        grid-template-columns: 1fr 1fr;
    }
    .list-news img {
        max-height: 180px;
        min-height: 180px;
    }
}

/* mobile */
@media (max-width: 576px) {
    .slider, .banner-style {
        padding: 0 var(--spacing-small, 8px);
    }

    .promotion-product, .top-selling{
        margin-right: var(--spacing-small, 8px);
        margin-left: var(--spacing-small, 8px);
    }

    .promotion-product {
        padding-top: 35px;
        gap: var(--spacing-small, 8px);
    }

    .top-selling, .category-feature, .news-home, .promotion-product{
        margin-right: var(--spacing-small, 8px) !important;
        margin-left: var(--spacing-small, 8px) !important;
    }

    .list-news {
        gap: 8px;
    }
    .list-news img {
        max-height: 115px;
        min-height: 115px;
    }
}

@media (max-width: 360px) {
    .list-news {
        grid-template-columns: 1fr;
    }
}