﻿/* ===================== THEME ===================== */
:root {
    --card-bg: #fff;
    --card-bd: #e7e9ee;
    --card-bd-hover: #dfe2e8;
    --shadow: 0 14px 34px rgba(0,0,0,.08);
    --text: #0f172a;
    --muted: #6b7280;
    --price-red: #e53935; /* giá đỏ */
    --blue: #3b82f6;
    --blue-dark: #2563eb; /* nút xanh dương */
    --hot-text: #b91c1c;
    --hot-bg1: #ffedea;
    --hot-bg2: #ffd7d0;
}

/* ===================== HERO CAROUSEL (banner đầu trang) ===================== */
.hero-carousel {
    margin: 0 0 12px;
}

.hc-viewport {
    position: relative;
    overflow: hidden;
    /* full-bleed */
    max-width: none;
    width: 100vw;
    margin: 0;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    box-shadow: none;
}

.hc-track {
    display: flex;
    animation: hc-slide 10s infinite cubic-bezier(.45,.05,.2,.95);
}

.hc-viewport:hover .hc-track {
    animation-play-state: paused;
}

.hc-slide {
    position: relative;
    flex: 0 0 100%;
    aspect-ratio: 16/6;
    background: #f6f7f9;
}

    .hc-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.02);
    }

.hc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,rgba(0,0,0,.25),rgba(0,0,0,.45));
}

.hc-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    z-index: 2;
    padding: 0 5%;
}

    .hc-caption h2 {
        margin: 0 0 .3rem;
        font-weight: 900;
        font-size: clamp(22px,4.2vw,42px);
        letter-spacing: .2px;
    }

    .hc-caption p {
        margin: 0 0 1rem;
        opacity: .9;
        font-weight: 500;
        font-size: clamp(14px,2.1vw,18px);
    }

.hc-btn {
    display: inline-block;
    font-weight: 800;
    text-decoration: none;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    padding: .55rem 1rem;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(59,130,246,.25);
    transition: .15s ease;
}

    .hc-btn:hover {
        background: var(--blue-dark);
        border-color: var(--blue-dark);
        transform: translateY(-1px);
    }

@keyframes hc-slide {
    0% {
        transform: translateX(0%)
    }

    18% {
        transform: translateX(0%)
    }

    20% {
        transform: translateX(-100%)
    }

    38% {
        transform: translateX(-100%)
    }

    40% {
        transform: translateX(-200%)
    }

    58% {
        transform: translateX(-200%)
    }

    60% {
        transform: translateX(-300%)
    }

    78% {
        transform: translateX(-300%)
    }

    80% {
        transform: translateX(-400%)
    }

    98% {
        transform: translateX(-400%)
    }

    100% {
        transform: translateX(0%)
    }
}

@media (max-width:576px) {
    .hc-slide {
        aspect-ratio: 16/8.5
    }

    .hc-caption {
        padding: 0 6%
    }
}

/* ===================== PRODUCT CARD ===================== */
.prd-card {
    background: var(--card-bg);
    border: 1px solid var(--card-bd);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(16,24,40,.06);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .prd-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 28px rgba(16,24,40,.10);
        border-color: var(--card-bd-hover);
    }

/* Ảnh 4:3 đồng bộ */
.prd-media {
    position: relative;
    aspect-ratio: 4/3;
    min-height: 220px;
    background: #f6f7f9;
    overflow: hidden;
}

    .prd-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Body */
.prd-body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.prd-title {
    margin: 0;
    color: var(--text);
    font-weight: 800;
    line-height: 1.25;
    font-size: 1.05rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Giá: đỏ */
.prd-price {
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: .2px;
    color: var(--price-red);
}

/* ===================== BADGES ===================== */
.prd-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .6px;
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;
}

    .prd-badge.hot {
        background: linear-gradient(135deg,var(--hot-bg1) 0%, var(--hot-bg2) 100%);
        color: var(--hot-text);
        border: 1px solid #ffc2b9;
        box-shadow: 0 4px 12px rgba(255,97,58,.15);
    }

        .prd-badge.hot::before {
            content: "🔥";
            font-size: .95rem;
            transform: translateY(.5px);
        }

    .prd-badge.bg-success-soft {
        background: #eaf7ef;
        color: #1f7a3e;
        border: 1px solid #cbead6;
    }

    .prd-badge.bg-warning-soft {
        background: #fff7e6;
        color: #a86a00;
        border: 1px solid #ffe3b3;
    }

    .prd-badge.bg-secondary-soft {
        background: #f1f3f5;
        color: #495057;
        border: 1px solid #e2e6ea;
    }

/* ===================== BUTTON: Xem chi tiết (pill xanh dương) ===================== */
.btn.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .9rem;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    box-shadow: 0 6px 14px rgba(59,130,246,.25);
    transition: .15s ease;
}

    .btn.btn-detail:hover {
        transform: translateY(-1px);
        background: var(--blue-dark);
        border-color: var(--blue-dark);
        box-shadow: 0 8px 18px rgba(37,99,235,.28);
    }

    .btn.btn-detail:active {
        transform: translateY(0);
    }

    .btn.btn-detail::before {
        content: "🔍";
        font-size: .95rem;
        line-height: 0;
        display: inline-block;
        transform: translateY(-1px);
    }

/* ===================== LABELS BAR (Sản phẩm bán chạy) ===================== */
.labels-bar {
    display: flex;
    align-items: center;
    justify-content: center; /* căn giữa */
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin: 1rem auto 0;
    max-width: none;
    width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

    .labels-bar.hot {
        border-color: #ffd1c7;
        box-shadow: 0 8px 24px rgba(255,97,58,.12);
    }

.labels-left {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.labels-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.labels-title {
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: .2px;
    background: linear-gradient(90deg,#ff5a3c 0%, #ff9a5f 50%, #ffbc6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.labels-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.6rem;
    padding: 0 .5rem;
    border-radius: 999px;
    background: #fff3ef;
    color: #c4331f;
    font-weight: 800;
    font-size: .9rem;
    border: 1px solid #ffd6cc;
}

/* ===================== CATEGORY CARDS ===================== */
.cat-card {
    display: block;
    background: #fff;
    border: 1px solid #e7e9ee;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    box-shadow: 0 8px 20px rgba(16,24,40,.06);
}

    .cat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(16,24,40,.1);
        border-color: #dfe2e8;
    }

.cat-media {
    aspect-ratio: 4/3;
    background: #f6f7f9;
}

    .cat-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.cat-body {
    padding: 10px 12px;
}

.cat-title {
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================== GRID GUTTER ===================== */
.container .row.g-4 {
    --bs-gutter-y: 1.25rem;
}

/* ===================== CĂN GIỮA TIÊU ĐỀ "Danh mục sản phẩm" ===================== */
.container .d-flex.align-items-center.justify-content-between.mb-3 {
    justify-content: center !important;
    gap: .5rem;
    text-align: center;
}

    .container .d-flex.align-items-center.justify-content-between.mb-3 .m-0 {
        flex: 0 0 auto;
        text-align: center;
    }

    .container .d-flex.align-items-center.justify-content-between.mb-3 small {
        flex: 0 0 auto;
        opacity: .9;
    }

/* ===================== RESPONSIVE ===================== */
@media (max-width:576px) {
    .prd-media {
        min-height: 200px;
    }

    .prd-title {
        font-size: 1rem;
    }

    .labels-bar {
        padding: .8rem 1rem;
        border-radius: 12px;
    }

    .labels-title {
        font-size: 1.1rem;
    }

    .labels-chip {
        height: 1.4rem;
        font-size: .85rem;
    }
}

/* ===================== DARK (nhẹ) ===================== */
/* ===================== RESPONSIVE ===================== */
@media (max-width:576px) {

    /* KHUNG ẢNH TRÊN MOBILE – không cắt ảnh */
    .prd-media {
        min-height: 160px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .prd-media img {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain; /* chỉ thu nhỏ, không crop */
        }

    .prd-title {
        font-size: 1rem;
    }

    .labels-bar {
        padding: .8rem 1rem;
        border-radius: 12px;
    }

    .labels-title {
        font-size: 1.1rem;
    }

    .labels-chip {
        height: 1.4rem;
        font-size: .85rem;
    }

    /* 2 thẻ / hàng trên mobile */
    .container .row.g-4 > [class^="col"],
    .container .row.g-4 > [class*=" col"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .prd-price,
    .prd-badge {
        display: block;
    }

    .prd-badge {
        margin-top: 4px;
        font-size: .68rem;
        padding: .2rem .4rem;
        letter-spacing: .2px;
        white-space: normal; /* cho phép xuống dòng, không bị mất chữ */
        max-width: 100%; /* không tràn khỏi card */
    }
}

