/* --- Category Header --- */
.category-title {
    font-family: var(--default-font);
    font-size: 3rem; /* ~48px */
    font-weight: 700;
    color: #37373f; /* Màu chữ chính */
    margin-bottom: 1rem;
    position: relative; /* Quan trọng cho z-index */
    z-index: 2;
    line-height: 1.2;
}
.category-header-section {
    background: linear-gradient(135deg, #fcebeb 0%, #ffffff 100%); /* Nền gradient đỏ nhạt sang trắng */
    padding: 3.5rem 0; /* Khoảng cách trên dưới */
    border-bottom: 0.0625rem solid #eee; /* Đường viền nhẹ */
    margin-bottom: 3rem; /* Khoảng cách với danh sách sản phẩm */
    position: relative;
    overflow: hidden; /* Quan trọng để hiệu ứng AOS không bị tràn */
}
.category-header-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top left, rgba(206, 18, 18, 0.05) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0.8;
    z-index: 1;
}
.category-title span {
    color: #ce1212; /* Màu đỏ thương hiệu cho tên danh mục */
}

.category-subtitle {
    font-size: 1.125rem; /* ~18px */
    color: #6c757d;
    line-height: 1.5;
    max-width: 60rem; /* Giới hạn độ rộng mô tả */
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}
/* --- Product Card Design --- */
.product-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 0.0625rem solid #f1f1f1;
}

.product-card:hover {
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.08);
    transform: translateY(-0.3125rem);
}

/* Ảnh sản phẩm */
.product-img-wrapper {
    position: relative;
    aspect-ratio: 1 / 1; /* Ép ảnh thành hình vuông cho đẹp */
    overflow: hidden;
    background: #f9f9f9;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Giữ nguyên tỉ lệ ảnh sản phẩm không bị méo */
    padding: 1rem;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.1);
}

/* Overlay khi di chuột (Chỉ hiện trên Desktop) */
.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-detail-overlay {
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Thông tin sản phẩm */
.product-info {
    padding: 1.25rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-family: var(--default-font);
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: #37373f;
    margin-bottom: 1rem;
    line-height: 1.4;
    /* Giới hạn tên sản phẩm trong 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-detail-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition: 0.3s;
}

.btn-detail-link i {
    margin-left: 0.25rem;
    transition: transform 0.3s;
}

.btn-detail-link:hover i {
    transform: translateX(0.3125rem);
}

.category-logo-wrapper {
    display: inline-block;
    position: relative;
    padding-bottom: 1.25rem; /* Khoảng cách cho thanh gạch chân */
}

.category-brand-logo {
    height: 6.25rem; /* ~100px: Kích thước logo vừa phải */
    width: auto;
    max-width: 22.625rem; /* ~250px: Giới hạn chiều rộng */
    object-fit: contain;
    /* Hiệu ứng đổ bóng nhẹ cho logo nổi bật trên nền trắng */
    filter: drop-shadow(0 0.25rem 0.5rem rgba(0,0,0,0.05));
}

.brand-underline {
    position: absolute; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 3.75rem; /* Độ dài thanh gạch ~60px */
    height: 0.25rem; /* Độ dày ~4px */
    background: #ce1212; 
    border-radius: 0.125rem;
}

/* --- Responsive cho Mobile --- */
@media (max-width: 48rem) {
    .category-header-section {
        padding: 2.5rem 0;
        margin-bottom: 2rem;
    }

    .category-title {
        font-size: 2rem; /* ~32px */
        margin-bottom: 0.75rem;
    }

    .category-subtitle {
        font-size: 0.9375rem; /* ~15px */
        max-width: 90%;
    }
    /* 1. Kéo sát các cột sản phẩm lại với nhau */
    .category-products .row.g-4 {
        --bs-gutter-x: 0.625rem !important; /* Giảm khoảng cách ngang còn 10px */
        --bs-gutter-y: 1rem !important;   /* Khoảng cách dọc 16px */
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* 2. Giảm độ dày của Card để ảnh sản phẩm to hơn */
    .product-card {
        border-radius: 0.625rem !important; /* Bo góc nhẹ hơn cho hiện đại */
    }

    .product-info {
        padding: 0.75rem 0.5rem !important; /* Giảm padding bên trong info */
    }

    /* 3. Chỉnh font chữ tên sản phẩm cho gọn */
    .product-name {
        font-size: 0.875rem !important; /* ~14px */
        margin-bottom: 0.5rem !important;
        min-height: 2.5rem; /* Đảm bảo các hộp tên bằng nhau */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 4. Nút chi tiết nhỏ lại cho tinh tế */
    .btn-detail-link {
        font-size: 0.75rem !important;
        letter-spacing: 0;
    }

    /* 5. Ảnh sản phẩm chiếm nhiều diện tích hơn */
    .product-img-wrapper {
        padding: 0.5rem !important; /* Giảm khoảng trắng bao quanh ảnh */
    }
    .category-brand-logo {
        height: 4.375rem; /* Giảm size trên mobile ~70px */
    }
    .category-header-box {
        padding: 2rem 1rem !important;
    }
}