/* ===================== 商城通用容器 ===================== */
.shop,
.product-detail,
.order-list,
.cart,
.product-review {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

.shop h2,
.product-detail h2,
.order-list h2,
.cart h2,
.product-review h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 24px;
    padding-bottom: 12px;
    position: relative;
}

.shop h2::after,
.product-detail h2::after,
.order-list h2::after,
.cart h2::after,
.product-review h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--primary-color, #3498db);
    border-radius: 2px;
}

/* ===================== 分类侧栏 ===================== */
.categories {
    float: left;
    width: 200px;
    margin-right: 30px;
}

.categories h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #2c3e50;
}

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

.categories li {
    margin-bottom: 6px;
}

.categories li a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.25s ease;
}

.categories li a:hover {
    background-color: #f1f5fb;
    color: var(--primary-color, #3498db);
}

.categories li.active a {
    background-color: var(--primary-color, #3498db);
    color: #fff;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

/* ===================== 商品网格 ===================== */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
    overflow: visible;
}

.product {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #edf0f5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(20, 40, 80, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(20, 40, 80, 0.14);
    border-color: #d6e4ff;
}

.product-thumb {
    height: 170px;
    background: linear-gradient(135deg, #eef3fb, #e1ebfa);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product h3 {
    margin: 16px 18px 6px;
    font-size: 17px;
    color: #2c3e50;
    line-height: 1.4;
}

.product p {
    margin: 0 18px 12px;
    color: #8a94a6;
    line-height: 1.55;
    font-size: 13.5px;
    flex: 1;
}

.product .price {
    font-size: 18px;
    font-weight: bold;
    color: #e67e22;
    margin: 0 18px 14px;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin: 0 18px 18px;
}

/* ===================== 按钮变体（商城内） ===================== */
.btn.outline {
    background-color: #fff;
    color: var(--primary-color, #3498db);
    border: 1.5px solid var(--primary-color, #3498db);
    box-shadow: none;
}

.btn.outline:hover {
    background-color: var(--primary-color, #3498db);
    color: #fff;
    transform: translateY(-2px);
}

.btn.primary {
    background-color: #e67e22;
}

.btn.primary:hover {
    background-color: #d35400;
}

.btn.cancel {
    background-color: #95a5a6;
}

.btn.cancel:hover {
    background-color: #7f8c8d;
}

/* ===================== 空状态 ===================== */
.no-products,
.empty-cart p {
    text-align: center;
    padding: 60px 0;
    color: #9aa4b2;
    font-size: 17px;
    background: #fff;
    border: 1px dashed #dde3ec;
    border-radius: 12px;
}

.empty-cart {
    text-align: center;
    padding: 80px 0;
}

/* ===================== 商品详情 ===================== */
.product-detail .product-info,
.product-review .product-info {
    background-color: #fff;
    border: 1px solid #edf0f5;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(20, 40, 80, 0.06);
    margin-bottom: 28px;
}

.product-detail .product-info .description {
    margin-bottom: 20px;
    line-height: 1.7;
    color: #444;
}

.product-detail .product-info .price {
    font-size: 24px;
    font-weight: bold;
    color: #e67e22;
    margin-bottom: 24px;
}

.product-detail .btn {
    margin-right: 10px;
}

/* 商品评价 */
.product-reviews {
    background-color: #fff;
    border: 1px solid #edf0f5;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(20, 40, 80, 0.06);
}

.product-reviews h3 {
    margin: 0 0 20px;
    color: #2c3e50;
}

.review-item {
    padding: 18px 0;
    border-bottom: 1px solid #f0f2f6;
}

.review-item:last-of-type {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.review-user {
    font-weight: 600;
    color: #2c3e50;
}

.review-rating {
    color: #f39c12;
    letter-spacing: 2px;
}

.review-time {
    font-size: 12px;
    color: #9aa4b2;
}

.review-content {
    line-height: 1.6;
    color: #5a6473;
}

.no-reviews {
    text-align: center;
    padding: 30px 0;
    color: #9aa4b2;
}

/* ===================== 购物车 / 订单表格 ===================== */
.cart-items table,
.order-list table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(20, 40, 80, 0.06);
    margin-bottom: 24px;
}

.cart-items th, .cart-items td,
.order-list th, .order-list td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eef1f6;
}

.cart-items thead th,
.order-list thead th {
    background-color: #f6f9fd;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.cart-items tbody tr:hover,
.order-list tbody tr:hover {
    background-color: #fafcff;
}

.cart-items tfoot td,
.order-list tfoot td {
    border-bottom: none;
}

/* 购物车单元格内的商品标题（保持朴素，不加卡片样式） */
.product-info h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid #dde3ec;
    background-color: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.quantity-control button:hover {
    background-color: #eef3fb;
}

.quantity-control input {
    width: 50px;
    height: 30px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    text-align: center;
    margin: 0 6px;
}

.subtotal,
.total-price {
    font-weight: bold;
    color: #e67e22;
}

.total-label {
    font-weight: 600;
    text-align: right;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.order-list .btn {
    margin-right: 8px;
}

/* ===================== 购物车空状态 ===================== */
.empty-cart {
    text-align: center;
    padding: 80px 0;
    background-color: #fff;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(20, 40, 80, 0.06);
}

.empty-cart p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #9aa4b2;
}

/* ===================== 商品详情评价样式 ===================== */
.product-reviews .btn {
    margin-top: 20px;
}

/* ===================== 评价表单样式 ===================== */
.product-review .form-group {
    margin-bottom: 20px;
}

.product-review .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.rating-stars {
    display: flex;
    gap: 10px;
}

.rating-stars input[type="radio"] {
    display: none;
}

.rating-stars label {
    cursor: pointer;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.rating-stars input[type="radio"]:checked + label {
    background-color: #f39c12;
    color: white;
    border-color: #f39c12;
}

.product-review .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

/* ===================== 响应式 ===================== */
@media (max-width: 768px) {
    .categories {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 24px;
    }

    .categories ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .categories li {
        margin-bottom: 0;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

    .avatar {
        margin-right: 0;
        margin-bottom: 20px;
    }
}
