/* ==========================================
   Products Page Styles
   ========================================== */

/* Banner */
.products-banner {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: clamp(150px, 25vw, 350px);
}

.products-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.products-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.products-banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding-bottom: 20px;
}

.products-banner-content h1 {
    color: #ffffff;
    margin: 0;
    font-size: clamp(20px, 4vw, 40px);
    position: relative;
}

.products-banner-intro {
    margin-top: 12px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.55;
    text-align: center;
}

.products-banner-intro p {
    margin: 0.5em 0 0;
}

.products-banner-intro p:first-child {
    margin-top: 0;
}

/* ------------------------------------------
   页面布局（与 FAQ 页一致：左栏 + 主内容）
   ------------------------------------------ */
.products-page-wrapper {
    padding: 60px 0 80px 0;
    background: #ffffff;
}

/* Reusable secondary-page frame:
   outer wrappers define safe area, inner modules keep layout only. */
.secondary-frame-nav,
.secondary-frame-content {
    --frame-safe-desktop: 14vw;
    --frame-safe-mobile: 5vw;
}

.products-container {
    max-width: none;
    padding: 0;
    margin: 0 var(--frame-safe-desktop, 14vw);
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.frame-nav-wrap .bw-breadcrumbs-inner {
    max-width: none;
    margin: 0 var(--frame-safe-desktop, 14vw);
    padding: 0;
}

.products-sidebar {
    width: 300px;
    flex-shrink: 0;
    align-self: stretch;
    position: sticky;
    top: calc(var(--header-current-height, var(--header-height, 80px)) + 20px);
    height: fit-content;
}

/* Keep one sticky layer only on products pages. */
.products-sidebar .global-sticky-widget {
    position: static;
    top: auto;
}

.products-content {
    flex: 1;
    min-width: 0;
}

#tin-sidebar,
.progress-wrap,
.om-trigger-wrapper,
#online-message-popup {
    position: fixed;
}

#tin-sidebar {
    z-index: 999999;
}

.progress-wrap,
#online-message-popup {
    z-index: 999998;
}

.om-trigger-wrapper {
    z-index: 999997;
}

/* Sidebar morphing */
.product-more-box.sidebar-wrapper {
    width: 100%;
}

.product-cat-title {
    width: 100%;
    border: 0;
    cursor: default;
    text-align: left;
    position: relative;
}

.product-cat-title::after {
    content: "";
}

/* ------------------------------------------
   Products list module (pro- prefix)
   ------------------------------------------ */
.pro-toolbar {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    background-color: #f9f9f9;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.pro-view-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f08200;
    background: #fff;
    border: 1px solid #eee;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 4px;
}

.pro-view-btn.active {
    background: #f08200;
    color: #fff;
    border-color: #f08200;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pro-view-btn:hover {
    background: #f08200;
    color: #fff;
    border-color: #f08200;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pro-container.grid-mode,
.products-info-wrap-box.grid-mode {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pro-container.grid-mode .pro-item {
    text-align: center;
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
}

.pro-container.grid-mode .pro-item:hover {
    border-color: #f08200;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.pro-container.grid-mode .pro-item:hover h3 {
    color: #f08200;
}

.pro-container.grid-mode .pro-item:hover .pro-img img {
    transform: scale(1.1);
}

.pro-container.grid-mode .pro-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 5px;
}

.pro-container.grid-mode .pro-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.pro-container.grid-mode h3 {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin: 0;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.2em;
    transition: color 0.3s;
}

.pro-container.grid-mode p {
    display: none;
}

.pro-container.grid-mode .pro-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.pro-container.list-mode {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pro-container.list-mode .pro-item {
    border: 1px solid #eaeaea;
    padding: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
}

.pro-container.list-mode .pro-item:hover {
    border-color: #f08200;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.pro-container.list-mode .pro-link {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    text-decoration: none;
    width: 100%;
}

.pro-container.list-mode .pro-img {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    overflow: hidden;
    margin: 0;
    border-radius: 5px;
}

.pro-container.list-mode .pro-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pro-container.list-mode .pro-item:hover .pro-img img {
    transform: scale(1.1);
}

.pro-container.list-mode .pro-info {
    flex: 1;
    text-align: left;
    padding-top: 5px;
}

.pro-container.list-mode h3 {
    font-size: 16px;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 500;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 4.2em;
}

.pro-container.list-mode .pro-item:hover h3 {
    color: #f08200;
}

.pro-container.list-mode p {
    display: block;
    color: #777;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.8em;
}

.pro-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
}

.pro-page-links {
    display: flex;
    gap: 5px;
}

.pro-btn {
    width: 35px;
    height: 35px;
    background: #e9e9e9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 2px;
}

.pro-btn:hover {
    background: #f08200;
    color: #fff;
    opacity: 1;
}

.pro-btn.current {
    background: #f08200;
    color: #fff;
    cursor: default;
}

.pro-btn.disabled {
    opacity: 0.6;
    cursor: default;
}

.pro-total-text {
    color: #888;
    font-size: 14px;
}

@media (max-width: 1600px) {
    .pro-container.grid-mode,
    .products-info-wrap-box.grid-mode {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1250px) {
    .pro-container.grid-mode,
    .products-info-wrap-box.grid-mode {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991.98px) {
    .products-page-wrapper {
        padding-top: 20px;
    }

    .products-container {
        margin: 0 var(--frame-safe-mobile, 5vw);
    }

    .frame-nav-wrap .bw-breadcrumbs-inner {
        margin: 0 var(--frame-safe-mobile, 5vw);
    }

    .products-container {
        flex-direction: column;
        gap: 20px;
    }

    .products-sidebar {
        order: 1;
        width: 100%;
        position: static;
        top: auto;
    }

    .products-content {
        order: 2;
        width: 100%;
    }

    .new-product-box {
        display: none;
    }

    .product-cat-title {
        cursor: pointer;
        border-radius: 8px;
        margin: 0;
    }

    .product-cat-title::after {
        content: "▼";
        font-size: 14px;
        line-height: 1;
        margin-left: auto;
        transition: transform 0.3s ease;
    }

    .product-cat-box.is-open .product-cat-title::after {
        transform: rotate(180deg);
    }

    .product-cat-box .category-sidebar-box {
        margin-bottom: 0;
        border-top: 0;
        border-bottom: 0;
        padding: 0;
    }

    .product-cat-box .product-categories {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .product-cat-box.is-open .category-sidebar-box {
        border-top: 0;
        border-bottom: 1px solid #EEEEEE;
    }

    .product-cat-box.is-open .product-categories {
        max-height: 600px;
    }

    .pro-container.grid-mode,
    .products-info-wrap-box.grid-mode {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .pro-container.grid-mode,
    .products-info-wrap-box.grid-mode {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 450px) {
    .pro-container.grid-mode,
    .products-info-wrap-box.grid-mode {
        grid-template-columns: repeat(1, 1fr);
    }

    .pro-container.list-mode .pro-link {
        flex-direction: row;
    }

    .pro-container.list-mode .pro-img {
        width: 140px;
        height: 140px;
        aspect-ratio: auto;
    }
}
