/* XunhuPay State-of-the-Art Storefront Layout - All spacings strictly aligned at 12px */

.xunhupay-store-shell {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    padding: 0; /* Make container completely flat and borderless */
    background: transparent;
    border-radius: 0;
    border: none;
}

/* 1. Centered Minimalist Tab Bar - Strictly 12px gaps, bottom line only */
.zui-store-tabs,
.zui-store-tabs .nav-item,
.zui-store-tabs .nav-item .nav-link,
.zui-store-tabs .nav-item .nav-link.active {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.zui-store-tabs {
    display: flex !important;
    justify-content: center !important; /* Centered */
    gap: 12px !important; /* Strictly 12px gap between items */
    border-bottom: 1px solid #e2e8f0 !important; /* ONLY bottom border line */
    margin: 0 auto 24px auto !important;
    padding: 0 0 4px 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.zui-store-tabs .nav-item {
    margin: 0 !important;
    padding: 0 !important;
}

.zui-store-tabs .nav-item .nav-link {
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 8px 4px !important; /* Tight padding, spacing is handled by gap */
    border-bottom: 2px solid transparent !important; /* Hidden bottom border */
    transition: all 0.2s ease-in-out !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
}

.zui-store-tabs .nav-item .nav-link i {
    font-size: 15px;
    margin-right: 6px;
}

.zui-store-tabs .nav-item .nav-link:hover {
    color: #10b981 !important;
}

.zui-store-tabs .nav-item .nav-link.active {
    color: #10b981 !important; /* Active text color */
    border-bottom: 2px solid #10b981 !important; /* Strictly active bottom border line */
}

.xunhupay-store-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important; /* Left-align the card list flex layout */
    gap: 12px !important; /* Gaps strictly 12px */
    margin-top: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.store-card-item {
    width: 320px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* 3. Dribbble/Envato Premium Marketplace Card Design */
/* 3. Dribbble/Envato Premium Marketplace Card Design */
.store-card-premium {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.store-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    border-color: #cbd5e1;
}

/* Aspect-ratio limited cover wrap (4:3 Landscape - Bulletproof padding-top method) */
.store-card-cover-wrap {
    position: relative !important;
    width: 100% !important;
    padding-top: 75% !important; /* 4:3 ratio: height is 75% of width */
    height: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.store-card-cover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Fill container completely */
    padding: 0 !important; /* Do not add padding */
    box-sizing: border-box !important;
    transition: transform 0.5s ease !important;
    display: block !important;
}

.store-card-premium:hover .store-card-cover-img {
    transform: scale(1.04); /* Subtle smooth zoom on hover */
}

/* Floating Price Badge on Top Left */
.store-card-price-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #f43f5e !important; /* Bold Coral Red */
    color: #ffffff !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 8px rgba(244, 63, 94, 0.3);
    z-index: 10;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
}

.store-card-price-badge.is-free {
    background: #10b981 !important; /* Emerald Green */
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.store-card-price-badge .store-card-currency {
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-right: 1px !important;
}

.store-card-price-badge .store-card-price-num {
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* Floating Royal Blue Badge on Top Right */
.store-card-premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #1e40af !important; /* Royal Blue */
    color: #ffffff !important;
    padding: 4px 8px !important;
    border-radius: 6px !important; /* Rectangular with 6px rounding */
    font-size: 11px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
    z-index: 10;
    line-height: 1 !important;
    letter-spacing: 0.5px !important;
}

/* Card Body Content */
.store-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
    justify-content: space-between;
}

.store-card-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.4 !important;
    text-align: left !important; /* Left-aligned */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.store-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.store-card-price-row {
    display: flex;
    align-items: baseline;
    font-weight: 800;
    color: #f43f5e !important; /* Bold Coral Red */
}

.store-card-currency {
    font-size: 12px !important;
    margin-right: 2px !important;
    font-weight: 700 !important;
}

.store-card-price-num {
    font-size: 19px !important;
    font-weight: 800 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.store-card-price-free {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #047857 !important;
    background: #ecfdf5 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    border: 1px solid #a7f3d0 !important;
}

.store-card-actions-row {
    display: flex;
    gap: 12px !important; /* Spacing unified 12px */
    align-items: center;
}

/* ==========================================================================
   Unified Grid Action Buttons Structure (Aesthetics and Perfect Alignment)
   ========================================================================== */
.store-card-actions-row > a,
.store-card-actions-row > button {
    flex: 1 1 0% !important;
    width: 0 !important; /* Forces equal widths for flex items */
    height: 34px !important; /* Fixed total height */
    min-height: 34px !important; /* Explicitly override theme min-height */
    max-height: 34px !important; /* Explicitly force height limit */
    min-width: 0 !important;
    max-width: none !important;
    line-height: 32px !important; /* Perfectly centered text vertically */
    padding: 0 4px !important; /* Keep small side margins, eliminate top/bottom margins */
    margin: 0 !important;
    box-sizing: border-box !important; /* Forces height to strictly stay at 34px */
    border-radius: 6px !important; /* Unified curves */
    font-size: 12px !important;
    font-weight: 700 !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid transparent !important; /* Base border placeholder to align physics */
    outline: none !important;
}

/* 1. Preview Button: Sophisticated Light Slate Grey */
.store-card-btn-preview {
    background: #f8fafc !important; /* Sleek slate white background */
    color: #475569 !important; /* Deep slate grey text */
    border: 1px solid #e2e8f0 !important; /* Unified grey border */
}

.store-card-btn-preview:hover {
    background: #e2e8f0 !important; /* Darker slate grey */
    color: #0f172a !important; /* Almost black */
    border-color: #cbd5e1 !important;
}

/* 2. Details Button: Clean Mint Emerald Green */
.store-card-btn-details {
    background: #ecfdf5 !important; /* Mint emerald background */
    color: #047857 !important; /* Forest green text */
    border: 1px solid #d1fae5 !important; /* Light green border */
}

.store-card-btn-details:hover {
    background: #d1fae5 !important; /* Rich mint */
    color: #065f46 !important; /* Deep forest green */
    border-color: #a7f3d0 !important;
}

/* 3. Buy Button: Premium Rose Gradient */
.store-card-btn-pay-premium {
    background: linear-gradient(135deg, #ff4e7c 0%, #f43f5e 100%) !important; /* Royal Rose Gradient */
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.15) !important; /* Soft premium shadow */
}

.store-card-btn-pay-premium:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    transform: translateY(-1.5px) !important; /* Elevating hover effect */
    box-shadow: 0 6px 14px rgba(244, 63, 94, 0.3) !important; /* Expanding shadow */
}

/* 4. Download/Paid Button: Vibrant Cyan Gradient */
.store-card-btn-pay-premium.store-card-btn-paid {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important; /* Premium Cyan Blue Gradient */
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.15) !important;
}

.store-card-btn-pay-premium.store-card-btn-paid:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 14px rgba(14, 165, 233, 0.3) !important;
}


/* 强力自愈级尊贵无依赖弹窗结构样式 */
#xunhupay_store_modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65); /* 柔和暗色半透背景 */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

#xunhupay_store_modal.show {
    display: flex !important;
}

.xunhupay-modal-container {
    background: #ffffff;
    border-radius: 6px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    animation: xunhuModalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes xunhuModalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.xunhupay-modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.xunhupay-modal-title {
    font-weight: 800;
    font-size: 15px;
    color: #0f172a;
    margin: 0;
}

.xunhupay-modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    margin: 0;
}
.xunhupay-modal-close-btn:hover {
    color: #ef4444;
}

.xunhupay-modal-body {
    padding: 12px !important;
    text-align: center;
}

.xunhupay-modal-pay-channel {
    display: flex;
    justify-content: center;
    gap: 12px; /* 间距 12px */
    margin-top: 16px;
    margin-bottom: 12px;
}

.channel-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px; /* 内边距 12px */
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 12px;
}
.channel-btn i {
    font-size: 24px;
    margin-bottom: 6px;
}
.channel-btn-wechat {
    color: #07c160;
}
.channel-btn-wechat:hover {
    border-color: #07c160;
    background-color: #ecfdf5;
}
.channel-btn-alipay {
    color: #1677ff;
}
.channel-btn-alipay:hover {
    border-color: #1677ff;
    background-color: #eff6ff;
}

/* 购买解锁成功面板 */
.xunhupay-success-box {
    text-align: left;
    margin-top: 12px;
}
.xunhupay-success-badge {
    background-color: #ecfdf5;
    color: #047857;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}
.xunhupay-success-pre {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 12px !important;
    font-family: monospace !important;
    font-size: 12px !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    margin: 0 0 12px 0 !important; /* 下边距 12px */
    color: #1e293b !important;
    max-height: 100px !important;
    overflow-y: auto !important;
}
.xunhupay-success-actions {
    display: flex;
    gap: 12px !important; /* 按钮间距 12px */
    margin-top: 12px !important;
}
.xunhupay-success-actions button,
.xunhupay-success-actions .btn {
    flex: 1 !important;
    height: 38px !important;
    line-height: 36px !important;
    padding: 0 16px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.2s ease-in-out !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    outline: none !important;
}

/* 一键复制内容 按钮样式 */
.xunhupay-success-actions .btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid #10b981 !important;
}
.xunhupay-success-actions .btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

/* 关闭窗口 按钮样式 */
.xunhupay-success-actions .btn-light {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
.xunhupay-success-actions .btn-light:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
}

/* ==========================================================================
   Storefront Scrolling & Layout Purity Cleanup
   ========================================================================== */

/* 1. Ensure body scrolling is active and functional under all circumstances */
body.xunhupay-store-page-active,
body.xunhupay-store-page-active html {
    overflow: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* 2. Hide all non-storefront elements in the content area for a pure, seamless look */
body.xunhupay-store-page-active .jcode-breadcrumbs,
body.xunhupay-store-page-active .single-post-header,
body.xunhupay-store-page-active .single-post-comments-wrap,
body.xunhupay-store-page-active .home-config-sidebar,
body.xunhupay-store-page-active .post-copyright-box,
body.xunhupay-store-page-active .post-actions-bar,
body.xunhupay-store-page-active .post-navigation-cards,
body.xunhupay-store-page-active .jcode-related-posts,
body.xunhupay-store-page-active #comments,
body.xunhupay-store-page-active .comments,
body.xunhupay-store-page-active .post-footer,
body.xunhupay-store-page-active .post-meta,
body.xunhupay-store-page-active .breadcrumb {
    display: none !important;
}

/* 3. Make layout full width when sidebar is hidden */
body.xunhupay-store-page-active .home-config-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* 4. Remove all card borders, background, padding, and box-shadows to blend seamlessly */
body.xunhupay-store-page-active .single-post-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* 5. Main storefront layout container and spacing adjustments (strict 12px gap from header) */
body.xunhupay-store-page-active .storefront-main {
    flex: 1 0 auto !important;
    min-height: calc(100vh - 57px) !important;
    background-color: var(--color-bg-soft) !important;
    margin: 0 !important;
    padding: 12px 0 24px 0 !important; /* 距离顶部导航栏高度严格为 12px */
    box-sizing: border-box !important;
}

body.xunhupay-store-page-active .storefront-main .container {
    width: min(calc(100% - (var(--page-gutter) * 2)), var(--content-width)) !important;
    margin-inline: auto !important;
    padding-top: 0 !important;
    padding-bottom: var(--space-6) !important;
    box-sizing: border-box !important;
}

/* Force storefront card grid top margin to 0 to align exactly 12px */
body.xunhupay-store-page-active .xunhupay-store-grid {
    margin-top: 0 !important;
}

