/* 产品列表页专用样式 */

/* ============================
   基础样式 (适用所有设备)
   ============================ */
.product-image {
    height: auto;
}

/* Banner区域 */
.product-banner {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    padding: 60px 0;
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

.banner-content {
    max-width: 600px;
    margin: 0 auto;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
    font-weight: 300;
}

/* 分类切换区域 */
.category-switch-section {
    background: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.category-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 20px 30px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    text-decoration: none;
    min-width: 160px;
}

.category-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.category-tab.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.category-tab i {
    font-size: 1.5rem;
}

.category-tab span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* 筛选区域 */
.filter-section {
}

/* 侧边栏筛选 */
.sidebar-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.sidebar-filters h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range input {
    flex: 1;
    font-size: 0.85rem;
}

.price-range span {
    color: #6c757d;
    font-weight: 500;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.filter-options label:hover {
    color: var(--primary-color);
}

.filter-options input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* 移动端筛选栏 */
.mobile-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.mobile-filter-bar .btn {
    flex-shrink: 0;
}

.mobile-filter-bar .sort-select {
    flex: 1;
    max-width: 200px;
}

/* 桌面端工具栏 */
.desktop-toolbar {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
}

.toolbar-left .result-count {
    color: #6c757d;
    font-size: 0.9rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sort-select {
    min-width: 160px;
    font-size: 0.9rem;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 产品网格 */
.products-grid {
    margin-bottom: 40px;
}

.products-grid .row {
    justify-content: flex-start;
    margin: 0;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: #28a745;
    color: white;
}

.badge-hot {
    background: #dc3545;
    color: white;
}

.badge-organic {
    background: #198754;
    color: white;
}

.badge-fresh {
    background: #20c997;
    color: white;
}

.badge-origin {
    background: #6f42c1;
    color: white;
}

.badge-spicy {
    background: #fd7e14;
    color: white;
}

.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.btn-favorite,
.btn-quick-view {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-favorite:hover,
.btn-quick-view:hover {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
}

.btn-favorite.active {
    color: #dc3545;
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
    line-height: 1.3;
}

.product-desc {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.product-price {
    margin-bottom: 12px;
    margin-top: auto;
}

.current-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.original-price {
    color: #6c757d;
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-left: 8px;
}

.unit {
    color: #6c757d;
    font-size: 0.8rem;
    margin-left: 4px;
}

.btn-add-cart,
.btn-view-details,
.btn-buy-now {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-add-cart:hover,
.btn-view-details:hover,
.btn-buy-now:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.btn-add-cart i,
.btn-view-details i,
.btn-buy-now i {
    margin-right: 6px;
    font-size: 0.8rem;
}

/* 分页样式 */
.pagination {
    margin-top: 40px;
}

.page-link {
    color: #6c757d;
    background-color: #e9ecef;
    border-color: #e9ecef;
    padding: 8px 16px;
}

.page-link:hover {
    color: #ff6900;
    background-color: #f8f9fa;
    border-color: #ff6900;
}

.page-item.active .page-link {
    background-color: #ff6900;
    border-color: #ff6900;
    color: white;
}



/* 移动端筛选抽屉 */
.offcanvas .filter-group {
    margin-bottom: 20px;
}

.filter-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

.filter-actions .btn {
    flex: 1;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(4) {
    animation-delay: 0.4s;
}

.product-card:nth-child(5) {
    animation-delay: 0.5s;
}

.product-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* ============================
   响应式设计 - 从小到大排列
   ============================ */

/* 移动端去除圆角 */
@media (max-width: 767.98px) {
    .product-card {
        border-radius: 0;
    }

    .product-image {
        width: 180px;
    }

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

    /* 手机端隐藏分页 */
    .pagination {
        display: none !important;
    }
}

/* 超小屏幕 (320px - 575px) */
@media (max-width: 575.98px) {
    .product-banner {
        padding: 30px 0;
        margin-bottom: 15px;
    }

    .banner-title {
        font-size: 1.5rem;
    }

    .banner-subtitle {
        font-size: 0.9rem;
    }

    .category-switch-section {
        padding: 10px 0;
        margin-bottom: 15px;
    }

    .category-tabs {
        flex-direction: row;
        gap: 8px;
        padding: 0 15px;
    }

    .category-tab {
        flex: 1;
        padding: 15px 20px;
        min-width: 120px;
        max-width: 150px;
        font-size: 0.8rem;
    }

    .category-tab i {
        font-size: 1.1rem;
    }

    .category-tab span {
        font-size: 0.75rem;
    }

    .products-grid .row {
        margin: 0 -8px;
        justify-content: flex-start;
    }

    .products-grid .col-lg-auto {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
        padding: 0 8px;
        margin-bottom: 5px;
    }

    .product-card {
        flex-direction: row;
        height: auto;
    }

    .product-image {
        flex: 0 0 35%;
        width: 35%;
    }

    .product-image img {
        height: 140px;
    }

    .product-info {
        padding: 10px;
        flex: 1;
    }

    .product-name {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .product-desc {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .product-tags {
        margin-bottom: 6px;
    }

    .tag {
        font-size: 0.65rem;
        padding: 1px 6px;
    }

    .current-price {
        font-size: 0.95rem;
    }

    .btn-view-details {
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    .product-actions {
        opacity: 1;
        top: 5px;
        right: 5px;
        flex-direction: row;
        gap: 4px;
    }

    .btn-favorite,
    .btn-quick-view {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* 小屏幕 (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .product-banner {
        padding: 40px 0;
        margin-bottom: 20px;
    }

    .banner-title {
        font-size: 1.8rem;
    }

    .banner-subtitle {
        font-size: 1rem;
    }

    .category-switch-section {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .category-tabs {
        flex-direction: row;
        gap: 12px;
        padding: 0 20px;
    }

    .category-tab {
        flex: 1;
        padding: 16px 16px;
        min-width: 140px;
        max-width: 170px;
    }

    .category-tab i {
        font-size: 1.3rem;
    }

    .category-tab span {
        font-size: 0.8rem;
    }

    .products-grid .row {
        margin: 0 -10px;
        justify-content: flex-start;
    }

    .products-grid .col-lg-auto {
        width: 33.333%;
        max-width: 33.333%;
        flex: 0 0 33.333%;
        padding: 0 10px;
        margin-bottom: 16px;
    }

    .product-card {
        flex-direction: column;
        height: auto;
    }

    .product-image {
        flex: none;
        width: 100%;
    }

    .product-image img {
        height: 160px;
    }

    .product-info {
        padding: 12px;
        flex: 1;
    }

    .product-name {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .product-desc {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .btn-view-details {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .product-actions {
        opacity: 0;
        top: 8px;
        right: 8px;
        flex-direction: column;
        gap: 4px;
    }

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

    .btn-favorite,
    .btn-quick-view {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* 中等屏幕 (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid .row {
        margin: 0 -10px;
        justify-content: flex-start;
    }

    .products-grid .col-lg-auto {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        width: 33.333%;
        padding: 0 10px;
        margin-bottom: 20px;
    }

    .product-card {
        flex-direction: column;
        width: 100%;
    }

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

    .category-tabs {
        flex-direction: row;
        gap: 15px;
    }

    .category-tab {
        flex: 1;
        max-width: 200px;
        min-width: 150px;
    }
}

/* 大屏幕 (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .products-grid .row {
        margin: 0 -12px;
        justify-content: flex-start;
    }

    .products-grid .col-lg-auto {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        width: 33.333%;
        padding: 0 12px;
        margin-bottom: 24px;
    }

    .product-card {
        flex-direction: column;
        width: 100%;
    }

    .product-image img {
        height: 240px;
    }
}

/* 超大屏幕 (1200px+) */
@media (min-width: 1200px) {
    .products-grid .row {
        margin: 0 -15px;
        justify-content: flex-start;
    }

    .products-grid .col-lg-auto {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        width: 33.333%;
        padding: 0 15px;
        margin-bottom: 24px;
    }

    .product-card {
        flex-direction: column;
        width: 100%;
    }

    .product-image img {
        height: 260px;
    }

    .category-tabs {
        gap: 25px;
    }

    .category-tab {
        padding: 24px 36px;
        min-width: 180px;
    }

    .category-tab i {
        font-size: 1.6rem;
    }

    .category-tab span {
        font-size: 1rem;
    }
}

/* 4K屏幕适配 (1920px+) */
@media (min-width: 1920px) {
    .products-grid .col-lg-auto {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        width: 33.333%;
    }

    .product-image img {
        height: 280px;
    }

    .banner-title {
        font-size: 3rem;
    }

    .banner-subtitle {
        font-size: 1.4rem;
    }
}

/* 隐藏产品标签 */
.product-badges {
    display: none !important;
}