﻿/* =========================
   RESET
========================= */
* {
    box-sizing: border-box;
}

img {
    width: 100%;
    display: block;
}

/* =========================
   HEADER
========================= */
.d-flex.align-items-center.justify-content-around {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    gap: 20px;
    padding: 12px 24px;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.btn-back-home {
    text-decoration: none;
    font-weight: 500;
    color: #333;
    transition: 0.3s;
}

    .btn-back-home:hover {
        color: #ff4d4f;
    }

a[href="/Cart"] {
    text-decoration: none;
    font-weight: 500;
    color: #333;
}

.cart-count {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 50%;
    margin-left: 5px;
}

/* =========================
   SEARCH
========================= */
form[asp-action="Search"] {
    display: flex;
    align-items: center;
    gap: 8px;
}

    form[asp-action="Search"] input {
        border-radius: 8px;
        padding: 8px 12px;
    }

    form[asp-action="Search"] button {
        background: #000;
        color: #fff;
        border-radius: 8px;
        padding: 8px 14px;
        transition: 0.3s;
    }

        form[asp-action="Search"] button:hover {
            background: #ff4d4f;
        }

/* =========================
   MAIN LAYOUT
========================= */
.d-flex.mt-4.align-items-start {
    display: flex;
    gap: 24px;
    padding: 0 24px;
}

/* SIDEBAR */
.d-flex.flex-column.col-lg-3 {
    flex: 0 0 280px;
    max-width: 280px;
}

/* CONTENT */
.d-flex.mt-4.align-items-start > div:last-child {
    flex: 1;
}

/* =========================
   CATEGORY
========================= */
.category-wrapper {
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.category-title {
    font-weight: bold;
    margin-bottom: 12px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: 0.3s;
    background: #f8f9fa;
}

    .category-link .icon {
        margin-right: 10px;
        color: #ff4d4f;
    }

    .category-link .name {
        flex: 1;
        font-size: 14px;
    }

    .category-link .arrow {
        opacity: 0.5;
        transition: 0.3s;
    }

    .category-link:hover {
        background: #ff4d4f;
        color: #fff;
    }

        .category-link:hover .icon {
            color: #fff;
        }

        .category-link:hover .arrow {
            transform: translateX(5px);
            opacity: 1;
        }

/* =========================
   PRODUCT CARD
========================= */
.product-card {
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
    background: #fff;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    }

/* IMAGE */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
}

    .product-img-wrapper img {
        height: 220px;
        object-fit: cover;
        transition: 0.4s;
    }

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

/* OVERLAY */
.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;
}

/* TEXT */
.product-card h6 {
    font-size: 15px;
}

.product-card p {
    font-size: 13px;
}

.price {
    font-weight: bold;
    color: #ff4d4f;
}

/* =========================
   QUANTITY
========================= */
.input-group {
    display: flex;
}

.quantity-input {
    max-width: 50px;
}

/* =========================
   BUTTON
========================= */
.btn-add-cart {
    border-radius: 10px;
    transition: 0.3s;
}

    .btn-add-cart:hover {
        background: #ff4d4f;
        border-color: #ff4d4f;
    }

/* =========================
   PAGINATION
========================= */
.pagination {
    border-radius: 12px;
    overflow: hidden;
}

.page-link {
    color: #333;
    border: none;
    padding: 8px 14px;
}

.page-item.active .page-link {
    background: #000;
    color: #fff;
}

.page-link:hover {
    background: #ff4d4f;
    color: #fff;
}

/* =========================
   📱 MOBILE (<576px)
========================= */
@media (max-width: 575px) {

    .d-flex.align-items-center.justify-content-around {
        flex-direction: column;
        align-items: stretch;
    }

    .d-flex.mt-4.align-items-start {
        flex-direction: column;
        padding: 0 12px;
    }

    .d-flex.flex-column.col-lg-3 {
        max-width: 100%;
    }

    .product-img-wrapper img {
        height: 180px;
    }

    form[asp-action="Search"] {
        width: 100%;
    }

        form[asp-action="Search"] input {
            width: 100%;
        }
}

/* =========================
   📲 TABLET
========================= */
@media (min-width: 576px) and (max-width: 991px) {

    .d-flex.mt-4.align-items-start {
        flex-direction: column;
    }

    .d-flex.flex-column.col-lg-3 {
        max-width: 100%;
    }

    .product-img-wrapper img {
        height: 200px;
    }
}

/* =========================
   💻 DESKTOP
========================= */
@media (min-width: 992px) {

    .product-img-wrapper img {
        height: 220px;
    }
}

/* =========================
   🖥️ LARGE SCREEN
========================= */
@media (min-width: 1400px) {

    

    .product-img-wrapper img {
        height: 250px;
    }
}

/* =========================
   FIX LAYOUT GRID
========================= */
.product-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 0 24px;
}

/* SIDEBAR */
.sidebar {
    width: 100%;
}

/* =========================
   FIX PRODUCT GRID (QUAN TRỌNG)
========================= */
.row.g-4 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

    /* bỏ bootstrap column bó width */
    .row.g-4 > div {
        width: 100% !important;
        max-width: 100% !important;
    }

/* =========================
   CARD FIX ĐỀU
========================= */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .product-card .card-body {
        display: flex;
        flex-direction: column;
    }

    .product-card p {
        min-height: 40px;
    }

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .product-layout {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
}

/* =========================
   MÀN TO (FIX HẸP)
========================= */
@media (min-width: 1400px) {

    .row.g-4 {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}