
/* 产品购物车区域 */
.product-cart-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 2rem 0;
}

/* 产品信息卡片 */
.product-info-card {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
}

.product-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.product-brand {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
}

.product-color {
    font-size: 0.9rem;
    color: var(--text-medium);
}

/* 购物车表单 */
.cart-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex; /* 添加flex布局 */
    align-items: flex-start; /* 顶部对齐 */
    gap: 1rem; /* 标签和内容之间的间距 */
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0; /* 移除底部margin */
    font-size: 1rem;
    min-width: 80px; /* 给标签一个最小宽度，保持对齐 */
    padding-top: 0.3rem; /* 微调垂直对齐 */
    flex-shrink: 0; /* 防止标签被压缩 */
}

/* 选项组 */
.options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    flex: 1; /* 占据剩余空间 */
    align-items: center; /* 垂直居中 */
    min-height: 2.5rem; /* 最小高度确保对齐 */
}
.option-item {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.option-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.option-item.click {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 复选框标签 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.checkbox-text {
    color: var(--text-dark);
    font-weight: 500;
}

/* 数量控制 */
.quantity-group {
    margin-bottom: 0;
}

.quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.quantity-btn {
    background: var(--background);
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.quantity-input {

    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 表单分隔线 */
.form-divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* 购物车操作 */

.btn-add-to-cart {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: var(--primary);
    color: white; /* 设置按钮文字颜色为白色 */
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 图标继承按钮文字颜色 */
.btn-add-to-cart .icon {
    color: white;
    fill: currentColor;
}

/* 悬停状态 */
.btn-add-to-cart:hover {
    background: var(--primary-dark);
    color: white;
}

/* 确保图标在悬停时也保持白色 */
.btn-add-to-cart:hover .icon {
    color: inherit;
}

/* 确保图标继承按钮文字颜色 */
.btn-add-to-cart .icon-shoppingcart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
    color: white;
}

/* 确保图标在悬停时也保持白色 */
.btn-add-to-cart:hover .icon-shoppingcart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
}
/* 响应式设计 */
@media (max-width: 768px) {
    .product-cart-section {
        margin: 1rem 0;
    }
    
    .product-info-card,
    .cart-form {
        padding: 1.5rem;
    }
    
    .product-grid {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .quantity-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .quantity-controls {
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    .product-info-card,
    .cart-form {
        padding: 1rem;
    }
    
    .options-group {
        gap: 0.5rem;
    }
    
    .option-item {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-add-to-cart {
        padding: 1rem;
        font-size: 1rem;
    }
}


/* 购物车页面样式 */
.cart-actions-top {
    margin-bottom: 2rem;
}

.btn-submit-order {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

/* 地址卡片 */
.address-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.address-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1.5rem 0;
}

.address-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.address-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.address-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem 1.5rem;
}

.address-info {
    flex: 1;
}

.recipient-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.recipient-info strong {
    color: var(--text-dark);
    font-size: 1rem;
}

.phone {
    color: var(--text-medium);
    font-size: 0.9rem;
}

.address-details {
    color: var(--text-medium);
    line-height: 1.5;
}

.btn-edit {
    color: var(--primary);
    font-size: 1.2rem;
    padding: 0.5rem;
}

/* 购物车商品部分 */
.cart-items-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--background-alt);
}

.section-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header i {
    color: var(--primary);
}

.cart-items-container {
    padding: 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 200px;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.cart-item:hover {
    background: var(--background-alt);
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-name {
    margin: 0;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.4;
}

.item-sku {
    color: var(--text-light);
    font-size: 0.85rem;
}

.item-remarks {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.4;
}

.giftbox-info {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
}

.item-pricing {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
}

.unit-price {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.quantity {
    color: var(--text-medium);
    font-size: 0.9rem;
}


.stock-status {
    color: var(--text-light);
    font-size: 0.8rem;
}

.item-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 订单汇总 */
.order-summary {
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.summary-card h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    border-top: 2px solid var(--primary);
    padding-top: 1rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.total-amount {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
}

/* 继续购物 */
.continue-shopping {
    margin-bottom: 2rem;
    text-align: center;
}

/* 表单部分 */
.shipping-info-section,
.delivery-instructions {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}
/* 配送说明文本区域自适应 */
.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.textarea.form-control {
    min-height: 100px;
    resize: vertical;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

/* 确保输入框图标布局正确 */
.input-with-icon {
    width: 100%;
}

.input-with-icon textarea {
    padding-left: 3rem;
    width: 100%;
}
.form-container {
    padding: 1.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
}

.input-with-icon input,
.input-with-icon textarea {
    padding-left: 3rem;
}

.form-help {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* 支付方式 */
.payment-methods {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.payment-options {
    padding: 1.5rem;
}

.payment-option {
    margin-bottom: 1rem;
}

.payment-option:last-child {
    margin-bottom: 0;
}

.payment-label {
    display: block;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.payment-label:hover {
    border-color: var(--primary-light);
}

.payment-label input[type="radio"] {
    display: none;
}

.payment-label input[type="radio"]:checked + .payment-content {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-label input[type="radio"]:checked + .payment-content .payment-check {
    display: block;
}

.payment-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.3s ease;
}

.payment-icon {
    width: 40px;
    height: 20px;
    object-fit: contain;
}

.payment-name {
    flex: 1;
    color: var(--text-dark);
    font-weight: 500;
}

.payment-check {
    color: var(--primary);
    display: none;
}

/* 底部工具栏 */
.cart-footer-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 0.8rem 1rem;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
}

.footer-nav {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    gap: 1rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--primary);
}

.total-info {
    flex-direction: column;
    gap: 0.2rem;
}

.total-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.total-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    /* 确保文字居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    /* 如果按钮高度不一致 */
    height: fit-content;
    min-height: 44px; /* 最小触摸目标尺寸 */
}

.btn-submit:hover {
    background: var(--primary-dark);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .item-pricing {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        border-top: 1px solid var(--border);
        padding-top: 1rem;
        margin-top: 1rem;
    }
    
    .footer-nav {
        grid-template-columns: 50px 1fr 100px;
        gap: 0.8rem;
    }
    
    .btn-submit {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .item-pricing {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .item-actions {
        justify-content: center;
    }
    
    .footer-nav {
        grid-template-columns: 40px 1fr 90px;
        gap: 0.5rem;
    }
    
    .total-price {
        font-size: 1rem;
    }
}