/* ============================================================
   Sun Cosmetic — Home Page Specific Styles
   2 tầng màu: body xám nhạt (var(--color-bg)) + card trắng (var(--color-surface))
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   1. SECTION CARD — Khối trắng bo góc nổi trên nền xám
   ────────────────────────────────────────────────────────── */
.section-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-xs);
}

/* ──────────────────────────────────────────────────────────
   2. BANNER — Slider bo góc, cùng khoảng cách với các section
   ────────────────────────────────────────────────────────── */
.banner-section {
    padding: 20px 0 0;
}

/* ── Desktop: fixed height, absolute slides, fade animation ── */
.banner-fullwidth {
    position: relative;
    width: 100%;
    height: 460px;
    overflow: hidden;
    background: #0a0f23;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@keyframes bannerFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    z-index: 0;
}
.banner-slide.active {
    opacity: 1;
    z-index: 1;
    animation: bannerFadeIn 0.9s ease-in-out;
}

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

/* ── Arrows (desktop) ── */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px; height: 44px;
    background: rgba(0,0,0,.35);
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, background .2s;
    padding: 0;
}
.banner-fullwidth:hover .banner-arrow { opacity: 1; }
.banner-arrow:hover { background: var(--color-primary); border-color: var(--color-primary); }
.banner-arrow--prev { left: 16px; }
.banner-arrow--next { right: 16px; }

/* ── Tablet (≤991px): height auto, display-based switching, no cropping ── */
@media (max-width: 991px) {
    .banner-fullwidth {
        height: auto !important;
        min-height: unset;
        overflow: visible;
    }
    .banner-slide {
        position: relative;
        top: auto; left: auto;
        width: 100%;
        height: auto;
        opacity: 1;
        display: none;
        z-index: auto;
    }
    .banner-slide.active {
        display: block;
        animation: none;
    }
    .banner-slide img {
        width: 100%;
        height: auto !important;
        object-fit: contain;
        display: block;
    }
    .banner-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px; height: 36px;
        font-size: 13px;
        opacity: 1;
    }
    .banner-arrow--prev { left: 10px; }
    .banner-arrow--next { right: 10px; }
}

/* ── Mobile (≤767px): even smaller arrows ── */
@media (max-width: 767px) {
    .banner-arrow {
        width: 30px; height: 30px;
        font-size: 11px;
    }
    .banner-arrow--prev { left: 6px; }
    .banner-arrow--next { right: 6px; }
}

/* ──────────────────────────────────────────────────────────
   3. DANH MỤC — Lưới ảnh 6 cột
   ────────────────────────────────────────────────────────── */
.cat-img-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) { .cat-img-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .cat-img-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px)  { .cat-img-grid { grid-template-columns: repeat(2, 1fr); } }

/* Thẻ danh mục */
.cat-img-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 10px 14px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all .25s;
}

.cat-img-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(37, 99, 235, .12);
    transform: translateY(-4px);
    color: inherit;
}

/* Khung ảnh danh mục */
.cat-img-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--color-surface-2);
    flex-shrink: 0;
}

.cat-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
    display: block;
}

.cat-img-card:hover .cat-img-thumb img {
    transform: scale(1.08);
}

/* Tên danh mục */
.cat-img-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.35;
}

/* ──────────────────────────────────────────────────────────
   4. SẢN PHẨM — Lưới 4 cột (dùng cho nổi bật & bán chạy)
   ────────────────────────────────────────────────────────── */

/* Khoảng cách trên — phần section tiếp theo sát nhau hơn */
.section-products {
    padding-top: 0;
}

/* Lưới 6 cột — 6 sản phẩm, ~187px/thẻ, lấp đầy container */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.pg-grid .product-img-wrap {
    height: 160px;
    padding: 10px;
    box-sizing: border-box;
}

.pg-grid .product-body { padding: 10px 10px 12px; }

.pg-grid .product-name {
    font-size: 12.5px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    min-height: calc(12.5px * 1.4 * 2);
    margin: 0 0 5px;
}

.pg-grid .price-current { font-size: 16px; font-weight: 700; color: var(--color-red); }

@media (max-width: 1100px) { .pg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .pg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ──────────────────────────────────────────────────────────
   5. RESPONSIVE — Section card nhỏ hơn trên mobile
   ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .section-card {
        padding: 18px 14px 16px;
        border-radius: var(--radius-md);
    }

    .cat-img-thumb {
        width: 56px;
        height: 56px;
    }

    .cat-img-name {
        font-size: 11.5px;
    }
}
