/* ============================================
   PAGE: Product Listing — product/productall & product/category
   Dùng chung cho: productall.tpl, category/default.tpl
   ============================================ */
/* --- Product Loop Spacing --- */
.product-loop {
    margin-bottom: 20px;
}

/* --- Category Description --- */
.product-list__category-desc {
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

/* --- Subcategories --- */
.product-list__subcategories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}
.product-list__subcat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: var(--body-color);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.product-list__subcat-item:hover {
    background: var(--shop-color-main);
    color: #fff;
}
.product-list__subcat-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Toolbar (count + sort) --- */
.product-list__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}
.product-list__count {
    font-size: 14px;
    color: #666;
}
.product-list__count b {
    color: var(--body-color);
    font-weight: 700;
}
.product-list__sort {
    position: relative;
}
.product-list__sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-list__sort-dropdown label {
    font-size: 14px;
    color: #666;
    margin: 0;
    white-space: nowrap;
}
.product-list__sort-toggle {
    position: relative;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}
.product-list__sort-toggle i {
    font-size: 10px;
    color: #999;
    transition: transform 0.3s ease;
}
.product-list__sort-toggle.open i {
    transform: rotate(180deg);
}
.product-list__sort-options {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
}
.product-list__sort-toggle.open .product-list__sort-options {
    display: block;
}
.product-list__sort-options li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--body-color);
    text-decoration: none;
    transition: background 0.2s ease;
}
.product-list__sort-options li a:hover,
.product-list__sort-options li a.active {
    background: #f5f5f5;
    color: var(--shop-color-main);
}

/* --- Product Grid --- */
.product-list__grid {
    margin: 0 -10px;
}
.product-list__grid .product-loop {
    padding: 0 10px;
}

/* --- Empty State --- */
.product-list__empty {
    text-align: center;
    padding: 60px 20px;
}
.product-list__empty p {
    font-size: 16px;
    color: #999;
    margin-bottom: 20px;
}

/* --- Pagination --- */
.product-list__pagination {
    text-align: center;
    padding: 24px 0 8px;
}
.product-list__pagination .pagination {
    display: inline-flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.product-list__pagination .pagination li a,
.product-list__pagination .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: var(--body-color);
    text-decoration: none;
    transition: all 0.3s ease;
}
.product-list__pagination .pagination li a:hover {
    border-color: var(--shop-color-main);
    color: var(--shop-color-main);
}
.product-list__pagination .pagination li.active span,
.product-list__pagination .pagination li.active a {
    background: var(--shop-color-main);
    border-color: var(--shop-color-main);
    color: #fff;
}

/* --- Sidebar --- */
.product-list__sidebar {
    margin-bottom: 24px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 768px) {
    .prd__name {
        font-size: 15px;
    }
    .prd__desc {
        font-size: 13px;
    }
    .prd__price {
        font-size: 16px;
    }
    .product-loop {
        margin-bottom: 24px;
    }
}

@media (min-width: 1024px) {
    .prd__info {
        padding: 18px;
    }
    .product-list__toolbar {
        margin-bottom: 24px;
    }
    .product-list__subcategories {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

@media (min-width: 1200px) {
    .product-list__grid {
        margin: 0 -12px;
    }
    .product-list__grid .product-loop {
        padding: 0 12px;
    }
}

/* --- Sort dropdown mobile: Hide label --- */
@media (max-width: 767px) {
    .product-list__sort-dropdown label {
        display: none;
    }
    .product-list__toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
}
