/* 购物车页面专用样式 */

/* ============================
   购物车项目样式
   ============================ */
/* PC端和手机端共用的容器 */
.cart-item {
    margin-bottom: 16px;
}

/* PC端购物车项目样式 */
.cart-item-pc {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex !important;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.cart-image {
    width: 120px;
    height: 120px;
    background: var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ccc;
    flex-shrink: 0;
}

.cart-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.cart-details {
    flex: 1;
}

.product-specs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.quantity-info {
    color: var(--text-secondary);
    font-weight: 500;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* ============================
   购物车控制样式
   ============================ */
.cart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: #ff6900;
    color: #ff6900;
}

.quantity-btn:active,
.quantity-btn.active {
    background-color: #ff6900;
    border-color: #ff6900;
    color: white;
}

/* ============================
   复选框样式自定义
   ============================ */
.form-check-input:checked {
    background-color: #ff6900;
    border-color: #ff6900;
}

.form-check-input:focus {
    border-color: #ff6900;
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 0, 0.25);
}

/* Bootstrap按钮样式覆盖 */
.btn-primary {
    background-color: #ff6900 !important;
    border-color: #ff6900 !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    background-color: #e55a00 !important;
    border-color: #e55a00 !important;
}

.btn-primary:focus,
.btn-primary.focus {
    background-color: #e55a00 !important;
    border-color: #e55a00 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 0, 0.25) !important;
}

.btn-primary:active,
.btn-primary.active {
    background-color: #cc4f00 !important;
    border-color: #cc4f00 !important;
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: #cc4f00 !important;
    border-color: #cc4f00 !important;
}

.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 0, 0.25) !important;
}

/* 编辑按钮样式 */
.btn-outline-primary {
    color: #ff6900 !important;
    border-color: #ff6900 !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

/* 强制重置编辑按钮的背景色和文字颜色 */
#editToggleBtn.btn-outline-primary {
    background-color: transparent !important;
    color: #ff6900 !important;
}

/* 确保编辑按钮在非悬停状态下背景透明，文字橙色 */
#editToggleBtn.btn-outline-primary:not(:hover):not(:focus):not(:active) {
    background-color: transparent !important;
    color: #ff6900 !important;
}

/* 移除任何可能的内联样式冲突 */
#editToggleBtn[style*="background-color"] {
    background-color: transparent !important;
}

/* 强制重置编辑按钮文字颜色，防止白色 */
#editToggleBtn[style*="color"] {
    color: #ff6900 !important;
}

.btn-outline-primary:hover {
    color: white !important;
    background-color: #ff6900 !important;
    border-color: #ff6900 !important;
}

.btn-outline-primary:focus,
.btn-outline-primary.focus {
    color: white !important;
    background-color: #ff6900 !important;
    border-color: #ff6900 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 0, 0.25) !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active {
    color: white !important;
    background-color: #e55a00 !important;
    border-color: #e55a00 !important;
}

.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active {
    color: white !important;
    background-color: #e55a00 !important;
    border-color: #e55a00 !important;
}

/* 防止Bootstrap默认蓝色在状态切换时显示 */
.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
.btn-outline-primary:not(:disabled):not(.disabled).active:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 0, 0.25) !important;
}

/* 删除按钮样式 */
.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    transition: all 0.3s ease !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.btn-danger:focus,
.btn-danger.focus {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

.btn-danger:active,
.btn-danger.active {
    background-color: #bd2130 !important;
    border-color: #b21f2d !important;
}

.btn-danger:not(:disabled):not(.disabled):active,
.btn-danger:not(:disabled):not(.disabled).active {
    background-color: #bd2130 !important;
    border-color: #b21f2d !important;
}

.btn-danger:not(:disabled):not(.disabled):active:focus,
.btn-danger:not(:disabled):not(.disabled).active:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

/* ============================
   订单确认页面优化
   ============================ */
.order-summary {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
}

.order-action-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--primary-color);
    text-align: center;
    position: sticky;
    top: 100px;
}

.order-action-card .btn {
    font-size: 18px;
    padding: 12px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(255, 105, 0, 0.3);
    transition: all 0.3s ease;
}

.order-action-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 105, 0, 0.4);
}

.margin-0-20 {
    margin: 0 20px 20px 20px;
}
 
/* ============================
   PC端特定样式
   ============================ */
@media (min-width: 768px) {
    .cart-items {
        min-height: 200px;
    }
    
    .cart-item-pc {
        width: 100%;
        display: flex !important;
        min-height: 120px;
    }
    
    .d-md-block {
        display: block !important;
    }
    
    .d-md-flex {
        display: flex !important;
    }
}

/* ============================
   移动端头部样式
   ============================ */
@media (max-width: 767px) {
    /* 手机端头部去掉边框和圆角，添加底部边框 */
    .card-custom.d-md-none {
        border: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 18px 10px 10px 0 !important;
        margin-bottom: 0 !important;
    }
}

/* ============================
   移动端适配
   ============================ */
@media (max-width: 767px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .cart-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 手机端购物车样式 */
    .cart-item-mobile {
        background: #fff;
        border: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        padding: 15px;
        margin-bottom: 0;
    }
    
    .mobile-checkbox {
        width: 20px;
        flex-shrink: 0;
        display: flex;
        align-items: flex-start;
        padding-top: 5px;
    }
    
    .mobile-image {
        width: 30%;
        margin: 0 12px;
        flex-shrink: 0;
    }
    
    .mobile-product-img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .mobile-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-title {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        margin: 0;
        color: var(--text-primary);
    }
    
    .mobile-specs {
        font-size: 12px;
        margin: 0;
        color: var(--text-secondary);
    }
    
    .mobile-bottom {
        margin-top: auto;
    }
    
    .mobile-price {
        font-size: 16px;
        font-weight: 700;
    }
    
    .mobile-quantity {
        gap: 8px;
    }
    
    .mobile-quantity-btn {
        width: 24px;
        height: 24px;
        border: 1px solid #ddd;
        background: #fff;
        border-radius: 4px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    .mobile-quantity-btn:hover {
        background: #f5f5f5;
    }
    
    .mobile-quantity-btn:active,
    .mobile-quantity-btn.active {
        background-color: #ff6900;
        border-color: #ff6900;
        color: white;
    }
    
    .mobile-quantity-num {
        font-size: 14px;
        font-weight: 500;
        min-width: 20px;
        text-align: center;
    }
    

    
    /* 底部悬浮结算栏 */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 12px 15px;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    /* 隐藏底部栏的专用类 */
    .mobile-bottom-bar.hidden {
        display: none !important;
    }
    
    .mobile-select-all {
        display: flex;
        align-items: center;
    }
    
    .mobile-total {
        font-size: 14px;
        color: var(--text-primary);
    }
    
    .mobile-checkout-btn {
        font-size: 14px;
        padding: 8px 20px;
        border-radius: 20px;
        font-weight: 600;
    }
    
    /* 为底部栏预留空间 */
    .main-content {
        padding-bottom: 80px;
    }
}

/* ============================
   购物车空状态样式优化
   ============================ */
#pcEmptyCart, #mobileEmptyCart {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

#pcEmptyCart i, #mobileEmptyCart i {
    opacity: 0.6;
}

#pcEmptyCart h4, #mobileEmptyCart h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 600;
}

#pcEmptyCart p, #mobileEmptyCart p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

/* PC端空状态特别优化 */
@media (min-width: 768px) {
    #pcEmptyCart {
        min-height: 400px;
        margin: 60px 0;
    }
    
    #pcEmptyCart i {
        font-size: 5rem !important;
        margin-bottom: 2rem !important;
    }
    
    #pcEmptyCart h4 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    #pcEmptyCart p {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
}
