/* 购物车页面样式 */

/* 主内容区域 */
.cart-main {
    padding: 30px 20px;
    background-color: #f8f9fa;
    min-height: calc(100vh - 70px - 300px);
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cart-title {
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 25px;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.cart-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 购物车内容 */
.cart-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

/* 购物车表头 */
.cart-header {
    display: grid;
    grid-template-columns: 80px 3fr 1fr 1fr 1fr 1fr 100px;
    padding: 20px 15px;
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 1px solid #eaeaea;
    color: #555;
    align-items: center;
    text-align: center;
}

.cart-header .cart-product {
    text-align: left;
}

/* 购物车列表 */
.cart-list {
    border-bottom: 1px solid #f0f0f0;
}

/* 购物车项目 */
.cart-item {
    display: grid;
    grid-template-columns: 80px 3fr 1fr 1fr 1fr 1fr 100px;
    padding: 25px 15px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
    text-align: center;
}

.cart-item .cart-product {
    text-align: left;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item:hover {
    background-color: #fafafa;
}

/* 购物车列 */
.cart-col {
    padding: 0 10px;
}

/* 复选框样式 */
.cart-checkbox {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    min-height: 24px;
}

.cart-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #d9d9d9;
    border-radius: 5px;
    transform: translateY(-50%);
    transition: all 0.2s ease;
}

.cart-checkbox:hover input ~ .checkmark {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(21, 117, 64, 0.1);
}

.cart-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(21, 117, 64, 0.3);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cart-checkbox input:checked ~ .checkmark:after {
    display: block;
    animation: checkAnimation 0.2s ease-in-out;
}

.cart-checkbox .checkmark:after {
    left: 50%;
    top: 50%;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.select-all-text {
    margin-left: 5px;
    font-size: 14px;
    color: #555;
}

/* 商品信息 */
.product-info {
    display: flex;
    align-items: center;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.cart-item:hover .product-image {
    transform: scale(1.05);
}

.product-details {
    margin-left: 15px;
    flex: 1;
}

.product-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.product-spec {
    font-size: 14px;
    color: var(--text-color-lighter);
}

/* 价格 */
.cart-price {
    font-size: 16px;
    color: #555;
    text-align: center;
}

/* 库存数量样式 */
.cart-stock {

}

/* 库存状态样式 */
.stock-normal {
    color: #52c41a;  /* 绿色 - 库存充足 */
}

.stock-warning {
    color: #faad14;  /* 黄色 - 库存偏低 */
    border: 1px solid #faad14;
    border-radius: 4px;
    padding: 2px 8px;
    display: inline-block;
}

.stock-danger {
    color: #ff4d4f;  /* 红色 - 库存极低 */
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    padding: 2px 8px;
    display: inline-block;
}

.stock-empty {
    color: #ff4d4f;  /* 红色 - 无库存 */
    background-color: rgba(255, 77, 79, 0.1);
    border-radius: 4px;
    padding: 2px 8px;
    display: inline-block;
    font-weight: 500;
}

.cart-stock:empty::before {
    content: "-";
    color: #999;
}

/* 数量控制 */
.quantity-control {
    display: flex;
    align-items: center;
    max-width: 120px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 auto;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background-color: #f8f9fa;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.quantity-btn:hover {
    background-color: #eaeaea;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    min-width: 48px;
    width: auto;
    flex-grow: 1;
    height: 36px;
    border: none;
    border-left: 1px solid #eaeaea;
    border-right: 1px solid #eaeaea;
    text-align: center;
    font-size: 14px;
    color: #333;
    -moz-appearance: textfield;
    padding: 0 5px;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
}

/* 小计 */
.cart-subtotal {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

/* 操作按钮 */
.delete-btn {
    background-color: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn i {
    margin-right: 4px;
    font-size: 16px;
}

.delete-btn:hover {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.08);
}

/* 购物车为空状态 */
.cart-empty {
    padding: 60px 0;
    text-align: center;
}

.empty-cart-svg {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.cart-empty p {
    color: #999;
    margin-bottom: 20px;
    font-size: 16px;
}

.continue-shopping-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.continue-shopping-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 117, 64, 0.2);
}

/* 购物车底部 */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background-color: #f8f9fa;
}

.cart-footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 继续下单按钮 */
.cart-footer-left .continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d5e30 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(21, 117, 64, 0.2);
}

.cart-footer-left .continue-shopping-btn i {
    font-size: 16px;
}

.cart-footer-left .continue-shopping-btn:hover {
    background: linear-gradient(135deg, #0d5e30 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 117, 64, 0.3);
}

.batch-delete-btn,
.clear-cart-btn {
    background-color: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.batch-delete-btn:hover,
.clear-cart-btn:hover {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.08);
}

.cart-footer-right {
    display: flex;
    align-items: center;
}

.cart-summary {
    margin-right: 20px;
    text-align: right;
}

.selected-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.total-price {
    font-size: 16px;
    color: #333;
}

#totalPrice {
    font-size: 24px;
    font-weight: 700;
    color: #ff4d4f;
}

.checkout-btn {
    padding: 12px 35px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 117, 64, 0.2);
}

/* 推荐商品 */
.recommended-products {
    margin-top: 40px;
}

.section-title {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    margin-right: 10px;
    border-radius: 2px;
}

/* 更新产品网格样式，匹配index.html */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    position: relative;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

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

.product-image-container {
    width: 100%;
    height: 280px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    border-radius: 8px 8px 0 0;
}

.product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: none;
    transition: transform 0.3s ease;
}
.product-infos{
    display: flex;
}
.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 产品名称和新品标签 */
.product-name {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.new-tag {
    background-color: #ff6b6b;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 产品标签 */
.product-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.product-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    color: var(--text-color-light);
}

.product-tag.primary {
    background-color: rgba(21, 117, 64, 0.1);
    color: var(--primary-color);
}

/* 价格信息 */
.product-prices {
    margin-bottom: 15px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
}

.original-price {
    font-size: 14px;
    color: var(--text-color-lighter);
    text-decoration: line-through;
    margin-left: 5px;
}

.member-price {
    font-size: 14px;
    color: var(--primary-color);
    margin-top: 5px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: auto;
    font-size: 14px;
    font-weight: 500;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color-dark);
}

.add-to-cart-btn i {
    font-size: 16px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框样式 */
.modal {
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background-color: #fff;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.delete-confirm-container {
    width: 400px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    font-size: 24px;
    color: var(--text-color-lighter);
    cursor: pointer;
    border: none;
    background: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-btn-cancel {
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid #d9d9d9;
}

.modal-btn-cancel:hover {
    background-color: #f5f5f5;
}

.modal-btn-confirm {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.modal-btn-confirm:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(21, 117, 64, 0.2);
}

.modal-btn-danger {
    background-color: #ff4d4f;
}

.modal-btn-danger:hover {
    background-color: #ff3333;
    box-shadow: 0 3px 8px rgba(255, 77, 79, 0.2);
}

/* 规格修改弹窗内容 */
.product-preview {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-preview .product-info {
    margin-left: 15px;
    display: block;
}

.product-preview h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.modal-price {
    font-size: 18px;
    font-weight: 600;
    color: #ff4d4f;
}

.spec-options h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.spec-group {
    margin-bottom: 20px;
}

.spec-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.spec-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-value {
    padding: 8px 15px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
}

.spec-value:hover:not(.selected) {
    border-color: #d9d9d9;
    background-color: #fafafa;
}

.spec-value.selected {
    border-color: var(--primary-color);
    background-color: rgba(21, 117, 64, 0.08);
    color: var(--primary-color);
}

.quantity-section {
    margin-top: 25px;
}

.quantity-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.delete-confirm-message {
    font-size: 16px;
    color: #333;
    text-align: center;
    padding: 15px 0;
}

@keyframes checkAnimation {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0.5);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cart-header, 
    .cart-item {
        grid-template-columns: 60px 2fr 1fr 1fr 1fr 80px;
    }
    
    .cart-stock {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cart-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-footer-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .cart-header, 
    .cart-item {
        grid-template-columns: 40px 2fr 1fr 60px;
    }
    
    .cart-quantity, .cart-price {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .cart-footer-left {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .cart-footer-left .continue-shopping-btn {
        order: -1;
        width: 100%;
    }
    
    .batch-delete-btn,
    .clear-cart-btn {
        margin-top: 10px;
    }
} 

/* 确认订单模态框初始状态 */


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} 