/* === 商城样式 === */

/* === 商品卡片 === */
.nordic-product-card {
    background: #fff;
    border: 1px solid rgba(74, 141, 183, 0.2);
    border-radius: 12px;
    overflow: hidden;
    max-width: 360px;
    margin: 16px auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.nordic-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.product-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 降级方案 */
    overflow: hidden;
    background: #F6F9FC;
}
.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@supports (aspect-ratio: 1) {
    .product-card-image {
        aspect-ratio: 4/3;
        padding-bottom: 0;
    }
    .product-card-image img {
        position: static;
        height: auto;
    }
}
.product-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 10px;
    background: rgba(74, 141, 183, 0.9);
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
}
.product-card-info {
    padding: 14px 16px;
}
.product-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
    line-height: 1.4;
}
.product-card-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #4A8DB7;
}
.product-stock {
    font-size: 12px;
    color: #999;
}
.product-buy-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #4A8DB7, #2E6E8F);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 1px;
}
.product-buy-btn:hover {
    opacity: 0.9;
}
.product-buy-btn.sold-out {
    background: #ccc;
    cursor: not-allowed;
}

/* === 结账弹窗 === */
.checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.checkout-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.checkout-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}
.checkout-modal-overlay.active .checkout-modal {
    transform: translateY(0);
}
.checkout-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
}
.checkout-product-info {
    display: flex;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(74, 141, 183, 0.15);
    margin-bottom: 16px;
}
.checkout-product-info > * {
    margin-right: 12px;
}
.checkout-product-info > *:last-child {
    margin-right: 0;
}
@supports (gap: 1px) {
    .checkout-product-info {
        gap: 12px;
    }
    .checkout-product-info > * {
        margin-right: 0;
    }
}
.checkout-product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.checkout-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
}
.checkout-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #4A8DB7;
}
.checkout-form-group {
    margin-bottom: 14px;
}
.checkout-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2E3A4A;
    margin-bottom: 6px;
}
.checkout-form-group input,
.checkout-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(74, 141, 183, 0.3);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.checkout-form-group input:focus,
.checkout-form-group textarea:focus {
    border-color: #4A8DB7;
    outline: none;
}


.checkout-submit-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4A8DB7, #2E6E8F);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    letter-spacing: 1px;
}
.checkout-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 支付等待状态 */
.checkout-paying {
    text-align: center;
    padding: 20px 0;
}
.checkout-paying .loading-text {
    font-size: 14px;
    color: #2E6E8F;
    margin-top: 12px;
}

/* 支付成功 */
.checkout-success {
    text-align: center;
    padding: 20px 0;
}
.checkout-success .success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}
.checkout-success .success-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* === 商品选择弹层 === */
.product-select-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(74, 141, 183, 0.3);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.product-select-title {
    font-size: 12px;
    font-weight: 600;
    color: #2E6E8F;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(74, 141, 183, 0.15);
    margin-bottom: 4px;
}
.product-select-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.15s;
}
.product-select-item:hover {
    background: rgba(74, 141, 183, 0.1);
}
.product-select-empty,
.product-select-loading {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
}

/* === 扫码转账支付 === */
.transfer-payment-wrap {
    text-align: center;
    padding: 20px;
}
.transfer-header h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}
.transfer-amount {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}
.transfer-qrcode {
    margin: 20px auto;
    display: inline-block;
}
.transfer-qrcode img {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 2px solid #eee;
}
.transfer-info {
    margin: 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}
.transfer-account {
    font-weight: bold;
    color: #333;
}
.transfer-order {
    color: #999;
    font-size: 13px;
}
.transfer-note {
    color: #e67e22;
    font-size: 13px;
    margin-top: 8px;
}
.transfer-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-mark-paid {
    background: #4A8DB7;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-mark-paid:hover {
    background: #3A7A9E;
}
.btn-mark-paid:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-cancel-pay {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
}
/* 等待确认 */
.transfer-waiting {
    text-align: center;
    padding: 40px 20px;
}
.waiting-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.transfer-waiting h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 12px;
}
.transfer-waiting p {
    color: #666;
    font-size: 14px;
    margin: 6px 0;
}
.waiting-tip {
    color: #4A8DB7 !important;
}
.btn-close-modal {
    margin-top: 20px;
    background: #4A8DB7;
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
}

/* === 移动端适配 === */
@media (max-width: 768px) {
    .nordic-product-card {
        max-width: 100%;
    }
    .checkout-modal {
        width: 95%;
        padding: 18px;
    }
    .qrcode-image {
        width: 180px;
        height: 180px;
    }
    .qrcode-amount {
        font-size: 24px;
    }
}

/* ============================================
   商城展示页面样式
   ============================================ */

/* 页面容器 */
.shop-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #F0F5FA;
    min-height: calc(100vh - 200px);
}

/* 页面标题区 */
.shop-page-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 20px 0;
}

.shop-page-title {
    font-size: 36px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
    font-family: 'Playfair Display', serif;
}

.shop-page-desc {
    font-size: 16px;
    color: #888;
    margin: 0;
}

/* 商品网格 - IE11 兼容方案 */
.shop-products-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -12px;
}

/* Grid 布局（现代浏览器） */
@supports (display: grid) {
    .shop-products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        margin: 0;
    }
}

/* Flexbox 回退方案（IE11） */
@supports not (display: grid) {
    .shop-product-card {
        width: calc(25% - 24px);
        margin: 12px;
    }
}

/* 商品卡片 */
.shop-product-card {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    -webkit-transition: -webkit-transform 0.2s, box-shadow 0.2s;
    transition: transform 0.2s, box-shadow 0.2s;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.shop-product-card:hover {
    -webkit-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 商品图片区域 */
.shop-product-card .product-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 比例 */
    overflow: hidden;
    background: #F6F9FC;
}

.shop-product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-transition: -webkit-transform 0.3s;
    transition: transform 0.3s;
}

.shop-product-card:hover .product-image img {
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

/* 图片占位符 */
.product-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #4A8DB7;
    font-size: 48px;
}

/* 商品类型标签 */
.shop-product-card .product-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: rgba(74, 141, 183, 0.95);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* 售罄遮罩 */
.product-sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/* 商品信息区 */
.shop-product-card .product-info {
    padding: 20px;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.shop-product-card .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-product-card .product-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

/* 商品底部区域 */
.shop-product-card .product-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(74, 141, 183, 0.1);
}

.shop-product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: #4A8DB7;
}

.shop-product-card .product-diary-link {
    font-size: 13px;
    color: #2E6E8F;
    text-decoration: none;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 4px;
    -webkit-transition: color 0.2s;
    transition: color 0.2s;
}

.shop-product-card .product-diary-link:hover {
    color: #4A8DB7;
}

.shop-product-card .product-diary-link i {
    font-size: 11px;
}

/* 空状态 */
.shop-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #888;
}

@supports not (display: grid) {
    .shop-empty-state {
        width: 100%;
    }
}

.shop-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(74, 141, 183, 0.1);
    border-radius: 50%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #4A8DB7;
    font-size: 32px;
}

.shop-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.shop-empty-state p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* 分页导航 */
.shop-pagination {
    margin-top: 48px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.shop-pagination .page-numbers {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid rgba(74, 141, 183, 0.2);
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.shop-pagination .page-numbers:hover {
    background: rgba(74, 141, 183, 0.1);
    border-color: #4A8DB7;
    color: #4A8DB7;
}

.shop-pagination .page-numbers.current {
    background: #4A8DB7;
    border-color: #4A8DB7;
    color: #fff;
}

.shop-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 1024px) {
    @supports (display: grid) {
        .shop-products-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }
    }
    
    @supports not (display: grid) {
        .shop-product-card {
            width: calc(33.333% - 20px);
            margin: 10px;
        }
    }
}

@media (max-width: 768px) {
    .shop-page-container {
        padding: 24px 16px;
    }
    
    .shop-page-title {
        font-size: 28px;
    }
    
    .shop-page-desc {
        font-size: 14px;
    }
    
    @supports (display: grid) {
        .shop-products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
    }
    
    @supports not (display: grid) {
        .shop-product-card {
            width: calc(50% - 12px);
            margin: 6px;
        }
    }
    
    .shop-product-card .product-info {
        padding: 12px;
    }
    
    .shop-product-card .product-name {
        font-size: 14px;
    }
    
    .shop-product-card .product-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
        margin-bottom: 12px;
    }
    
    .shop-product-card .product-price {
        font-size: 16px;
    }
    
    .shop-product-card .product-diary-link {
        font-size: 12px;
    }
    
    .shop-pagination {
        margin-top: 32px;
    }
    
    .shop-pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .shop-page-header {
        margin-bottom: 32px;
    }
    
    .shop-page-title {
        font-size: 24px;
    }
}
