/* 购物车页面专用样式 */

/* 面包屑导航 */
.breadcrumb {
    padding: 20px 0;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-purple);
}

.breadcrumb span {
    color: var(--text-light);
}

/* 购物车主要内容区域 */
.cart-main {
    padding: 40px 0;
    min-height: 80vh;
}

.cart-header {
    margin-bottom: 40px;
}

.cart-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-purple);
    margin: 0 0 8px 0;
}

.cart-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

/* 购物车布局 */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

/* 左侧购物车商品列表 */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    align-items: center;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.item-quantity-total {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: space-between;
    }
/* 商品图片 */
.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品详情 */
.item-details {
    min-width: 200px;
}

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.item-specs {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

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

/* 数量控制 */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-white);
    color: var(--text-dark);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background-color: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.qty-number {
    min-width: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

/* 商品总价 */
.item-total {
    min-width: 80px;
    text-align: right;
}

.total-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

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

/* 商品操作按钮 */
.item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 数量控制区域 */
.item-quantity-total {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.action-btn {
    width: 60px;
    height: 32px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
}

.action-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.5);
}

.action-btn:hover img {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1);
}

.action-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: lowercase;
}

.action-btn:hover .action-text {
    color: white;
}

/* 右侧订单摘要 */
.order-summary {
    position: sticky;
    top: 120px;
}

.summary-card {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.summary-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-purple);
    margin: 0 0 30px 0;
    text-align: center;
}

/* 订单详情 */
.summary-details {
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    border-top: 2px solid var(--primary-purple);
    margin-top: 12px;
    padding-top: 20px;
    font-weight: 600;
}

.summary-label {
    font-size: 16px;
    color: var(--text-dark);
}

.summary-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.summary-value.free {
    color: #10B981;
    font-weight: 600;
}

.summary-row.total .summary-label,
.summary-row.total .summary-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-purple);
}

/* 促销代码区域 */
.promo-section {
    margin-bottom: 30px;
}

.promo-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 15px 0;
}

.promo-input-group {
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.promo-input:focus {
    border-color: var(--primary-purple);
}

.promo-btn {
    padding: 12px 20px;
    background-color: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.promo-btn:hover {
    background-color: #4a2a6b;
}

/* 结账按钮区域 */
.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-btn {
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

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

.checkout-btn.primary:hover {
    background-color: #4a2a6b;
}

.checkout-btn.secondary {
    background-color: var(--bg-white);
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
}

.checkout-btn.secondary:hover {
    background-color: var(--primary-purple);
    color: white;
}

/* 安全提示信息 */
.security-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* You might also like 版块 */
.recommendations-section {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.recommendations-divider {
    width: 100%;
    height: 1px;
    background-color: var(--border-light);
    margin-bottom: 60px;
}

.recommendations-title {
    font-size: 32px;
    font-weight: normal;
    color: var(--primary-purple);
    text-align: left;
    margin-bottom: 60px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.recommendation-card {
    background-color: var(--bg-white);
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.recommendation-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.recommendation-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 20px 12px 20px;
    line-height: 1.4;
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommendation-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px 20px 20px;
}

.recommendation-price .current-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.recommendation-price .original-price {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
}

.add-to-cart-btn {
    width: 100%;
    margin: 0 0 20px 0;
    padding: 12px 20px;
    background-color: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

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

.add-to-cart-btn .cart-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* 响应式样式 */
@media (max-width: 1024px) {
    .recommendations-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 393px) {
    .recommendations-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Footer 样式 */
.footer-main {
    padding-top: 40px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.security-item:last-child {
    margin-bottom: 0;
}

.security-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(1000%) hue-rotate(120deg) brightness(0.8);
}

.security-text {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* 响应式设计 */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .order-summary {
        position: static;
        order: 2;
    }
    
    .cart-items {
        order: 1;
    }
    
    .cart-item {
        grid-template-columns: 60px 1fr auto auto auto;
        gap: 15px;
        padding: 15px;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
    }
    
    .item-details {
        min-width: 150px;
    }
    
    .item-name {
        font-size: 14px;
    }
    
    .item-specs {
        font-size: 12px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .original-price {
        font-size: 12px;
    }
    
    .total-price {
        font-size: 16px;
    }
}

/* 移动设备 (最大 767px) */
@media (max-width: 767px) {
    .cart-main {
        padding: 20px 0 60px;
    }
    
    .cart-title {
        font-size: 24px;
    }
    
    .cart-subtitle {
        font-size: 14px;
    }
    
    .cart-layout {
        gap: 20px;
    }
    
    .cart-item {
        display: grid;
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        text-align: left;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
        margin: 0;
        grid-row: 1 / 3;
    }
    
    .item-details {
        min-width: 120px;
        grid-column: 2;
        grid-row: 1;
    }
    
    .item-right {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .item-quantity-total {
        display: flex;
        align-items: center;
        gap: 12px;
        justify-content: space-between;
    }
    
    .item-quantity {
        flex-shrink: 0;
    }
    
    .item-total {
        flex-shrink: 0;
    }
    
    .item-actions {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .item-quantity {
        justify-content: center;
    }
    
    .item-total {
        text-align: center;
    }
    
    .item-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .summary-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .summary-row {
        padding: 8px 0;
    }
    
    .summary-label,
    .summary-value {
        font-size: 14px;
    }
    
    .summary-row.total .summary-label,
    .summary-row.total .summary-value {
        font-size: 16px;
    }
    
    .promo-input-group {
        flex-direction: column;
    }
    
    .checkout-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* 小米 Fold 4 特殊优化 - 折叠状态 (约 393px) */
@media (max-width: 393px) {
    .cart-item {
        padding: 12px;
        gap: 10px;
        display: grid;
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto;
    }
    
    .item-image {
        width: 50px;
        height: 50px;
        grid-row: 1 / 3;
    }
    
    .item-details {
        min-width: 100px;
        grid-column: 2;
        grid-row: 1;
    }
    
    .item-right {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .item-quantity-total {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: space-between;
    }
    
    .item-quantity {
        flex-shrink: 0;
    }
    
    .item-total {
        flex-shrink: 0;
    }
    
    .item-actions {
        display: flex;
        flex-direction: row;
        gap: 6px;
        flex-shrink: 0;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-specs {
        font-size: 11px;
    }
    
    .current-price {
        font-size: 13px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .total-price {
        font-size: 14px;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .qty-number {
        font-size: 14px;
    }
    
    .action-btn {
        width: 50px;
        height: 28px;
    }
    
    .action-btn img {
        width: 14px;
        height: 14px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    .summary-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .summary-label,
    .summary-value {
        font-size: 13px;
    }
    
    .summary-row.total .summary-label,
    .summary-row.total .summary-value {
        font-size: 15px;
    }
    
    .checkout-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}
