/**
 * Product Customizer - Customizer Page Styles
 */
.customizer-product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 覆盖主题的内容网格样式（仅在定制器页面内） */
.customizer-product-page .qodef-content-grid {
    padding-top: 15px !important;
    margin-top: 0 !important;
}

/* 隐藏定制器页面的主题页面标题 */
body:has(.customizer-product-page) .qodef-page-title {
    display: none;
}

/* 减少标题隐藏后的上边距 */
body:has(.customizer-product-page) #qodef-page-inner {
    padding-top: 10px !important;
}

/* 覆盖主题内容区域（仅在定制器页面内） */
.customizer-product-page .qodef-content {
    padding-top: 0 !important;
}

/* 重置 wishlist 按钮样式（仅在定制器页面内） */
.customizer-product-page .wishlist-btn,
.customizer-product-page .yith-wcwl-add-to-wishlist,
.customizer-product-page .add_to_wishlist,
.customizer-product-page .qodef-svg--heart,
.customizer-product-page .wishlist-btn *,
.customizer-product-page .yith-wcwl-add-to-wishlist *,
.customizer-product-page .add_to_wishlist *,
.customizer-product-page .qodef-svg--heart * {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    height: auto !important;
    padding: initial !important;
    margin: initial !important;
    font-size: inherit !important;
    font-weight: normal !important;
    display: inline !important;
    flex: none !important;
    justify-content: initial !important;
    align-items: initial !important;
    gap: initial !important;
    border-radius: initial !important;
    background: none !important;
    border: none !important;
    color: inherit !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transform: none !important;
}

/* 主体布局 */
.customizer-container {
    display: flex !important;
    gap: 30px !important;
    align-items: flex-start !important;
    flex-direction: row !important;
}

/* 左侧预览区域 */
.preview-container {
    width: 50% !important;
    min-width: 480px;
    position: relative;
}
.preview-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e8e8e8;
}
.preview-canvas {
    width: 100%;
    height: 550px;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    position: relative !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-canvas .layer-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.preview-canvas .layer-image:hover {
    transform: scale(1.02);
}
.empty-preview-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #999;
    font-size: 18px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}
.preview-info {
    padding: 20px 25px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preview-info .progress {
    font-size: 14px;
    color: #666;
}
.preview-info .progress strong {
    color: #dc3232;
}
.preview-info .preview-price {
    font-size: 14px;
    color: #666;
}

/* 右侧配置区域 */
.config-container {
    width: 50% !important;
    min-width: 480px;
}

/* 部件导航 */
.part-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}
.nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}
.nav-btn:hover {
    border-color: #dc3232;
    color: #dc3232;
}
.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.nav-info {
    text-align: center;
}
.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav-hint {
    font-size: 13px;
    color: #999;
}
.nav-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}
.dot.active {
    background: #dc3232;
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.3);
}
.dot.selected {
    background: #2ecc71;
    position: relative;
}
/* 已选过产品的导航点（非当前激活的也会显示） */
.dot.has-selection {
    background: #2ecc71;
}
.dot.selected::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 8px;
    font-weight: bold;
}
.dot:hover {
    transform: scale(1.2);
    background: #999;
}

/* 导航点提示 */
.dot {
    position: relative;
    cursor: pointer;
}
.dot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    z-index: 100;
}
.dot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
}
.dot:hover .dot-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 产品网格 */
.products-grid-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 20px;
}
.products-grid-container {
    max-height: 440px;
    overflow-y: auto;
    margin-bottom: 15px;
}
.products-grid-container::-webkit-scrollbar {
    width: 6px;
}
.products-grid-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.products-grid-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.products-grid-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 10px;
}

/* 筛选条 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #f0f0f0;
}
.filter-search-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    width: 100%;
}
.filter-search {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.filter-search-input {
    width: 100%;
    height: 40px;
    line-height: 40px;
    padding: 0 36px 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    background: #fff;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    -webkit-appearance: none;
    appearance: none;
    vertical-align: middle;
}
.filter-search-input::placeholder {
    color: #aaa;
}
.filter-search-input:focus {
    border-color: var(--pc-accent, #dc3232);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.08), 0 1px 3px rgba(0,0,0,0.06);
}
.filter-search-input:-webkit-autofill,
.filter-search-input:-webkit-autofill:hover,
.filter-search-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #fff inset;
    -webkit-text-fill-color: #333;
}
.filter-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #e8e8e8;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s ease;
}
.filter-search-clear:hover {
    background: #d4d4d4;
    color: #555;
}
.filter-sort {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}
.filter-sort-select {
    height: 40px;
    line-height: 40px;
    padding: 0 32px 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    background: #fff url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    cursor: pointer;
    outline: none;
    max-width: 180px;
    min-width: 140px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    vertical-align: middle;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.filter-sort-select:focus {
    border-color: var(--pc-accent, #dc3232);
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.08);
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed #e8e8e8;
    margin-top: 4px;
    margin-left: 0;
}
.filter-chip-label {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    line-height: 1;
    padding: 2px 0;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid #e0e0e0;
    border-radius: 13px;
    font-size: 12px;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1;
}
.filter-chip:hover {
    border-color: #ff9500;
    color: #ff9500;
}
.filter-chip.active {
    background: #fff3e6;
    border-color: #ff9500;
    color: #ff9500;
}
.filter-chip.active:hover {
    background: #fff3e6;
}
.product-item {
    background: #fafafa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}
.product-item.selected {
    border-width: 1.5px;
    border-color: #ff9500;
    background: #fffef9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.08);
}
.product-item.selected::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #ff9500;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 产品容器过渡 */
#products-grid {
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 200px;
}
#products-grid.loaded {
    opacity: 1;
}

/* 骨架屏样式 */
.skeleton-card {
    background: #fafafa;
    border-radius: 10px;
    overflow: hidden;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}
@keyframes skeleton-loading {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}
.skeleton-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
.skeleton-text {
    height: 14px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 8px 10px;
}
.skeleton-text.short {
    width: 60%;
}
.skeleton-text.full {
    width: 80%;
}
.product-image-box {
    width: 100%;
    height: 120px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 眼睛预览按钮 */
.pc-eye-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 5;
    padding: 0;
}
.product-item:hover .pc-eye-btn,
.pc-eye-btn:focus-visible {
    opacity: 1;
}
.pc-eye-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}
/* 移动端始终显示眼睛按钮 */
@media (max-width: 768px) {
    .pc-eye-btn {
        opacity: 0.7;
        width: 26px;
        height: 26px;
    }
}
.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.product-item:hover .product-image {
    transform: scale(1.08);
}
.product-details {
    padding: 10px;
    text-align: center;
}
.product-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}
.product-price {
    font-size: 13px;
    font-weight: 600;
    color: #dc3232;
}
/* 分页加载 */
.load-more-container {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.load-more-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
}
.load-more-btn:hover {
    background: #fff;
    border-color: #dc3232;
    color: #dc3232;
}
.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.load-more-btn.hidden {
    display: none;
}
/* 按钮隐藏时整个容器也隐藏，避免残留分割线 */
.load-more-container:has(.load-more-btn.hidden) {
    display: none;
}

/* 底部操作区域 */
.bottom-section {
    margin-top: 25px;
}
.total-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.total-info {
    color: #fff;
}
.total-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 5px;
}
.total-price {
    font-size: 32px;
    font-weight: 700;
}
.add-cart-btn {
    background: linear-gradient(135deg, #ff9500 0%, #ff7700 100%);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}
.add-cart-btn:disabled {
    background: linear-gradient(135deg, #999999 0%, #666666 100%);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}
.add-cart-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}
.add-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

/* 进度条 */
.progress-bar {
    margin-top: 20px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3232 0%, #ff9500 100%);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 组装服务选项 */
.assembly-service-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 20px;
    display: none;
    animation: fadeInUp 0.4s ease-out;
}
.assembly-service-wrapper.show {
    display: block;
}
.assembly-service-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.assembly-checkbox-wrapper {
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}
.assembly-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.assembly-toggle {
    display: inline-block;
    width: 48px;
    height: 26px;
    background: #d1d5db;
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.assembly-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.assembly-checkbox:checked + .assembly-toggle {
    background: #ff9500;
}
.assembly-checkbox:checked + .assembly-toggle::after {
    transform: translateX(22px);
}
.assembly-toggle:hover {
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.12);
}
.assembly-checkbox:focus-visible + .assembly-toggle {
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.12);
}
.assembly-info {
    flex: 1;
}
.assembly-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.assembly-subtitle {
    font-size: 13px;
    color: #555;
    margin-top: -4px;
    margin-bottom: 8px;
    font-style: italic;
}
.assembly-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}
.assembly-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.assembly-price-label {
    font-size: 14px;
    color: #999;
}
.assembly-price {
    font-size: 20px;
    font-weight: 700;
    color: #dc3232;
}

/* 导航按钮悬停效果 */
.nav-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.nav-btn:not(:disabled) {
    transition: all 0.3s ease;
}

/* 通知消息动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.customizer-notification {
    animation: slideInRight 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .customizer-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .preview-container, .config-container {
        width: 100% !important;
        min-width: auto;
    }
    .preview-canvas {
        height: 450px !important;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .customizer-container {
        gap: 16px !important;
    }
    .preview-canvas {
        height: 450px !important;
    }
    .preview-box {
        border-radius: 10px;
    }
    .preview-info {
        padding: 12px 14px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        font-size: 13px;
    }
    .preview-info .progress,
    .preview-info .preview-price {
        font-size: 12px;
        width: auto;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .products-grid-wrapper {
        padding: 10px 10px 6px 10px;
        border-radius: 8px;
    }
    .products-grid-container {
        margin-bottom: 6px;
    }
    .filter-bar {
        padding: 12px;
        margin-bottom: 10px;
        gap: 10px;
    }
    .filter-search-input {
        height: 38px;
        line-height: 38px;
        font-size: 12px;
        padding: 0 34px 0 14px;
        border-radius: 19px;
    }
    .filter-sort-select {
        height: 38px;
        line-height: 38px;
        font-size: 12px;
        padding: 0 28px 0 12px;
        max-width: 140px;
        min-width: 120px;
        border-radius: 19px;
    }
    .filter-chip {
        height: 24px;
        font-size: 11px;
        padding: 0 8px;
        border-radius: 12px;
    }
    .part-navigation {
        padding: 8px 10px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    .nav-btn {
        width: 34px;
        height: 34px;
    }
    .nav-title {
        font-size: 14px;
    }
    .nav-hint {
        font-size: 11px;
        margin-top: 2px;
    }
    .nav-dots {
        margin-top: 4px;
        gap: 4px;
    }
    .dot {
        width: 6px;
        height: 6px;
    }
    .product-image-box {
        height: 90px;
    }
    .product-details {
        padding: 6px;
    }
    .product-name {
        font-size: 11px;
    }
    .product-price {
        font-size: 12px;
    }
    .total-card {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 14px;
        border-radius: 8px;
    }
    .total-price {
        font-size: 24px;
    }
    .total-label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .add-cart-btn {
        padding: 14px 30px;
        font-size: 14px;
    }
    .progress-bar {
        margin-top: 8px;
    }
    .bottom-section {
        margin-top: 12px;
    }
    .assembly-service-wrapper {
        margin-top: 12px;
        padding: 14px;
        border-radius: 8px;
    }
    .assembly-title {
        font-size: 15px;
    }
    .assembly-description {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .assembly-price {
        font-size: 18px;
    }

    /* 粘底 Bottom Section */
    .bottom-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        margin-top: 0;
        padding: 8px 10px;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    }
    .bottom-section .total-card {
        flex-direction: row;
        gap: 10px;
        text-align: left;
        padding: 10px 12px;
        border-radius: 8px;
    }
    .bottom-section .total-label {
        font-size: 11px;
        margin-bottom: 1px;
    }
    .bottom-section .total-price {
        font-size: 20px;
    }
    .bottom-section .add-cart-btn {
        padding: 12px 20px;
        font-size: 13px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    .config-container {
        padding-bottom: 100px;
    }
}

/* 移动端产品网格 - 左右滑动模式 */
@media (max-width: 768px) {
    .grid-mode-horizontal .products-grid-container {
        max-height: none;
        overflow-y: visible;
        position: relative;
    }
    .grid-mode-horizontal .products-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0 6px 8px 0;
        /* 末尾留白，让最后一个卡片露出一部分作为滑动提示 */
        padding-right: 40px;
    }
    /* 水平滚动条美化 */
    .grid-mode-horizontal .products-grid {
        scrollbar-width: thin;
        scrollbar-color: #ccc transparent;
    }
    .grid-mode-horizontal .products-grid::-webkit-scrollbar {
        height: 6px;
    }
    .grid-mode-horizontal .products-grid::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 3px;
    }
    .grid-mode-horizontal .products-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }
    .grid-mode-horizontal .products-grid::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    .grid-mode-horizontal .products-grid .product-item {
        flex: 0 0 160px;
        min-width: 160px;
        scroll-snap-align: start;
    }
    .grid-mode-horizontal .products-grid .product-image-box {
        height: 130px;
    }

    /* 右侧渐变淡出遮罩 — 暗示"右边还有内容" */
    .grid-mode-horizontal .products-grid-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 50px;
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.95));
        pointer-events: none;
        z-index: 2;
    }
}

/* ============================================
   页面布局变体 - 由后台设置控制
   ============================================ */

/* 纵向布局：预览在上，配置在下 */
.layout-direction-vertical .customizer-container {
    flex-direction: column !important;
}
.layout-direction-vertical .preview-container,
.layout-direction-vertical .config-container {
    width: 100% !important;
    min-width: auto;
}
.layout-direction-vertical .preview-canvas {
    height: 450px !important;
}

/* 横向布局 - 预览在右侧 */
.layout-direction-horizontal.layout-preview-right .customizer-container {
    flex-direction: row-reverse !important;
}

/* 导航隐藏时的图层标题栏 */
.layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}
.layer-header-info h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}
.layer-header-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #888;
}
.layer-header-nav {
    display: flex;
    gap: 8px;
}
.layer-header-nav .nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
}

/* ============================================
   风格预设变量驱动（由后台 layout_preset 控制）
   变量在 customizer-page.php 中注入到 .customizer-product-page
   ============================================ */

/* 全局 */
.customizer-product-page {
    font-family: var(--pc-font);
    background: var(--pc-bg);
}
.customizer-product-page .preview-box {
    background: var(--pc-card-bg);
    border-radius: var(--pc-card-radius);
    box-shadow: var(--pc-card-shadow);
    border-color: var(--pc-card-border);
}
.customizer-product-page .preview-canvas {
    background: var(--pc-canvas-bg);
}
.customizer-product-page .preview-info {
    background: var(--pc-card-bg);
}

/* 文字 */
.customizer-product-page .product-name,
.customizer-product-page .part-navigation .nav-title,
.customizer-product-page .layer-header-title {
    font-family: var(--pc-heading-font);
    color: var(--pc-text);
}
.customizer-product-page .preview-info .progress,
.customizer-product-page .preview-price,
.customizer-product-page .layer-header-desc {
    color: var(--pc-text-secondary);
}
.customizer-product-page .product-price {
    color: var(--pc-accent);
}

/* 按钮 */
.customizer-product-page .add-cart-btn {
    border-radius: var(--pc-btn-radius);
    background: var(--pc-btn-bg);
    color: var(--pc-btn-text);
}
.customizer-product-page .nav-btn {
    border-radius: var(--pc-btn-radius);
}

/* 导航圆点 */
.customizer-product-page .nav-dots .dot {
    width: var(--pc-nav-dot-size);
    height: var(--pc-nav-dot-size);
}

/* 产品卡片 */
.customizer-product-page .product-item {
    border-radius: var(--pc-product-radius);
    border-color: var(--pc-card-border);
}
.customizer-product-page .product-image-box {
    border-radius: var(--pc-product-radius) var(--pc-product-radius) 0 0;
}

/* 进度条 */
.customizer-product-page .progress-bar {
    background: var(--pc-card-border);
}
.customizer-product-page .progress-fill {
    background: var(--pc-progress-bg);
}

/* PrecisionAndCraft 主题特定：全大写标题 */
.layout-preset-precisionandcraft .nav-title,
.layout-preset-precisionandcraft .layer-header-title {
    text-transform: uppercase;
    letter-spacing: 0.015em;
    font-weight: 500;
}
.layout-preset-precisionandcraft .add-cart-btn {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 13px;
}

/* 极简风格：接近Shopify原生风格 */
.layout-preset-minimal .customizer-container { gap: 16px; }
.layout-preset-minimal .preview-info { padding: 12px 20px; }
.layout-preset-minimal .products-grid { gap: 12px; }
.layout-preset-minimal .product-details { padding: 10px 14px; }

/* 极简风格 - 移动端特殊处理 */
@media (max-width: 768px) {
    .layout-preset-minimal .preview-canvas {
        height: auto;
        max-height: 50vh;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .layout-preset-minimal .preview-box {
        border: none;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }
    .layout-preset-minimal .preview-info {
        background: transparent;
        border-top: none;
        padding: 10px 0;
    }
    .layout-preset-minimal .part-navigation {
        background: transparent;
        border: none;
        border-bottom: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin-top: -5px;
        margin-bottom: 10px;
    }
    .layout-preset-minimal .nav-btn {
        border: none;
        background: transparent;
        box-shadow: none;
    }
    .layout-preset-minimal .bottom-section {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    .layout-preset-minimal .total-card {
        background: rgba(0,0,0,0.85);
        border-radius: 8px;
        padding: 10px 12px;
    }
}

/* 暗夜奢华风格 */
.layout-preset-dark .customizer-container {
    background: linear-gradient(180deg, #121212 0%, #1a1a1a 50%, #121212 100%);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.layout-preset-dark .preview-container {
    position: relative;
}
.layout-preset-dark .preview-box {
    background: #ffffff;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.layout-preset-dark .preview-canvas {
    background: #fafafa;
}
.layout-preset-dark .empty-preview-hint {
    color: #999;
}
.layout-preset-dark .preview-info {
    background: linear-gradient(90deg, #f8f8f8 0%, #ffffff 100%);
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}
.layout-preset-dark .preview-info .progress {
    color: #555;
}
.layout-preset-dark .preview-info .progress strong {
    color: #c9a227;
}
.layout-preset-dark .preview-info .preview-price {
    color: #555;
}
.layout-preset-dark .preview-info .preview-price strong {
    color: #c9a227;
    font-weight: 600;
}
.layout-preset-dark .part-navigation {
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    padding: 14px 18px;
}
.layout-preset-dark .nav-btn {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.08);
    color: #c9a227;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.layout-preset-dark .nav-btn:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}
.layout-preset-dark .nav-btn:disabled {
    opacity: 0.25;
    border-color: #333;
    background: transparent;
}
.layout-preset-dark .nav-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
}
.layout-preset-dark .nav-hint {
    color: #666;
    font-size: 12px;
}
.layout-preset-dark .nav-dots .dot {
    width: 10px;
    height: 10px;
    background: #333;
    border: 2px solid transparent;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.layout-preset-dark .nav-dots .dot:hover {
    background: #444;
    border-color: rgba(255, 215, 0, 0.3);
}
.layout-preset-dark .nav-dots .dot.active {
    background: #c9a227;
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
    transform: scale(1.2);
}
.layout-preset-dark .nav-dots .dot.has-selection::after {
    background: #c9a227;
}
.layout-preset-dark .nav-dots .dot.has-selection.active::after {
    background: #1a1a1a;
}
.layout-preset-dark .config-container {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}
.layout-preset-dark .products-grid-container {
    background: rgba(25, 25, 25, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 14px;
    padding: 16px;
}
.layout-preset-dark .products-grid {
    gap: 14px;
}
.layout-preset-dark .product-item {
    background: linear-gradient(145deg, #252525 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.35s ease;
    overflow: hidden;
}
.layout-preset-dark .product-item:hover {
    border-color: rgba(201, 162, 39, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 10px rgba(201, 162, 39, 0.08);
    transform: translateY(-2px);
}
.layout-preset-dark .product-item.selected {
    border-color: rgba(201, 162, 39, 0.6);
    background: rgba(201, 162, 39, 0.06);
    outline: 2px solid rgba(201, 162, 39, 0.15);
    outline-offset: -2px;
}
.layout-preset-dark .product-item.selected::after {
    background: #c9a227;
    color: #1a1a1a;
    font-weight: 700;
}
.layout-preset-dark .product-image-box {
    background: #1a1a1a;
}
.layout-preset-dark .product-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
}
.layout-preset-dark .product-price {
    color: #c9a227;
    font-weight: 600;
}
.layout-preset-dark .total-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 22px;
}
.layout-preset-dark .total-label {
    color: #888;
    font-size: 13px;
}
.layout-preset-dark .total-price {
    color: #c9a227;
    font-size: 28px;
    font-weight: 700;
}
.layout-preset-dark .add-cart-btn {
    background: linear-gradient(135deg, #c9a227 0%, #b89120 100%);
    color: #1a1a1a;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}
.layout-preset-dark .add-cart-btn:hover {
    background: linear-gradient(135deg, #d4b030 0%, #c9a227 100%);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
    transform: translateY(-1px);
}
.layout-preset-dark .add-cart-btn:active {
    transform: translateY(0);
}
.layout-preset-dark .filter-bar {
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid rgba(201, 162, 39, 0.15);
    border-radius: 12px;
    padding: 12px;
}
.layout-preset-dark .filter-search-input {
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 20px;
    color: #fff;
    padding: 10px 16px;
}
.layout-preset-dark .filter-search-input::placeholder {
    color: #555;
}
.layout-preset-dark .filter-search-input:focus {
    border-color: rgba(201, 162, 39, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}
.layout-preset-dark .filter-sort-select {
    background: rgba(40, 40, 40, 0.9) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c9a227' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 20px;
    color: #fff;
    padding: 10px 32px 10px 14px;
}
.layout-preset-dark .filter-chip {
    background: rgba(50, 50, 50, 0.7);
    color: #aaa;
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
}
.layout-preset-dark .filter-chip.active {
    background: rgba(201, 162, 39, 0.2);
    color: #c9a227;
    border-color: #c9a227;
}
.layout-preset-dark .pc-eye-btn {
    background: rgba(201, 162, 39, 0.8);
    color: #1a1a1a;
    width: 30px;
    height: 30px;
}
.layout-preset-dark .pc-eye-btn:hover {
    background: rgba(201, 162, 39, 1);
}

/* 暗夜奢华 - 移动端优化 */
@media (max-width: 768px) {
    .layout-preset-dark .customizer-container {
        padding: 16px;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
    }
    .layout-preset-dark .preview-box {
        border-radius: 14px;
        border: 1px solid rgba(201, 162, 39, 0.15);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    }
    .layout-preset-dark .preview-canvas {
        background: #f5f5f5;
    }
    .layout-preset-dark .config-container {
        background: transparent;
        border: none;
        padding: 0;
    }
    .layout-preset-dark .part-navigation {
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(201, 162, 39, 0.1);
        border-radius: 12px;
        padding: 10px 12px;
    }
    .layout-preset-dark .nav-btn {
        width: 38px;
        height: 38px;
    }
    .layout-preset-dark .products-grid-container {
        background: rgba(20, 20, 20, 0.9);
        border-radius: 12px;
        padding: 12px;
    }
    .layout-preset-dark .product-item {
        border-radius: 10px;
    }
    .layout-preset-dark .bottom-section {
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(12px);
        border-top: 1px solid rgba(201, 162, 39, 0.15);
    }
    .layout-preset-dark .total-card {
        background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
        border: 1px solid rgba(201, 162, 39, 0.15);
        border-radius: 12px;
        padding: 14px;
    }
    .layout-preset-dark .total-price {
        font-size: 24px;
    }
    .layout-preset-dark .add-cart-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* ============================================
   产品图片 Lightbox（眼睛按钮触发）
   ============================================ */
.pc-product-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.pc-product-lightbox.active {
    opacity: 1;
    visibility: visible;
}
.pc-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}
.pc-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}
.pc-lightbox-img {
    max-width: 90%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 12px;
}
.pc-lightbox-caption {
    margin-top: 16px;
    color: #ccc;
    font-size: 15px;
    text-align: center;
    max-width: 80%;
}
