/* ============================================================
   PRODUCT CARD — SHOPEE-STYLE COMPACT
   Áp dụng cho: Trang chủ + Trang cửa hàng (listing)
   ============================================================ */

/* --- GRID LAYOUT (trang cửa hàng / danh mục) --- */
.ProductGrid--premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

@media (min-width: 600px) {
    .ProductGrid--premium {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .ProductGrid--premium {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

/* --- Bỏ padding hai mép ngoài trên trang danh mục --- */
.CategoryPage-ProductListWrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.CategoryPage-Wrapper .ProductListPage-Page-Wrapper {
    padding-left: 0;
    padding-right: 0;
}

/* --- Khi slick slider active (trang chủ) thì override grid thành flex --- */
.ProductGrid--premium.slick-initialized {
    display: block;
}

.ProductGrid--premium.slick-initialized .PCard {
    margin: 0;
}

/* --- CARD BASE --- */
.PCard {
    position: relative;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    border: 1px solid #f0f0f0;
}

@media (min-width: 1024px) {
    .PCard:hover {
        box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
        transform: translateY(-2px);
    }
}

/* --- IMAGE CONTAINER --- */
.PCard-Img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fff;
    display: block;
}

/* CHỈ ảnh sản phẩm chính mới full-size (child trực tiếp) */
.PCard-Img>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .3s ease;
}

@media (min-width: 1024px) {
    .PCard:hover .PCard-Img>img {
        transform: scale(1.03);
    }
}

/* --- BADGES trên ảnh --- */
.PCard-Badges {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 2;
    pointer-events: none;
}

/* Badge HOT - nhỏ gọn góc trái trên */
.PCard-Badge--hot {
    width: 28px !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}

@media (min-width: 1024px) {
    .PCard-Badge--hot {
        width: 34px !important;
    }
}

/* Badge SALE % - nhỏ, nổi */
.PCard-Badge--sale {
    display: inline-block;
    width: fit-content;
    background: #ee4d2d;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 0 0 4px 0;
    line-height: 1.3;
    letter-spacing: .2px;
}

@media (min-width: 1024px) {
    .PCard-Badge--sale {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* --- BODY (tên + giá + meta + CTA) --- */
.PCard-Body {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 10px;
    flex: 1;
    gap: 5px;
}

@media (min-width: 1024px) {
    .PCard-Body {
        padding: 10px 12px 12px;
        gap: 6px;
    }
}

/* --- NAME --- */
.PCard-Name {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    min-height: 32px;
    word-break: break-word;
}

@media (min-width: 1024px) {
    .PCard-Name {
        font-size: 13px;
        min-height: 35px;
    }
}

/* --- PRICE --- */
.PCard-Price {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-top: auto;
}

.PCard-Price--regular {
    font-size: 14px;
    font-weight: 600;
    color: #ee4d2d;
    line-height: 1.3;
}

@media (min-width: 1024px) {
    .PCard-Price--regular {
        font-size: 16px;
    }
}

/* Khi có giảm giá */
.PCard-Price--old {
    font-size: 11px;
    color: #bbb;
    text-decoration: line-through;
    font-weight: 400;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .PCard-Price--old {
        font-size: 12px;
    }
}

.PCard-Price--sale {
    font-size: 14px;
    font-weight: 600;
    color: #ee4d2d;
    line-height: 1.3;
}

@media (min-width: 1024px) {
    .PCard-Price--sale {
        font-size: 16px;
    }
}

/* --- META (size / color) --- */
.PCard-Meta {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- CTA BUTTON --- */
.PCard-CTA {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 7px 0;
    margin-top: 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 36px;
}

@media (min-width: 1024px) {
    .PCard-CTA {
        min-height: 38px;
        font-size: 13px;
    }

    .PCard-CTA:hover {
        background: #ee4d2d;
        color: #fff;
        border-color: #ee4d2d;
    }
}

/* --- PAGINATION --- */
.custom-pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.custom-pagination li a,
.custom-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #e8e8e8;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.custom-pagination li.active span {
    background: #ee4d2d;
    color: #fff;
    border-color: #ee4d2d;
}

.custom-pagination li.disabled span {
    color: #ccc;
    background: #fafafa;
    border-color: #eee;
}

.custom-pagination li a:hover {
    background: #ee4d2d;
    color: #fff;
    border-color: #ee4d2d;
}