/* ============================================
   加纳COD独立站 - 前台样式
   300GHC任选3件 - 货到付款
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #1d3557;
    --accent: #f4a261;
    --success: #2a9d8f;
    --warning: #e9c46a;
    --light: #f8f9fa;
    --gray: #6c757d;
    --white: #ffffff;
    --dark: #212529;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ---------- 顶部导航 ---------- */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}
.logo span { color: var(--secondary); }

.search-box {
    flex: 1;
    max-width: 400px;
    display: flex;
}
.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
}
.search-box button:hover { background: var(--primary-dark); }

.cart-icon-wrap {
    position: relative;
    cursor: pointer;
}
.cart-icon {
    font-size: 28px;
    color: var(--secondary);
}
.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ---------- Banner ---------- */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
    padding: 40px 20px;
}
.banner h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}
.banner .price-tag {
    font-size: 48px;
    font-weight: 900;
    color: var(--warning);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.banner .banner-slogan {
    font-size: 24px;
    font-weight: 800;
    margin-top: 12px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    color: #ffd93d;                 /* 副标语：黄色 */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.25);
}
.banner .banner-slogan .hl {
    display: inline-block;
    font-size: 1.55em;
    line-height: 1;
    color: #fff3a0;                 /* 高亮段：更亮的黄，保留层次 */
    font-weight: 900;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    padding: 0 4px;
}
.banner .cod-badge {
    display: inline-block;
    background: var(--white);
    color: var(--primary);
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: 700;
    margin-top: 16px;
    font-size: 14px;
}

/* ---------- 分类筛选 ---------- */
.category-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.category-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.category-item {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.category-item:hover { color: var(--primary); }
.category-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ---------- 产品网格 ---------- */
.product-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary);
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.product-img {
    width: 100%;
    height: auto;   /* 覆盖 HTML width/height 属性的表示提示，否则 height=400px 生效、aspect-ratio 失效 */
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--light);
}
.product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-tag {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}
.btn-add-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: auto;
}
.btn-add-cart:hover { background: var(--primary-dark); }
.btn-add-cart:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

/* ---------- 迷你购物车 ---------- */
.mini-cart-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}
.mini-cart-overlay.show { display: block; }
.mini-cart {
    position: fixed;
    top: 0; right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    z-index: 201;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,0.15);
}
.mini-cart.show { right: 0; }
.mini-cart-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mini-cart-header h3 { font-size: 18px; }
.mini-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
}
.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.mini-cart-empty {
    text-align: center;
    color: var(--gray);
    padding: 60px 20px;
}
.mini-cart-empty .icon { font-size: 48px; margin-bottom: 12px; }
.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}
.cart-item-remove {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.mini-cart-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border);
    background: var(--light);
}
.cart-tip {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
    text-align: center;
}
.cart-tip strong { color: var(--primary); }
.btn-checkout {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-checkout:hover:not(:disabled) { background: var(--primary-dark); }
.btn-checkout:disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---------- 结算弹窗 ---------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
}
.modal-header h3 { font-size: 20px; color: var(--secondary); }
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--light);
}

.checkout-items {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.checkout-item {
    width: calc(33.333% - 8px);
    text-align: center;
    position: relative;
}
.checkout-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
}
.checkout-item-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.checkout-item-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}
.form-group label .required { color: var(--primary); }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { margin-bottom: 8px; background: #fff; cursor: pointer; }

.order-summary {
    background: #fff8e1;
    border: 2px solid var(--warning);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-summary .total {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}
.order-summary .cod {
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
}

.btn-submit-order {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.2s;
}
.btn-submit-order:hover { background: var(--primary-dark); }
.btn-submit-order:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

/* ---------- 产品详情页 ---------- */
.product-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
}
.breadcrumb {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 20px;
}
.breadcrumb a:hover { color: var(--primary); }
.detail-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.detail-gallery,
.detail-info {
    min-width: 0;
}
/* Gallery: sliding viewport + track + slides (padding-top hack = guaranteed height) */
.gallery-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}
.gallery-viewport::before {
    content: '';
    display: block;
    padding-top: 100%; /* 1:1 height, no aspect-ratio/height:0 pitfalls */
}
.gallery-track {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    will-change: transform;
}
.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}
.gallery-slide .main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Gallery: arrows + indicator (desktop shows arrows on hover, mobile hides them) */
.main-img-wrap {
    position: relative;
    margin-bottom: 12px;
}
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 28px;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
}
.gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.main-img-wrap:hover .gallery-arrow {
    opacity: 1;
}
.gallery-indicator {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 2;
}
/* Mobile: no hover concept → hide arrows, keep swipe + autoplay */
@media (max-width: 768px) {
    .gallery-arrow { display: none; }
    .gallery-indicator { bottom: 8px; right: 8px; }
}
.thumb-list {
    display: flex;
    gap: 8px;
}
.thumb-item {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}
.thumb-item:hover, .thumb-item.active {
    border-color: var(--primary);
    opacity: 1;
    opacity: 1;
}
.detail-info h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--secondary);
}
.activity-banner {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid var(--warning);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.activity-banner .title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}
.activity-banner .desc {
    font-size: 13px;
    color: #856404;
    margin-top: 4px;
}
.detail-desc {
    font-size: 15px;
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 24px;
    /* 后台文本框里敲的回车要保留，否则会被折叠成一个空格 */
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* SKU 选择器 */
.sku-selector {
    margin-bottom: 20px;
}
.sku-selector .sku-label {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 600;
}
.sku-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sku-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    min-width: 90px;
}
.sku-card:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}
.sku-card.selected {
    border-color: var(--primary);
    background: #e3f2fd;
}
.sku-card img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.sku-card .sku-thumb-placeholder {
    width: 32px;
    height: 32px;
    background: #eee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.sku-card .sku-info { font-size: 12px; }
.sku-card .sku-name { font-weight: 600; color: var(--secondary); }
.sku-card .sku-desc { color: #888; font-size: 11px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sku-sku-code { font-size: 10px; color: #aaa; }

/* ---------- SKU Select Modal ---------- */
.sku-select-modal {
    max-width: 480px;
    width: 92%;
}
.sku-select-product {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.sku-select-product > img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f3f3f3;
}
.sku-select-product-info { min-width: 0; }
.sku-select-product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}
.sku-select-product-meta {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}
.sku-select-desc {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
.sku-select-footer {
    display: flex;
    gap: 12px;
}
.sku-select-footer .btn-secondary,
.sku-select-footer .btn-primary {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.sku-select-footer .btn-secondary {
    background: var(--light);
    color: var(--secondary);
    border: 1px solid var(--border);
}
.sku-select-footer .btn-secondary:hover {
    background: #e9e9e9;
}
.sku-select-footer .btn-primary {
    background: var(--primary);
    color: var(--white);
}
.sku-select-footer .btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}
.sku-select-footer .btn-primary:disabled {
    background: #c9c9c9;
    cursor: not-allowed;
}
.btn-detail-add {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
}
.btn-detail-add:hover { background: var(--primary-dark); }

/* ---------- 成功页 ---------- */
.success-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: var(--white);
}
.success-page h1 {
    font-size: 28px;
    color: var(--success);
    margin-bottom: 8px;
}
.success-page .order-no {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 24px;
}
.success-page .order-no strong { color: var(--primary); font-size: 18px; }
/* 成功页：下单商品快照（服务端返回） */
.success-items {
    text-align: left;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 14px;
    margin-bottom: 20px;
}
.success-items .si-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.success-items .si-row:last-of-type { border-bottom: none; }
.success-items .si-img {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--light);
}
.success-items .si-main { flex: 1; min-width: 0; }
.success-items .si-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.success-items .si-meta { font-size: 12px; color: var(--gray); margin-top: 2px; font-weight: 400; }
.success-items .si-amt { font-size: 14px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.success-items .si-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-top: 1px solid var(--border);
}
.success-items .si-total strong { color: var(--primary); font-size: 16px; }
.customer-info {
    text-align: left;
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.customer-info h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--secondary);
}
.customer-info p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--dark);
}
.customer-info p strong { color: var(--gray); display: inline-block; width: 80px; }
.btn-home {
    display: inline-block;
    padding: 14px 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}
.btn-home:hover { background: var(--primary-dark); }

/* ---------- Toast提示 ---------- */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--primary); }

/* ---------- 页脚 ---------- */
.footer {
    background: var(--secondary);
    color: var(--white);
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    font-size: 14px;
    opacity: 0.9;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 14px;
}
.footer-links a {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 36px;
    padding: 0 12px 8px;
}
.page-link,
.page-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: var(--white);
    color: var(--secondary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    transition: all 0.2s ease;
    user-select: none;
}
.page-link {
    min-width: 40px;
    padding: 0 6px;
    border-radius: 50%;
}
.page-nav {
    padding: 0 18px;
    border-radius: 20px;
    gap: 4px;
}
.page-nav:hover:not(.disabled),
.page-link:hover:not(.disabled):not(.active) {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.page-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
    cursor: default;
    transform: none;
}
.page-link.disabled,
.page-nav.disabled {
    opacity: 0.45;
    background: var(--light);
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
    .page-link,
    .page-nav { height: 36px; font-size: 13px; }
    .page-link { min-width: 36px; }
    .page-nav { padding: 0 14px; }
}
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
    .banner h1 { font-size: 26px; }
    .banner .price-tag { font-size: 36px; }
    .banner .banner-slogan { font-size: 18px; }
    .banner .cod-badge { margin-top: 12px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-section { padding: 16px 12px; }
    .mini-cart { width: 100%; right: -100%; }
    .checkout-item { width: calc(50% - 6px); }
    .detail-wrap { padding: 16px; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-name { font-size: 13px; }
    .btn-add-cart { padding: 8px; font-size: 13px; }
}

/* ---------- First-visit tutorial modal ---------- */
.tutorial-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tutorial-overlay.show { display: flex; }
.tutorial-modal { max-width: 480px; }
.tutorial-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.tutorial-progress span { width: 10px; height: 10px; border-radius: 50%; background: #ddd; transition: background .2s; }
.tutorial-progress span.active { background: var(--primary); }
.tutorial-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; }
.tutorial-content h4 { font-size: 18px; color: var(--secondary); margin-bottom: 8px; }
.tutorial-content p { font-size: 15px; line-height: 1.6; color: #444; margin: 0; }
.tutorial-footer { display: flex; justify-content: space-between; align-items: center; }
.tutorial-nav { display: flex; gap: 10px; }
.btn-tutorial-skip { background: none; border: none; color: var(--gray); cursor: pointer; font-size: 14px; padding: 8px; }
.btn-tutorial-prev { background: #eee; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-tutorial-next { background: var(--primary); color: #fff; border: none; padding: 10px 22px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-tutorial-prev:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
    .tutorial-modal { max-width: 92vw; }
}
/* ---------- M3：单品直购（价格/数量/Buy Now） ---------- */
.price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.price-now { font-size: 30px; font-weight: 800; color: var(--primary); }
.price-orig { font-size: 16px; color: var(--gray); text-decoration: line-through; }
.price-save { display: inline-block; background: #ffe8e8; color: var(--primary-dark); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty-row .qty-label { font-size: 14px; font-weight: 600; color: var(--dark); }
.qty-stepper { display: inline-flex; align-items: center; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-stepper button { width: 38px; height: 40px; border: none; background: var(--light); font-size: 18px; font-weight: 700; color: var(--secondary); }
.qty-stepper button:hover { background: #eceff3; }
.qty-stepper input { width: 56px; height: 40px; border: none; border-left: 2px solid var(--border); border-right: 2px solid var(--border); text-align: center; font-size: 15px; font-weight: 700; outline: none; }
.qty-hint { font-size: 12px; color: var(--gray); }

.checkout-line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.checkout-line .lbl { color: var(--gray); }
.checkout-line .val { font-weight: 600; }
.checkout-line.total .val { font-size: 20px; font-weight: 800; color: var(--primary); }

.sku-qty-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; }
.btn-checkout-item { display:flex; gap:12px; align-items:center; background:var(--light); border-radius:8px; padding:10px; margin-bottom:10px; }
.btn-checkout-item img { width:56px; height:56px; object-fit:cover; border-radius:6px; }
.btn-checkout-item .nm { font-size:14px; font-weight:600; line-height:1.3; }
.btn-checkout-item .meta { font-size:12px; color:var(--gray); margin-top:2px; }
.form-error { color: var(--primary); font-size: 13px; min-height: 18px; margin: 8px 0; }

/* ============================================================
   M5 视觉升级 + 移动端强化（加载在最后，覆盖上面同名规则）
   ============================================================ */

/* ---- 头部 ---- */
.header { background: #fff; box-shadow: 0 1px 6px rgba(20,40,80,.08); position: sticky; top: 0; z-index: 90; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-box { flex: 1; max-width: 420px; display: flex; }
.search-box input { flex: 1; min-width: 0; border: 2px solid var(--border); border-right: none; border-radius: 8px 0 0 8px; padding: 9px 12px; }
.search-box input:focus { border-color: var(--primary); }
.search-box button { border: none; background: var(--primary); color: #fff; padding: 0 18px; border-radius: 0 8px 8px 0; font-weight: 700; cursor: pointer; }

/* ---- 横幅升级：渐变 + 装饰 ---- */
.banner {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, var(--primary-dark, #1d3557) 0%, var(--primary, #2b6cb0) 55%, #3a7bd5 100%);
  color: #fff; padding: 52px 20px 58px;
}
.banner::before, .banner::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.banner::before { width: 260px; height: 260px; top: -120px; right: -60px; }
.banner::after  { width: 180px; height: 180px; bottom: -90px; left: -50px; }
.banner h1 { position: relative; z-index: 1; font-size: 34px; font-weight: 900; letter-spacing: .5px; margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.18); }
.banner-slogan { position: relative; z-index: 1; font-size: 17px; opacity: .95; margin-bottom: 14px; }
.banner-slogan .hl { color: #ffd166; font-weight: 800; }
.cod-badge {
  position: relative; z-index: 1; display: inline-block;
  background: rgba(255,255,255,.16); backdrop-filter: blur(2px);
  border: 1px solid rgba(255,255,255,.35);
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

/* ---- 分类条：桌面居中，移动横滑 ---- */
.category-bar { background: #fff; box-shadow: 0 1px 4px rgba(20,40,80,.06); position: sticky; top: 54px; z-index: 80; }
.category-inner { max-width: 1100px; margin: 0 auto; padding: 0 12px; display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-inner::-webkit-scrollbar { display: none; }
.category-item { flex-shrink: 0; padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--secondary); border-bottom: 3px solid transparent; }

/* ---- 商品卡升级 ---- */
.product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(20,40,80,.08);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(20,40,80,.14); }
.product-img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: var(--light); display: block; }
.product-info { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 40px; }
.btn-add-cart {
  margin-top: auto; width: 100%; border: none; background: var(--primary); color: #fff;
  padding: 10px 0; border-radius: 8px; font-size: 14px; font-weight: 800; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-add-cart:hover { background: var(--primary-dark, #1d4e8f); }
.btn-add-cart:active { transform: scale(.97); }
.section-title { font-size: 20px; font-weight: 800; color: var(--dark); margin: 22px 0 14px; }

/* ---- 结算页 ---- */
.checkout-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.checkout-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(20,40,80,.08); }
.checkout-card h2 { font-size: 17px; color: var(--dark); margin-bottom: 14px; }

/* ---- 页脚 ---- */
.footer { background: #1d3557; color: rgba(255,255,255,.85); margin-top: 40px; padding: 26px 16px 22px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 12px; }
.footer-links a { color: rgba(255,255,255,.85); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer p { font-size: 12px; color: rgba(255,255,255,.55); }

/* ---- SKU 弹窗 ---- */
.modal-overlay { z-index: 300; }
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sku-option { border: 2px solid var(--border); border-radius: 10px; padding: 8px; text-align: center; cursor: pointer; background: #fff; }
.sku-option.selected { border-color: var(--primary); background: #eef5fd; }

/* ==================== 移动端 ==================== */
@media (max-width: 992px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .banner h1 { font-size: 27px; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; padding: 10px 12px; }
  .header .logo { font-size: 18px; }
  .search-box { order: 3; max-width: none; flex-basis: 100%; }
  .search-box input { padding: 8px 10px; }
  .banner { padding: 34px 16px 38px; }
  .banner h1 { font-size: 22px; }
  .banner-slogan { font-size: 14px; }
  .cod-badge { font-size: 12px; padding: 7px 14px; }
  .category-bar { top: 100px; }
  .category-item { padding: 10px 13px; font-size: 12.5px; }
  .product-section { padding: 0 12px; }
  .checkout-wrap { grid-template-columns: 1fr; }
  .checkout-card { padding: 16px; }
  .footer { padding: 20px 12px 16px; }
  .footer-links { gap: 6px 14px; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-info { padding: 10px; }
  .product-name { font-size: 13px; min-height: 36px; }
  .price-now { font-size: 16px !important; }
  .banner h1 { font-size: 20px; }
  html, body { overflow-x: hidden; }
}

/* ---------- 商品详情：相关推荐 ---------- */
.related-section {
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}
.related-section .section-title { margin: 0 0 16px; font-size: 20px; }
.related-section .product-card .product-info { padding: 12px; }
.related-section .product-name {
    font-size: 14px; font-weight: 600; color: var(--dark); line-height: 1.4;
    margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-section .btn-add-cart {
    width: 100%; padding: 9px 10px; border: none; border-radius: 6px; cursor: pointer;
    background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
    transition: background .15s;
}
.related-section .btn-add-cart:hover { background: var(--primary-dark); }

@media (max-width: 768px) {
    .related-section { margin-top: 30px; padding-top: 18px; }
    .related-section .section-title { font-size: 17px; }
}

/* ---------- 详情页：右上角返回按钮 ---------- */
.header-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 999px;
    background: #fff; color: var(--dark); font-size: 14px; font-weight: 600;
    line-height: 1; white-space: nowrap; cursor: pointer;
    transition: all .15s ease;
}
.header-back:hover { border-color: var(--primary); color: var(--primary); background: #fff5f6; }
.header-back:active { transform: translateY(1px); }
.header-back .header-back-ico { font-size: 16px; line-height: 1; }

@media (max-width: 480px) {
    .header-back { padding: 7px 11px; font-size: 13px; gap: 4px; }
    .header-back .header-back-ico { font-size: 15px; }
}

/* ---------- 政策页内容排版（对齐原项目 page.php） ---------- */
.page-content { font-size: 15px; line-height: 1.85; color: #333; }
.page-content h2 {
    font-size: 1.25rem; font-weight: 700; color: var(--primary-dark, #c1121f);
    margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid #f1f1f1;
}
.page-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--secondary, #1d3557); margin: 22px 0 10px; }
.page-content p { margin: 0 0 14px; }
.page-content ul, .page-content ol { margin: 0 0 14px; padding-left: 24px; }
.page-content li { margin-bottom: 6px; }
.page-content a { color: var(--primary); text-decoration: underline; }
.page-content a:hover { color: var(--primary-dark); }
.page-content strong, .page-content b { color: #111; }
.page-content blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--primary); background: #f8f9fa; color: #555; }
.page-content hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

@media (max-width: 768px) {
    .page-content { font-size: 14px; line-height: 1.8; }
    .page-content h2 { font-size: 1.1rem; margin-top: 22px; }
}

/* ---------- 图集：点击放大灯箱 ---------- */
.main-img-wrap .gallery-slide .main-img { cursor: zoom-in; }
.gallery-zoom-hint {
    position: absolute; left: 12px; bottom: 12px; z-index: 2;
    background: rgba(0,0,0,.5); color: #fff; font-size: 11px;
    padding: 4px 10px; border-radius: 12px; pointer-events: none;
}
.lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(8,12,20,.95); display: none; overflow: hidden; }
.lightbox.show { display: block; }
.lightbox .lb-stage {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 28px;
}
.lightbox img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    user-select: none; -webkit-user-drag: none; cursor: zoom-in;
}
.lightbox.zoomed .lb-stage { display: block; padding: 0; overflow: auto; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.lightbox.zoomed img { width: 200%; max-width: none; max-height: none; cursor: zoom-out; }
.lightbox .lb-btn {
    position: absolute; z-index: 3; border: none; cursor: pointer;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1;
}
.lightbox .lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 16px; right: 16px; font-size: 24px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-counter {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 3;
    background: rgba(0,0,0,.45); color: #fff; font-size: 13px; padding: 4px 12px; border-radius: 12px;
}
.lb-tip {
    position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 3;
    color: rgba(255,255,255,.6); font-size: 12px; white-space: nowrap;
}

/* ---------- 商品卡：信息区高度固定，避免各店卡片高低不齐 ---------- */
.product-card .product-name {
    height: 2.8em; min-height: 0; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price-row {
    height: 26px; margin-bottom: 10px !important;
    align-items: center; flex-wrap: nowrap; overflow: hidden;
}
.product-card .price-row .price-now,
.product-card .price-row .price-orig { white-space: nowrap; line-height: 26px; }
.product-card .price-row .price-now { overflow: hidden; text-overflow: ellipsis; }
.product-card .btn-add-cart {
    height: 40px; padding: 0;
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 768px) {
    .gallery-zoom-hint { left: 8px; bottom: 8px; font-size: 10px; padding: 3px 8px; }
    .lightbox .lb-prev, .lightbox .lb-next { display: none; }
    .lightbox .lb-stage { padding: 12px; }
    .lb-tip { font-size: 11px; bottom: 46px; }
    .lightbox.zoomed img { width: 260%; }
}

/* 缩略图过多时横向滑动，不换行挤压 */
.thumb-list { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.thumb-item { flex: 0 0 auto; }

/* 灯箱切图：旧图滑出层 + 新图滑入（与详情页图集同节奏 .3s） */
.lightbox img { will-change: transform, opacity; }
.lightbox .lb-ghost {
    position: absolute; z-index: 2; pointer-events: none;
    max-width: none; max-height: none; object-fit: contain;
}

/* 滚动加载：底部状态 / 加载更多按钮 */
.load-status {
    display: inline-block;
    color: var(--gray);
    font-size: 13px;
    padding: 10px 0;
}
