/**
 * 购物车和结账页面样式 - 现代化设计
 * 
 * @package Laifen_Russia
 * @since 1.0.0
 */

/* ========== 全局变量 ========== */
:root {
    --cart-max-width: 1140px;
    --cart-spacing: 24px;
    --cart-radius: 12px;
    --cart-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --cart-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --cart-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 购物车页面容器 ========== */
.cart-page-wrapper {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 40px 0;
}

.cart-page-container {
    max-width: var(--cart-max-width) !important;
    margin: 0 auto !important;
    padding: 0 var(--cart-spacing) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ========== 页面头部 ========== */
.cart-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e9ecef;
}

.cart-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.cart-icon {
    color: #0066cc;
}

.cart-count {
    font-size: 18px;
    font-weight: 500;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
}

.continue-shopping {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--cart-transition);
}

.continue-shopping:hover {
    background: #f8f9fa;
    border-color: #0066cc;
    color: #0066cc;
    transform: translateX(-4px);
}

/* ========== 免费配送进度条 ========== */
.free-shipping-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    border-radius: var(--cart-radius);
    margin-bottom: 32px;
    box-shadow: var(--cart-shadow);
}

.free-shipping-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.free-shipping-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
}

.free-shipping-text {
    flex: 1;
}

.free-shipping-message {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px 0;
}

.free-shipping-message strong {
    font-weight: 700;
}

.free-shipping-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.free-shipping-progress-bar {
    height: 100%;
    background: #ffffff;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

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

/* ========== 购物车商品区域 ========== */
.cart-items-section {
    background: #ffffff;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    overflow: hidden;
}

.cart-items-header {
    padding: 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cart-items-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.cart-items-list {
    padding: 0;
}

/* ========== 购物车商品项 ========== */
.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid #f1f3f5;
    transition: var(--cart-transition);
}

.cart-item:hover {
    background: #f8f9fa;
}

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

.cart-item-image {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--cart-transition);
}

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

.cart-item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.cart-item-name a {
    color: inherit;
    text-decoration: none;
    transition: var(--cart-transition);
}

.cart-item-name a:hover {
    color: #0066cc;
}

.cart-item-meta {
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
}

.cart-item-meta p {
    margin: 4px 0;
}

.cart-item-backorder {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    margin-top: 8px;
}

.cart-item-price-mobile {
    display: none;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 8px;
}

.cart-item-price-mobile .price-label {
    color: #6c757d;
    font-weight: 400;
}

/* ========== 商品操作区域 ========== */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cart-item-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-label {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.quantity-selector {
    display: flex;
}

.quantity-selector .quantity {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.quantity-selector input[type="number"] {
    width: 60px;
    height: 40px;
    padding: 0 12px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    -moz-appearance: textfield;
}

.quantity-selector input[type="number"]::-webkit-outer-spin-button,
.quantity-selector input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-selector input[type="number"]:focus {
    outline: none;
}

.cart-item-subtotal {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
}

.subtotal-label {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.subtotal-amount {
    font-size: 20px;
    font-weight: 700;
    color: #0066cc;
}

.cart-item-remove {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--cart-transition);
}

.cart-item-remove:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.cart-item-remove svg {
    width: 16px;
    height: 16px;
}

/* ========== 购物车操作按钮 ========== */
.cart-actions {
    padding: 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.cart-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #6c757d;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cart-transition);
}

.cart-actions .button:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ========== 购物车汇总 ========== */
.cart-summary-section {
    position: sticky;
    top: 100px;
}

.cart_totals {
    background: #ffffff;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.cart_totals h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.cart_totals table {
    width: 100%;
    margin-bottom: 20px;
}

.cart_totals th,
.cart_totals td {
    padding: 12px 0;
    font-size: 15px;
}

.cart_totals th {
    font-weight: 500;
    color: #6c757d;
    text-align: left;
}

.cart_totals td {
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    padding-top: 16px;
    border-top: 2px solid #e9ecef;
}

.cart_totals .order-total td {
    color: #0066cc;
}

.wc-proceed-to-checkout {
    margin-top: 20px;
}

.wc-proceed-to-checkout .checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--cart-transition);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.wc-proceed-to-checkout .checkout-button:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* ========== 信任标识 ========== */
.cart-trust-badges {
    background: #ffffff;
    border-radius: var(--cart-radius);
    box-shadow: var(--cart-shadow);
    padding: 20px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 14px;
    color: #495057;
}

.trust-badge:not(:last-child) {
    border-bottom: 1px solid #f1f3f5;
}

.trust-badge svg {
    flex-shrink: 0;
    color: #28a745;
}

/* ========== 响应式设计 - 平板 ========== */
@media (max-width: 1023px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .cart-items-section {
        order: 1;
    }
}

/* ========== 响应式设计 - 手机 ========== */
@media (max-width: 767px) {
    .cart-page-wrapper {
        padding: 20px 0;
    }

    .cart-page-container {
        padding: 0 16px;
    }

    .cart-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .cart-page-title {
        font-size: 24px;
    }

    .cart-icon {
        width: 24px;
        height: 24px;
    }

    .cart-count {
        font-size: 14px;
    }

    .continue-shopping {
        width: 100%;
        justify-content: center;
    }

    .free-shipping-bar {
        padding: 16px;
    }

    .free-shipping-content {
        flex-direction: column;
        text-align: center;
    }

    .free-shipping-icon {
        width: 40px;
        height: 40px;
    }

    .free-shipping-message {
        font-size: 14px;
    }

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

    .cart-item-image {
        width: 100%;
        height: 200px;
    }

    .cart-item-name {
        font-size: 16px;
    }

    .cart-item-price-mobile {
        display: block;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cart-item-quantity {
        width: 100%;
    }

    .quantity-selector {
        width: 100%;
    }

    .quantity-selector .quantity {
        width: 100%;
        justify-content: center;
    }

    .cart-item-subtotal {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-left: 0;
        padding: 12px 0;
        border-top: 1px solid #e9ecef;
    }

    .subtotal-label {
        font-size: 14px;
    }

    .subtotal-amount {
        font-size: 18px;
    }

    .cart-item-remove {
        width: 100%;
        justify-content: center;
    }

    .cart-actions {
        padding: 16px;
    }

    .cart-actions .button {
        width: 100%;
        justify-content: center;
    }

    .cart_totals {
        padding: 20px 16px;
    }

    .cart_totals h2 {
        font-size: 18px;
    }

    .wc-proceed-to-checkout .checkout-button {
        font-size: 16px;
        padding: 14px;
    }
}

/* ========== 空购物车状态 ========== */
.woocommerce-info,
.woocommerce-message {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 16px 20px;
    border-radius: 8px;
    color: #0c5460;
    font-size: 15px;
    margin-bottom: 24px;
}

.woocommerce-info::before,
.woocommerce-message::before {
    content: "ℹ️";
    margin-right: 8px;
}

/* ========== 加载动画 ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}

/* ========== 结账页面样式保留用于未来开发 ========== */