/* Pocket Showroom Grid Variables */
:root {
    --ps-primary-color: #007cba;
    --ps-primary-rgb: 0, 124, 186;
    --ps-primary-hover: #005a87;
    --ps-secondary-color: #f6f7f7;
    --ps-text-color: #2c2c2c;
    --ps-text-secondary: #666;
    --ps-text-light: #888;
    --ps-bg-color: #fff;
    --ps-bg-secondary: #fafafa;
    --ps-border-color: #e5e5e5;
    --ps-border-radius: 4px;
    --ps-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Banner Styles */
.ps-banner {
    position: relative;
    width: 100%;
    height: 85vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    color: #fff;
    text-align: center;
}

.ps-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 125, 50, 0.4);
    /* Greenish overlay as requested in image analysis */
    z-index: 1;
}

.ps-banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.ps-banner h1 {
    font-size: 52px;
    margin: 0 0 45px;
    font-weight: 700;
    color: var(--ps-title-color, #fff);
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.02em;
}

.ps-banner-desc {
    font-size: 18px;
    line-height: 1.7;
    color: var(--ps-desc-color, rgba(255, 255, 255, 0.92));
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.015em;
}

/* Product Count Badge - Bottom Right Fixed */
.ps-product-count {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 18px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ps-count-inner {
    margin-bottom: 5px;
}

.ps-count-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ps-count-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.ps-last-updated {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 5px;
    margin-top: 5px;
    font-style: italic;
}

/* Default state: Hide mobile count, show desktop count */
.ps-product-count-mobile {
    display: none;
}

.ps-product-count-desktop {
    display: block;
}

.ps-gallery-container {
    margin: 0 auto;
    padding: 0;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.6;
}

/* Responsive Banner */
@media (max-width: 768px) {
    .ps-banner {
        height: auto;
        min-height: 400px;
        padding: 60px 20px;
        flex-direction: column;
        justify-content: center;
    }

    .ps-banner h1 {
        font-size: 36px;
        margin-bottom: 20px;
        font-weight: 700;
        letter-spacing: 0.01em;
    }

    .ps-banner-buttons {
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }

    .ps-banner-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* On mobile switch which count card is visible */
    .ps-product-count-desktop {
        display: none !important;
    }

    .ps-product-count-mobile {
        display: inline-block !important;
    }

    .ps-banner .ps-product-count-mobile {
        /* On mobile: regular block flow, positioned below the buttons */
        position: relative;
        bottom: auto;
        right: auto;
        left: auto;
        margin-top: 20px;
        padding: 12px 18px;
        min-width: 110px;
        width: auto;
        background: rgba(255, 255, 255, 0.08);
        /* Re-apply background */
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .ps-count-number {
        font-size: 24px;
    }

    .ps-banner-desc {
        font-size: 16px;
        margin-bottom: 20px;
        max-width: 95%;
        text-align: center;
        font-weight: 300;
        letter-spacing: 0.01em;
    }
}

/* <--- THIS WAS THE MISSING BRACKET FOR max-width: 768px! */

/* Small mobile screens */
@media (max-width: 480px) {
    .ps-banner {
        height: auto;
        min-height: 350px;
        padding: 50px 15px;
    }

    .ps-banner h1 {
        font-size: 32px;
        margin-bottom: 20px;
        font-weight: 700;
        letter-spacing: 0.01em;
    }

    .ps-banner-desc {
        font-size: 15px;
        margin-bottom: 15px;
        max-width: 90%;
        text-align: center;
        font-weight: 300;
        letter-spacing: 0.005em;
    }

    .ps-banner-buttons {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
    }

    .ps-banner .ps-product-count-mobile {
        margin-top: 15px;
        padding: 8px 12px;
        min-width: 90px;
    }

    .ps-count-number {
        font-size: 20px;
    }

    .ps-count-label {
        font-size: 9px;
    }
}

/* ==========================================================================
   Theme Header Hiding (Scroll to Hide)
   ========================================================================== */
body.ps-hide-theme-header header,
body.ps-hide-theme-header .site-header,
body.ps-hide-theme-header #masthead,
body.ps-hide-theme-header .elementor-location-header {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

header, .site-header, #masthead, .elementor-location-header {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease !important;
}

/* Filter Buttons - Desktop: normal wrapping */
.ps-filter-buttons {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}


.ps-filter-btn {
    padding: 10px 20px;
    border: 1px solid var(--ps-border-color);
    background: #fff;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    color: var(--ps-text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ps-filter-btn:hover {
    background: var(--ps-bg-secondary);
    transform: translateY(-2px);
}

.ps-filter-btn.active {
    background: var(--ps-primary-color);
    color: var(--ps-button-text-color, #fff);
    border-color: var(--ps-primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--ps-primary-rgb), 0.15);
}

.ps-gallery-filters {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px; /* Fix #14: Add breathing room when sticky */
    z-index: 100;
    background: var(--ps-bg-color);
    padding: 15px; /* Add padding inside the bar */
    border-radius: 8px; /* Soften the edges */
    /* Optional: Add a subtle shadow when scrolling if needed, handled by background currently */
}

/* Sidebar rules removed to favor 100% width sticky top filters */

#ps-search {
    padding: 14px 20px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: #F9FAFB;
    outline: none;
    align-self: flex-start;
}

#ps-search:focus {
    border-color: var(--ps-primary-color);
    box-shadow: 0 0 0 3px rgba(var(--ps-primary-rgb), 0.08);
    background: #fff;
}

.ps-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .ps-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 24px;
    }

    /* Sidebar desktop rules removed */

    /* Desktop: flex layout so filters get full width to wrap,
       and search bar sits on the right */
    .ps-gallery-filters {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20px;
    }

    .ps-filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        flex: 1;
        /* Take up remaining space */
        justify-content: flex-start;
    }

    #ps-search {
        width: 250px;
        max-width: 250px;
        margin-top: 0;
        /* Align with top row of filters */
    }
}

/* Mobile: Horizontal scroll with right-side fading edge */
@media (max-width: 767px) {
    .ps-gallery-filters {
        position: relative;
        /* Fix #15: Disable desktop sticky optimizations on mobile to save screen space */
        top: auto;
        padding: 0;
        border-radius: 0;
        margin-bottom: 16px;
    }

    /* Container for buttons to enable masking */
    .ps-filter-buttons-wrapper {
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    /* The actual scrollable track */
    .ps-filter-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
        padding-bottom: 4px;
        /* Room for shadow/hover */
        /* Smooth scrolling */
        scroll-behavior: smooth;
    }

    /* Hide scrollbar for Chrome, Safari and Opera */
    .ps-filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .ps-filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Fading Edge on the right to indicate scrollability */
    .ps-filter-buttons-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        width: 40px;
        background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
        pointer-events: none;
        /* Let clicks pass through to buttons */
        z-index: 2;
    }

    #ps-search {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.ps-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.ps-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--ps-border-color);
}

.ps-card-image {
    position: relative;
    aspect-ratio: var(--ps-card-ratio, 3/4);
    background: var(--ps-bg-secondary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ps-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

.ps-card:hover .ps-card-overlay {
    opacity: 1;
}

.ps-view-btn {
    background: var(--ps-primary-color);
    color: var(--ps-button-text-color, #fff);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    /* Re-enable clicks for button */
    transition: transform 0.2s, opacity 0.2s;
}

.ps-view-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.ps-card-body {
    padding: 15px;
}

.ps-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.ps-model {
    font-size: 12px;
    color: var(--ps-text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.ps-price {
    font-size: 14px;
    color: var(--ps-primary-color);
    font-weight: 700;
}

.ps-title {
    margin: 0;
    font-size: 15px;
    color: var(--color-primary);
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Watermark */
.ps-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 5;
    user-select: none;
}

/* Modal */
.ps-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--ps-modal-overlay-color, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(2px);
}

/*
 * 寮圭獥鎵撳紑鏃堕殣钘忎富棰樼殑 header / footer / admin bar
 * 鍏煎 Top 20+ WordPress 涓婚锛? * - HTML5 閫氱敤: header, footer
 * - 閫氱敤 class: .site-header, .site-footer, #masthead, #colophon
 * - Astra: .ast-above-header, .ast-below-header, .main-header-bar-wrap
 * - Elementor / Hello: .elementor-location-header/footer, [data-elementor-type]
 * - Divi: #main-header, #main-footer, #top-header, .et-l--header/footer, #et-footer-nav
 * - Avada: .fusion-header-wrapper, .fusion-footer, .fusion-footer-widget-area
 * - OceanWP: #site-header, #sidr, .footer-widgets, #footer-bottom
 * - GeneratePress: .site-header, .main-navigation, .site-footer
 * - Neve: .hfg_header, .hfg_footer
 * - Kadence: .site-header-row, .site-footer-wrap
 * - Blocksy: header[data-id="type-1"], footer.ct-footer
 * - BeTheme: #Header_wrapper, #Top_bar, #Footer
 * - Sydney: .header-wrap, .site-footer
 * - Flavor/flavor Builder: #flavor-header, #flavor-footer
 * - Enfold / flavor: #header, #socket, .avia-footer
 * - Developer themes: .nv-header, .starter-header
 * - WordPress admin bar
 */
body.ps-modal-open,
body.ps-share-open {
    overflow: hidden;
}

/* --- 閫氱敤 HTML5 / 甯歌 class --- */
body.ps-modal-open>header,
body.ps-modal-open>footer,
body.ps-modal-open>.site-header,
body.ps-modal-open>.site-footer,
body.ps-modal-open>#masthead,
body.ps-modal-open>#colophon,
body.ps-modal-open>#page>header,
body.ps-modal-open>#page>.site-header,
/* --- Elementor / Hello Elementor --- */
body.ps-modal-open .elementor-location-header,
body.ps-modal-open .elementor-location-footer,
body.ps-modal-open [data-elementor-type="header"],
body.ps-modal-open [data-elementor-type="footer"],
/* --- Divi --- */
body.ps-modal-open #main-header,
body.ps-modal-open #main-footer,
body.ps-modal-open #top-header,
body.ps-modal-open .et-l--header,
body.ps-modal-open .et-l--footer,
body.ps-modal-open #et-footer-nav,
/* --- Avada --- */
body.ps-modal-open .fusion-header-wrapper,
body.ps-modal-open .fusion-footer,
body.ps-modal-open .fusion-footer-widget-area,
body.ps-modal-open .fusion-sliding-bar-wrapper,
/* --- Astra --- */
body.ps-modal-open .ast-above-header,
body.ps-modal-open .ast-below-header,
body.ps-modal-open .main-header-bar-wrap,
body.ps-modal-open .ast-footer-overlay,
body.ps-modal-open .site-below-footer-wrap,
body.ps-modal-open .ast-above-footer,
/* --- OceanWP --- */
body.ps-modal-open #site-header,
body.ps-modal-open #site-navigation-wrap,
body.ps-modal-open .footer-widgets,
body.ps-modal-open #footer-bottom,
/* --- GeneratePress --- */
body.ps-modal-open .main-navigation,
body.ps-modal-open .site-info,
/* --- Neve --- */
body.ps-modal-open .hfg_header,
body.ps-modal-open .hfg_footer,
body.ps-modal-open .nv-header,
/* --- Kadence --- */
body.ps-modal-open .site-header-row,
body.ps-modal-open .site-footer-wrap,
/* --- Blocksy --- */
body.ps-modal-open header[data-id="type-1"],
body.ps-modal-open footer.ct-footer,
/* --- BeTheme --- */
body.ps-modal-open #Header_wrapper,
body.ps-modal-open #Top_bar,
body.ps-modal-open #Footer,
/* --- Sydney --- */
body.ps-modal-open .header-wrap,
/* --- flavor / flavor-builder --- */
body.ps-modal-open #flavor-header,
body.ps-modal-open #flavor-footer,
/* --- flavor (flavor) --- */
body.ps-modal-open #header,
body.ps-modal-open #socket,
body.ps-modal-open .avia-footer,
/* --- WordPress admin bar --- */
body.ps-modal-open #wpadminbar,

/* ===== 浠ヤ笅鏄?ps-share-open 鐨勫悓姝ヨ鍒?===== */
/* --- 閫氱敤 HTML5 / 甯歌 class --- */
body.ps-share-open>header,
body.ps-share-open>footer,
body.ps-share-open>.site-header,
body.ps-share-open>.site-footer,
body.ps-share-open>#masthead,
body.ps-share-open>#colophon,
body.ps-share-open>#page>header,
body.ps-share-open>#page>.site-header,
/* --- Elementor / Hello Elementor --- */
body.ps-share-open .elementor-location-header,
body.ps-share-open .elementor-location-footer,
body.ps-share-open [data-elementor-type="header"],
body.ps-share-open [data-elementor-type="footer"],
/* --- Divi --- */
body.ps-share-open #main-header,
body.ps-share-open #main-footer,
body.ps-share-open #top-header,
body.ps-share-open .et-l--header,
body.ps-share-open .et-l--footer,
body.ps-share-open #et-footer-nav,
/* --- Avada --- */
body.ps-share-open .fusion-header-wrapper,
body.ps-share-open .fusion-footer,
body.ps-share-open .fusion-footer-widget-area,
body.ps-share-open .fusion-sliding-bar-wrapper,
/* --- Astra --- */
body.ps-share-open .ast-above-header,
body.ps-share-open .ast-below-header,
body.ps-share-open .main-header-bar-wrap,
body.ps-share-open .ast-footer-overlay,
body.ps-share-open .site-below-footer-wrap,
body.ps-share-open .ast-above-footer,
/* --- OceanWP --- */
body.ps-share-open #site-header,
body.ps-share-open #site-navigation-wrap,
body.ps-share-open .footer-widgets,
body.ps-share-open #footer-bottom,
/* --- GeneratePress --- */
body.ps-share-open .main-navigation,
body.ps-share-open .site-info,
/* --- Neve --- */
body.ps-share-open .hfg_header,
body.ps-share-open .hfg_footer,
body.ps-share-open .nv-header,
/* --- Kadence --- */
body.ps-share-open .site-header-row,
body.ps-share-open .site-footer-wrap,
/* --- Blocksy --- */
body.ps-share-open header[data-id="type-1"],
body.ps-share-open footer.ct-footer,
/* --- BeTheme --- */
body.ps-share-open #Header_wrapper,
body.ps-share-open #Top_bar,
body.ps-share-open #Footer,
/* --- Sydney --- */
body.ps-share-open .header-wrap,
/* --- flavor / flavor-builder --- */
body.ps-share-open #flavor-header,
body.ps-share-open #flavor-footer,
/* --- flavor (flavor) --- */
body.ps-share-open #header,
body.ps-share-open #socket,
body.ps-share-open .avia-footer,
/* --- WordPress admin bar --- */
body.ps-share-open #wpadminbar {
    display: none !important;
}


.ps-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--ps-text-light);
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    position: relative;
    min-height: 400px;
    max-height: 85vh;
    /* 关键：变成flex列容器，让layout子元素能正确撑满并滚动 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ps-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.ps-close:hover,
.ps-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#ps-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ps-modal-layout {
    display: flex;
    flex-wrap: nowrap;
    /* 关键：flex:1 + min-height:0 才能从父级正确继承高度并让子列滚动 */
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ps-modal-gallery {
    flex: 1;
    min-width: 0;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    /* 关键：min-height:0 配合父级flex才能正确触发overflow-y:auto */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ps-modal-img-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2px;
}

.ps-modal-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.ps-modal-info {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
    padding: 30px;
    /* 关键：min-height:0 + overflow-y:auto 才能在flex子元素内部独立滚动 */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.ps-modal-gallery::-webkit-scrollbar,
.ps-modal-info::-webkit-scrollbar {
    display: none;
}

.ps-modal-info h2 {
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 10px;
}

.ps-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.ps-sku {
    color: var(--ps-text-secondary);
    font-size: 14px;
}

.ps-price-large {
    font-size: 16px;
    font-weight: bold;
    color: var(--ps-primary-color);
}

.ps-meta-table {
    margin-bottom: 25px;
}

.ps-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--ps-bg-secondary);
    font-size: 14px;
}

.ps-meta-row span {
    color: var(--ps-text-secondary);
}

/* Variants Table */
.ps-variants-section {
    margin-bottom: 25px;
}

.ps-variants-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
}

.ps-variants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ps-variants-table th,
.ps-variants-table td {
    text-align: left;
    padding: 8px;
    border: 1px solid #eee;
}

.ps-variants-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #555;
}

.ps-desc {
    color: #444;
    line-height: 1.6;
    font-size: 14px;
}

.ps-loader {
    text-align: center;
    padding: 50px;
    color: var(--ps-text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .ps-modal-content {
        /* Full screen App-like experience */
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }

    .ps-close {
        /* Floating circular close button for better thumb reach/visibility over images */
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.4);
        color: #fff;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        line-height: 1;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(4px);
    }

    .ps-modal-layout {
        flex-direction: column;
    }

    .ps-modal-gallery {
        /* Top half: Fixed height, horizontal scrolling with snap */
        flex: 0 0 50vh;
        /* slightly more room for the image */
        max-height: 50vh;
        min-height: 250px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        background: #000;
        position: relative;
        /* Context for hint overlay */
    }

    /* Swipe Hint Overlay */
    .ps-modal-gallery::after {
        content: '← Swipe Photos →';
        position: absolute;
        bottom: 25px;
        /* Stay above the text panel overlap */
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.45);
        color: rgba(255, 255, 255, 0.9);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 11px;
        letter-spacing: 0.5px;
        pointer-events: none;
        /* Ignore clicks */
        z-index: 10;
        backdrop-filter: blur(4px);
        animation: psFadeOutHint 3s forwards;
        animation-delay: 2s;
        /* Give them a second to see it, then fade out */
    }

    @keyframes psFadeOutHint {
        to {
            opacity: 0;
            visibility: hidden;
        }
    }

    .ps-modal-img-wrapper {
        flex: 0 0 100%;
        /* Each image takes full width of the scroller */
        scroll-snap-align: start;
        /* Snap point */
        height: 100%;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ps-modal-img {
        /* CRITICAL: contain ensures no cropping on mobile regardless of ratio */
        object-fit: contain;
        width: 100%;
        height: 100%;
        max-height: 100%;
    }

    /* Compact Mobile Typography */
    .ps-modal-info {
        padding: 5px 15px 40px !important;
    }

    .ps-single-title {
        font-size: 18px !important;
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        line-height: 1.3 !important;
        font-weight: 700;
    }

    .ps-single-card {
        padding: 10px 0 !important;
        margin-bottom: 8px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid #f0f0f0;
    }

    .ps-single-card:last-child {
        border-bottom: none;
    }

    .ps-single-meta-flex {
        margin-top: 5px !important;
    }

    .ps-meta-item {
        margin-bottom: 5px !important;
    }

    .ps-meta-label,
    .ps-meta-val,
    .ps-model-badge,
    .ps-price-amount {
        font-size: 13px !important;
    }

    .ps-price-amount {
        font-size: 16px !important;
        /* Keep price standalone readable */
    }

    .ps-card-title {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        color: #666;
    }

    .ps-specs-list {
        margin-top: 5px !important;
    }

    .ps-spec-row {
        padding: 4px 0 !important;
    }

    .ps-spec-key,
    .ps-spec-val {
        font-size: 13px !important;
    }

    .ps-variants-grid {
        gap: 5px !important;
    }

    .ps-variant-box {
        padding: 6px !important;
    }

    .ps-variant-label,
    .ps-variant-val {
        font-size: 12px !important;
        margin-bottom: 2px !important;
    }

    .ps-single-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: #555;
    }

    .ps-single-desc p {
        margin-bottom: 8px !important;
    }

    .ps-modal-share-row {
        padding: 5px 0 !important;
        margin-top: 10px !important;
    }

    .ps-modal-share-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

/* ===== SHARE FUNCTIONALITY ===== */

/* Share Button on Product Card */
.ps-share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ps-share-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ps-card:hover .ps-share-btn {
    opacity: 1;
    transform: scale(1);
}

.ps-share-btn svg {
    width: 18px;
    height: 18px;
    fill: #333;
}

/* CTA Button on Banner */
.ps-banner-cta-btn {
    padding: calc(12px * var(--ps-cta-scale, 1)) calc(28px * var(--ps-cta-scale, 1));
    font-size: calc(14px * var(--ps-cta-scale, 1));
}

.ps-banner-cta-btn:hover {
    opacity: 0.9;
}

/* Share Button on Banner */
.ps-banner-share-btn {
    display: inline-flex;
    align-items: center;
    gap: calc(8px * var(--ps-share-scale, 1));
    padding: calc(10px * var(--ps-share-scale, 1)) calc(22px * var(--ps-share-scale, 1));
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-size: calc(13px * var(--ps-share-scale, 1));
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-left: 12px;
    vertical-align: middle;
}

.ps-banner-share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.ps-banner-share-btn svg {
    width: calc(16px * var(--ps-share-scale, 1));
    height: calc(16px * var(--ps-share-scale, 1));
    fill: #fff;
}

/* Share Button in Modal */
.ps-modal-share-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ps-modal-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid var(--ps-border-color);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

.ps-modal-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ps-modal-share-btn.ps-whatsapp {
    color: #25D366;
    border-color: #25D366;
}

.ps-modal-share-btn.ps-whatsapp:hover {
    background: #25D366;
    color: #fff;
}

.ps-modal-share-btn.ps-wechat {
    color: #07C160;
    border-color: var(--ps-primary-hover);
}

.ps-modal-share-btn.ps-wechat:hover {
    background: #07C160;
    color: #fff;
}

.ps-modal-share-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== SHARE SHEET (Bottom Popup) ===== */
.ps-share-sheet-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000000;
    animation: psFadeIn 0.2s ease;
}

.ps-share-sheet-overlay.active {
    display: block;
}

.ps-share-sheet {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 420px;
    max-width: 95vw;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000001;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    pointer-events: none;
}

.ps-share-sheet-overlay.active .ps-share-sheet {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ps-share-sheet-header {
    text-align: center;
    padding: 20px 20px 10px;
    position: relative;
}

.ps-share-sheet-header::before {
    content: '';
    display: none;
    /* Hide drag handle */
}

.ps-share-sheet-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.ps-share-sheet-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: var(--ps-text-secondary);
}

.ps-share-sheet-close:hover {
    background: #e0e0e0;
}

/* Share Preview Card */
.ps-share-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 20px 15px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 12px;
}

.ps-share-preview-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.ps-share-preview-info {
    flex: 1;
    min-width: 0;
}

.ps-share-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ps-share-preview-desc {
    font-size: 12px;
    color: var(--ps-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Share Options */
.ps-share-options {
    padding: 5px 20px 25px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.ps-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: transform 0.2s;
}

.ps-share-option:hover {
    transform: scale(1.08);
}

.ps-share-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.ps-share-option:hover .ps-share-option-icon {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ps-share-option-icon.ps-wa-icon {
    background: #25D366;
}

.ps-share-option-icon.ps-wc-icon {
    background: #07C160;
}

.ps-share-option-icon.ps-copy-icon {
    background: #555;
}

.ps-share-option-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.ps-share-option-label {
    font-size: 12px;
    color: var(--ps-text-secondary);
    font-weight: 500;
}

/* Toast notification */
.ps-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000002;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.ps-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== QR CODE MODAL ===== */
.ps-qr-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000001;
    animation: psFadeIn 0.2s ease;
}

.ps-qr-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-qr-modal {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    width: 320px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: psScaleIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ps-qr-modal h4 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.ps-qr-modal p {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--ps-text-light);
}

.ps-qr-modal img {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    display: block;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ps-qr-copy-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ps-bg-secondary);
    border-radius: 8px;
    margin-bottom: 15px;
}

.ps-qr-copy-url input {
    flex: 1;
    border: none;
    background: none;
    font-size: 12px;
    color: var(--ps-text-secondary);
    outline: none;
    min-width: 0;
}

.ps-qr-copy-btn {
    padding: 6px 14px;
    background: #07C160;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}

.ps-qr-copy-btn:hover {
    background: #06a853;
}

.ps-qr-close {
    padding: 10px 30px;
    background: #f0f0f0;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    font-weight: 500;
    transition: background 0.2s;
}

.ps-qr-close:hover {
    background: var(--ps-border-color);
}

@keyframes psFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes psScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== LOAD MORE BUTTON (Fix #10) ===== */
.ps-load-more-wrap {
    text-align: center;
    padding: 40px 0 20px;
}

.ps-load-more-btn {
    display: inline-block;
    padding: 14px 48px;
    border: 2px solid var(--ps-primary-color);
    background: transparent;
    color: var(--ps-primary-color);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ps-load-more-btn:hover {
    background: var(--ps-primary-color);
    color: var(--ps-button-text-color, #fff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.25);
}

.ps-load-more-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Fix F6: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================================
   Unified Single Product & Modal Styling
   (Card-based layout mimicking WeChat Mini-program)
   ========================================================================= */

.ps-single-product-wrapper {
    max-width: 680px;
    margin: 0 auto;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: 90px;
}

.ps-single-swiper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    position: relative;
}

.ps-single-swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.ps-single-swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ps-single-swiper .swiper-pagination-bullet-active {
    background: var(--ps-primary-color, #007cba);
}

/* 卡片布局 */
.ps-single-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ps-single-card {
    background: #fff;
    border-radius: 0;
    padding: 24px 0;
    box-shadow: none;
    border-bottom: 1px solid #E5E7EB;
}

.ps-single-card:last-child {
    border-bottom: none;
}

.ps-card-highlight {
    padding-top: 10px;
    padding-bottom: 24px;
}

.ps-single-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ps-single-meta-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ps-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ps-meta-label {
    font-size: 13px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.ps-model-badge {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    background: none;
    padding: 0;
    border-radius: 0;
    display: inline-block;
}

.ps-price-amount {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

/* 规格列表 (统一紧凑格式) */
.ps-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
    border-left: none;
    padding-left: 0;
    letter-spacing: -0.01em;
}

.ps-specs-list {
    display: flex;
    flex-direction: column;
}

.ps-spec-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px dashed #E5E7EB;
    font-size: 15px;
    line-height: 1.5;
}

.ps-spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ps-spec-key {
    color: #6B7280;
    width: 40%;
    flex-shrink: 0;
}

.ps-spec-val {
    color: #111827;
    width: 60%;
    font-weight: 500;
    word-break: break-word;
}

/* 变体尺寸网格 */
.ps-variants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ps-variant-box {
    background: #F3F4F6;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    transition: all 0.2s;
}

.ps-variant-box:hover {
    background: #E5E7EB;
}

.ps-variant-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.ps-variant-val {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
}

/* 详情区域 */
.ps-single-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.ps-single-desc p {
    font-size: 16px;
    color: #374151;
    line-height: 1.7;
}

/* 底部固定分享栏 */
.ps-single-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 24px;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05), 0 -4px 16px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: center;
    z-index: 99;
}

.ps-bottom-btn {
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

.ps-bottom-btn:hover {
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.2);
    transform: translateY(-1px);
}

.ps-bottom-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.1);
}

/* Toast */
#ps-global-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#ps-global-toast.show {
    opacity: 1;
}

/* 如果主题或 Elementor 加载了默认的样式，强制隐藏它们以防破局 */
body.single-ps_item.elementor-page .elementor-section-wrap {
    display: none;
}

/* 让这块 wrapper 独立出来 */
body.single-ps_item .site-content,
body.single-ps_item .content-area {
    padding: 0 !important;
    margin: 0 !important;
}
