/* ===== Layout padding ===== */
@media (min-width: 768px) {
    .category-main-content {
        padding-top: 20px;
    }
}

@media (max-width: 767.98px) {
    .category-main-content {
        padding-top: 50px;
    }
}

/* ===== Sidebar ===== */
.category-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* TIÊU ĐỀ: DANH MỤC SẢN PHẨM */
.category-sidebar h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000; /* ← MÀU ĐEN */
}

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

.category-item {
    margin-bottom: 14px;
    transition: all 0.2s ease;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.category-name {
    font-size: 15px;
    font-weight: 400;
    color: #222;
}

.category-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
}

.category-header i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* ===== Sub category ===== */
.category-children {
    list-style: none;
    margin: 10px 0 0;
    padding-left: 16px;
    border-left: 2px solid #ddd;
    display: none;
}

.category-children li {
    margin-bottom: 6px;
}

.category-children a {
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.category-children a:hover {
    color: #ff3b00;
}

/* ===== Active category ===== */
.category-item.active {
    background: #fff5f0;
    border-left: 3px solid #ff3b00;
    padding-left: 10px;
    border-radius: 6px;
}

.category-item.active .category-name,
.category-item.active .category-right {
    color: #000;
    font-weight: 700;
}

.category-item.active .category-children {
    display: block;
}

.category-item button:hover {
    color: #ff3b00;
}

/* ===== Header bar ===== */
.category-header-bar {
    background: linear-gradient(90deg, #fff, #fafafa);
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ===== Breadcrumb ===== */
.category-breadcrumb {
    font-size: 15px;
    font-weight: 600;
    color: #dd3333;
}

.category-breadcrumb a {
    color: #dd3333;
    text-decoration: none;
}

.category-breadcrumb a:hover {
    text-decoration: underline;
}

.category-breadcrumb .sep {
    margin: 0 6px;
}

/* ===== Sort dropdown ===== */
.sort-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #ff3b00;
}

/* ===== Product Card ===== */

.product-card {
    border: 1px solid #eee;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px;
}

.product-title {
    font-size: 14px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    font-weight: 500;
    color: #333;
}

.product-price {
    font-size: 15px;
    font-weight: 700;
    color: #dd3333;
    margin-top: 4px;
}

/* ===== Add to cart button ===== */
.btn-add-cart-home {
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    border: 1px solid #dd3333;
    color: #dd3333;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
}

.btn-add-cart-home i {
    font-size: 10px;
}

.product-card:hover .btn-add-cart-home {
    opacity: 1;
    transform: scale(1.1);
}

.btn-add-cart-home:hover {
    background: transparent;
    color: #c02a2a;
    border-color: #c02a2a;
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-add-cart-home:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-card .image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    padding: 10px;
    height: 200px;
    border-radius: 12px;
    margin-bottom: 8px;
    position: relative;
}

.product-card .actions {
    position: absolute;
    left: 12px;
    bottom: -14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Empty category message ===== */
.alert-warning {
    background: #fff3cd;
    border-radius: 10px;
    border: 1px dashed #ff3b00;
    color: #d35400;
    font-size: 16px;
}

/* ===== Related title ===== */
h4.text-center {
    font-weight: 700;
    color: #222;
    position: relative;
}

h4.text-center::after {
    content: "";
    width: 60px;
    height: 3px;
    background: #ff3b00;
    display: block;
    margin: 8px auto 0;
    border-radius: 5px;
}

/* ===== Mobile ===== */
@media (max-width: 767.98px) {

    .category-header-bar .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .sort-select {
        width: 100%;
    }

    .category-sidebar {
        margin-bottom: 20px;
    }

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

    .category-children a {
        font-size: 13px;
    }

    .col-12.col-sm-6.col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .product-card img {
        height: 150px;
    }

    .product-title {
        font-size: 13px;
        height: auto;
    }

    .product-price {
        font-size: 14px;
    }

    .btn-add-cart {
        padding: 8px 12px;
        font-size: 16px;
    }
}
