/* 购物车页面样式 - 美化版 */

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title::before {
    content: '🛒';
    font-size: 24px;
}

/* 空购物车状态 */
.empty-state {
    background: #fff;
    border-radius: 16px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.empty-state .icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state p {
    color: #888;
    margin-bottom: 28px;
    font-size: 15px;
}

.empty-state .btn-primary {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    color: #fff;
    border-radius: 28px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.25);
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.35);
}

/* 购物车内容 */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* 商品列表 */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 单个商品项 - 卡片式 */
.cart-item {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ff6b9d, #ff8a80);
    opacity: 0;
    transition: opacity 0.3s;
}

.cart-item:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cart-item:hover::before {
    opacity: 1;
}

/* 商品图片 */
.cart-item .item-image {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff5f7, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #f0f0f0;
}

.cart-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* 商品信息 */
.item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-info .item-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
    line-height: 1.4;
}

.item-info .item-spec {
    font-size: 13px;
    color: #666;
    margin: 0;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

.item-info .item-custom {
    font-size: 12px;
    margin: 0;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.item-info .item-custom.mask-mode {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.item-info .item-custom.custom-mode {
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* 右侧操作区域 */
.item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    min-width: 180px;
}

/* 价格 */
.item-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.item-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.item-subtotal {
    font-size: 18px;
    font-weight: 700;
    color: #ff4d8a;
    letter-spacing: 0.5px;
}

/* 数量控制器 */
.item-quantity {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 24px;
    padding: 4px;
}

.item-quantity button {
    width: 32px;
    height: 32px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.item-quantity button:hover {
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    color: #fff;
    transform: scale(1.05);
}

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

.item-quantity input {
    width: 50px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    -moz-appearance: textfield;
}

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

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

/* 操作按钮 */
.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions .edit-btn,
.item-actions .delete-btn {
    padding: 6px 14px;
    background: transparent;
    color: #888;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-weight: 500;
}

.item-actions .edit-btn:hover {
    background: #fff5f7;
    color: #ff4d8a;
    border-color: #ffcdd2;
}

.item-actions .delete-btn:hover {
    background: #ffebee;
    color: #e53935;
    border-color: #ef9a9a;
}

/* 购物车摘要/结算卡片 */
.cart-summary {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 80px;
}

.summary-header {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.summary-row .label {
    color: #888;
}

.summary-row .value {
    color: #333;
    font-weight: 500;
}

.summary-row.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f5f5f5;
    margin-bottom: 24px;
    font-size: 14px;
}

.summary-row.total .label {
    color: #333;
    font-weight: 500;
}

.summary-row.total .total-price {
    font-size: 26px;
    font-weight: 700;
    color: #ff4d8a;
    letter-spacing: 0.5px;
}

/* 结算按钮 */
.btn-checkout {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    color: #fff;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 157, 0.4);
}

.btn-checkout:hover::before {
    left: 100%;
}

.btn-checkout:active {
    transform: translateY(0);
}

/* 结算弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    color: #666;
    transition: all 0.2s;
    border: none;
    line-height: 1;
}

.modal-close:hover {
    background: #ffebee;
    color: #e53935;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.checkout-section {
    margin-bottom: 24px;
}

.checkout-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.checkout-section h4 {
    margin: 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.checkout-section .section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.checkout-section .btn-link {
    font-size: 13px;
    color: #ff4d8a;
    text-decoration: none;
    font-weight: 500;
}

.checkout-section .btn-link:hover {
    text-decoration: underline;
}

.checkout-section .btn-refresh {
    font-size: 12px;
    padding: 5px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.checkout-section .btn-refresh:hover {
    background: #fff5f7;
    color: #ff4d8a;
}

.no-address {
    text-align: center;
    padding: 30px 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.no-address p {
    color: #888;
    margin-bottom: 16px;
    font-size: 14px;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    align-items: flex-start;
}

.address-item:hover {
    background: #fff5f7;
    border-color: #ffcdd2;
}

.address-item input[type="radio"] {
    margin-top: 4px;
    cursor: pointer;
    accent-color: #ff4d8a;
}

.address-item input[type="radio"]:checked ~ .address-info {
    color: #ff4d8a;
}

.address-info {
    flex: 1;
}

.address-info .address-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
}

.address-info .address-detail {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.address-item .default-badge {
    font-size: 11px;
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    color: #fff;
    padding: 3px 10px;
    border-radius: 10px;
    align-self: flex-start;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 90px;
    transition: all 0.2s;
    background: #fafafa;
    font-family: inherit;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #ff6b9d;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fff;
    border-radius: 12px;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.checkout-total:last-child {
    margin-bottom: 0;
}

.checkout-total .label {
    font-weight: 500;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-total .label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
}

.checkout-total .value {
    color: #333;
    font-weight: 600;
    font-size: 15px;
}

.checkout-total.total {
    background: linear-gradient(135deg, #fff0f5 0%, #fff5fa 100%);
    border: 2px solid #ffcdd2;
    padding: 18px 20px;
    margin-top: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.15);
}

.checkout-total.total .label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.checkout-total.total .label::before {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
}

.checkout-price {
    font-size: 22px;
    font-weight: 700;
    color: #ff4d8a;
    letter-spacing: 1px;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.checkout-price::before {
    content: '¥';
    font-size: 16px;
    font-weight: 600;
}

.checkout-total.total .checkout-price {
    font-size: 28px;
}

.checkout-total.total .checkout-price::before {
    font-size: 20px;
}

/* 不支持配送状态样式 */
.checkout-total.nosend {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border: 2px solid #ffcdd2;
    box-shadow: 0 4px 12px rgba(239, 154, 154, 0.15);
}

.checkout-total.nosend .label {
    color: #e53935;
}

.checkout-total.nosend .label::before {
    background: #e53935;
}

.checkout-total.nosend .value {
    color: #e53935;
    font-weight: 500;
}

.checkout-total.nosend .checkout-price {
    color: #e53935;
}

/* 包邮状态样式 */
.checkout-total.free-shipping .value {
    color: #4caf50;
}

.checkout-total.free-shipping .label::before {
    background: #4caf50;
}

/* 正常运费状态样式 */
.checkout-total.has-shipping .label::before {
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}

.btn-secondary {
    padding: 12px 28px;
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* 响应式 - 平板 */
@media screen and (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        order: 2;
    }

    .cart-items {
        order: 1;
    }
}

/* 响应式 - 手机 */
@media screen and (max-width: 768px) {
    .page-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .page-title::before {
        font-size: 20px;
    }

    .cart-item {
        grid-template-columns: 90px 1fr;
        gap: 14px;
        padding: 16px;
    }

    .cart-item .item-image {
        width: 90px;
        height: 90px;
        border-radius: 10px;
    }

    .item-right {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        min-width: auto;
        padding-top: 12px;
        border-top: 1px dashed #f0f0f0;
    }

    .item-info .item-name {
        font-size: 15px;
    }

    .item-info .item-spec {
        font-size: 12px;
    }

    .item-subtotal {
        font-size: 16px;
    }

    .item-quantity button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .item-quantity input {
        width: 40px;
        font-size: 14px;
    }

    .cart-summary {
        padding: 20px;
    }

    .summary-row.total .total-price {
        font-size: 22px;
    }

    .btn-checkout {
        padding: 14px;
        font-size: 15px;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }

    .empty-state {
        padding: 60px 24px;
    }

    .empty-state .icon {
        font-size: 56px;
    }
}

/* 小屏手机 */
@media screen and (max-width: 480px) {
    .cart-item {
        grid-template-columns: 72px 1fr;
        padding: 14px;
    }

    .cart-item .item-image {
        width: 72px;
        height: 72px;
        border-radius: 8px;
    }

    .item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .item-actions .edit-btn,
    .item-actions .delete-btn {
        flex: 1;
        padding: 8px;
        font-size: 12px;
    }

    .checkout-price {
        font-size: 20px;
    }
}
