/* ============================================================
   VIETNAMSMART HOMEPAGE - STYLESHEET
   ============================================================ */

/* === HOMEPAGE MAIN === */
.homepage-main {
    padding-bottom: 50px;
}

.section-mt {
    margin-top: 30px;
}

/* ============================================================
   1. BANNERS (Slider & Side Banners)
   ============================================================ */
.home-banners {
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* === SLIDER BANNER LEFT === */
.slider-wrapper {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex: 1;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
}

.slide {
    flex: 0 0 100%;
    width: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Nút điều hướng Prev / Next */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    opacity: 0;
}

.slider-container:hover .slider-btn {
    opacity: 1;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.slider-btn-prev {
    left: 12px;
}

.slider-btn-next {
    right: 12px;
}

/* Thanh Descriptions dưới slider */
.slider-descriptions {
    display: flex;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #eaeaea;
}

.slider-desc-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: var(--color-5);
    cursor: pointer;
    border-right: 1px solid #eaeaea;
    transition: color 0.3s ease, background-color 0.3s ease;
    position: relative;
    line-height: 1.3;
}

.slider-desc-item:last-child {
    border-right: none;
}

.slider-desc-item:hover {
    background-color: #f9f9f9;
}

.slider-desc-item.active {
    color: var(--color-2);
    background-color: #efefef;
}

.slider-desc-item.active:hover {
    background-color: #efefef;
}

/* === BANNER RIGHT === */
.banner-right-wrap {
    position: relative;
}

.banner-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.banner-item {
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nút điều hướng cho banner-right */
.br-nav {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    z-index: 5;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.br-nav-prev {
    left: 6px;
}

.br-nav-next {
    right: 6px;
}

.banner-right-wrap:hover .br-nav {
    opacity: 1;
}

.br-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Banner dải dưới Slider */
.sub-banners {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.sub-banner-item {
    border-radius: 8px;
    overflow: hidden;
}

.sub-banner-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.sub-banner-item:hover img {
    transform: scale(1.03);
}

/* ============================================================
   2. DANH MỤC SẢN PHẨM HOT
   ============================================================ */
.section-title-center {
    text-align: center;
    color: var(--color-1);
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 25px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.cat-card {
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.cat-card:hover {
    border-color: var(--color-active);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.cat-img {
    height: 60px;
    object-fit: contain;
}

.cat-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-5);
    margin-bottom: 4px;
}

.cat-info p {
    font-size: 11px;
    color: #888;
}

/* ============================================================
   3. PRODUCT GRID CHUNG
   ============================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.hp-product-grid-six {
    grid-template-columns: repeat(6, 1fr);
}

.hp-section-banner {
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
}

.hp-section-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.hp-product-slider-wrap {
    position: relative;
    overflow: hidden;
}

.hp-product-slider-track {
    display: flex;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hp-product-slider-track .product-card {
    flex: 0 0 calc((100% - 60px) / 5);
    min-width: 0;
}

.hp-product-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    color: var(--color-1);
    border-radius: 50%;
    font-size: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: all 0.3s;
}

.hp-product-slider-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}

.hp-product-slider-btn-prev { left: 4px; }
.hp-product-slider-btn-next { right: 4px; }
.hp-product-slider-btn:disabled { opacity: 0.35; cursor: default; transform: translateY(-50%); }

.product-card {
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--color-active);
}

.product-img-box {
    position: relative;
    padding-bottom: 100%;
    margin-bottom: 15px;
}

.product-img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-img-box .brand-logo {
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: auto;
    height: 24px;
    max-width: 80px;
    object-fit: contain;
    background: #fff;
    border-style: solid;
    border-width: 1px 1px 1px 1px;
    border-color: #efefef;
    border-radius: 2px 2px 2px 2px;
    z-index: 2;
}

.homepage-main .hot-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
}

.product-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-5);
    margin-bottom: 8px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.product-card:hover .product-title {
    color: var(--color-2);
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.product-price-label {
    color: #666;
    font-size: 12px;
}

.product-price,
.product-price-row .woocommerce-Price-amount {
    color: var(--color-danger);
    font-weight: 700;
    font-size: 16px;
}

.product-old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 12px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.product-rating {
    color: #fbbf24;
    font-size: 11px;
}

.product-rating .far {
    color: #d1d5db;
}

.product-sales {
    color: #888;
}

/* ============================================================
   4. SẢN PHẨM BÁN CHẠY (Nền xanh thẫm)
   ============================================================ */
.best-seller-section {
    background-color: #05235C;
    border-radius: 12px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.best-seller-section .product-grid {
    padding: 0 20px 20px;
}

/* Best seller slider mode */
.best-seller-section .bs-slider-wrap {
    position: relative;
    padding: 0 20px 20px;
    overflow: hidden;
}

.best-seller-section .bs-slider-track {
    display: flex;
    gap: 15px;
    overflow: visible;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.best-seller-section .bs-slider-track .product-card {
    flex: 0 0 calc((100% - 60px) / 5);
    min-width: 0;
}

.bs-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    color: #05235C;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.bs-slider-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.1);
}

.bs-slider-btn-prev { left: 4px; }
.bs-slider-btn-next { right: 4px; }
.bs-slider-btn:disabled { opacity: 0.3; cursor: default; transform: translateY(-50%); }

.best-seller-section .text-center {
    padding-bottom: 20px;
}

.best-seller-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.best-seller-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-view-all {
    display: inline-block;
    background-color: #fff;
    color: var(--color-1);
    font-weight: 600;
    padding: 10px 30px;
    border-radius: 25px;
    margin-top: 25px;
    text-transform: uppercase;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s;
    position: relative;
    z-index: 1;
}

.btn-view-all:hover {
    background-color: var(--color-soft-bg);
    transform: translateY(-1px);
}

.text-center {
    text-align: center;
}

/* ============================================================
   5. CÁC KHỐI SẢN PHẨM KHÁC
   ============================================================ */
.section-header-left {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--color-2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-title-left {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-1);
    text-transform: uppercase;
}

/* ============================================================
   6. BANNER DÀI PROMO
   ============================================================ */
.promo-banner {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    transition: transform 0.3s ease;
}

.promo-banner:hover {
    transform: scale(1.005);
}

.promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   7. DỰ ÁN THI CÔNG - PROJECT GRID
   ============================================================ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.project-card {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    display: block;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 15px 15px;
    color: #fff;
}

.project-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stat-card {
    background-color: var(--color-soft-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #d1e0ff;
}

.stat-number {
    font-size: 48px;
    font-weight: 800;
    color: var(--color-danger);
    line-height: 1;
    margin-bottom: 10px;
}

.stat-number span {
    font-size: 32px;
}

.stat-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-1);
    text-transform: uppercase;
}

/* Ẩn sản phẩm extra trên desktop (để chỉ hiện 5) */
.product-card-extra {
    display: none;
}

/* ============================================================
   RESPONSIVE - TABLET (<= 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .home-banners {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .banner-right {
        flex-direction: row;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .product-card-extra {
        display: flex;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hp-product-slider-track .product-card {
        flex-basis: calc((100% - 12px) / 2);
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .best-seller-section {
        border-radius: 8px;
    }

    .section-mt {
        margin-top: 25px;
    }

    .section-title-center {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .section-title-left {
        font-size: 18px;
    }

    .sub-banners {
        gap: 12px;
        margin-top: 12px;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-grid {
        gap: 10px;
    }

    .hp-product-slider-track {
        gap: 10px;
    }

    .hp-product-slider-track .product-card {
        flex-basis: calc((100% - 10px) / 2);
    }

    .sub-banners {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .section-mt {
        margin-top: 20px;
    }

    .section-title-center {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .section-title-left {
        font-size: 16px;
    }

    .best-seller-title {
        font-size: 22px;
    }

    .slider-desc-item {
        font-size: 11px;
        padding: 8px 6px;
    }

    .product-title {
        font-size: 13px;
    }

    .product-price,
    .product-price-row .woocommerce-Price-amount {
        font-size: 14px;
    }

    /* Banner Right -> Horizontal Swipe Slider */
    .banner-right {
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        cursor: grab;
    }

    .banner-right:active {
        cursor: grabbing;
    }

    .banner-right::-webkit-scrollbar {
        display: none;
    }

    .banner-right .banner-item {
        flex: 0 0 calc(50% - 5px);
        scroll-snap-align: start;
        border-radius: 8px;
    }

    .br-nav {
        display: flex;
    }

    .project-grid {
        gap: 10px;
    }

    .home-banners {
        gap: 10px;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE NHỎ (<= 480px)
   ============================================================ */
@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .sub-banners {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 36px;
    }

    .best-seller-title {
        font-size: 18px;
    }

    .best-seller-section {
        border-radius: 8px;
    }
}
