/*
 * SISU WooCommerce Category Enhancer 1.3.0
 * Scoped to the Elementor Loop Grid #prodArchive used by SISU.
 */

#prodArchive {
    --sisu-card-border: #e5e7eb;
    --sisu-card-text: #111827;
    --sisu-card-muted: #667085;
    --sisu-card-price: #18324f;
    --sisu-card-bg: #fff;
    --sisu-card-soft: #f7f8fa;
}

/* Product grid */
#prodArchive .elementor-loop-container.elementor-grid {
    column-gap: 24px !important;
    row-gap: 30px !important;
    align-items: stretch;
}

#prodArchive .e-loop-item {
    min-width: 0;
    height: 100%;
}

/* Actual SISU loop-template card (template 24397) */
#prodArchive .e-loop-item > .elementor-element-80b9fbf {
    height: 100%;
    min-height: 100%;
    background: transparent !important;
}

#prodArchive .e-loop-item > .elementor-element-80b9fbf > .e-con-inner {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    max-width: none !important;
    height: 100%;
    padding: 14px 14px 18px !important;
    background: var(--sisu-card-bg);
    border: 1px solid var(--sisu-card-border);
    border-radius: var(--sisu-wce-radius, 8px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (hover:hover) and (pointer:fine) {
    #prodArchive .e-loop-item > .elementor-element-80b9fbf > .e-con-inner:hover {
        transform: translateY(-3px);
        border-color: rgba(243, 146, 0, .42);
        box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
    }
}

/* Product image */
#prodArchive .elementor-element-a19cab8 {
    margin: 0 0 15px !important;
}

#prodArchive .elementor-element-a19cab8 .elementor-widget-container,
#prodArchive .elementor-element-a19cab8 a {
    display: block;
    width: 100%;
}

#prodArchive .elementor-element-a19cab8 img {
    display: block;
    width: 100% !important;
    height: var(--sisu-wce-image-height, 280px) !important;
    margin: 0 !important;
    padding: 13px !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: var(--sisu-card-soft) !important;
    border: 0 !important;
    border-radius: calc(var(--sisu-wce-radius, 8px) - 2px) !important;
    transition: transform .22s ease;
}

@media (hover:hover) and (pointer:fine) {
    #prodArchive .e-loop-item:hover .elementor-element-a19cab8 img {
        transform: scale(1.018);
    }
}

/* Product code / WECK number */
#prodArchive .elementor-element-63e3b6c {
    margin: 0 !important;
}

#prodArchive .elementor-element-63e3b6c > .elementor-widget-container {
    margin: 0 !important;
}

#prodArchive .elementor-element-63e3b6c .elementor-heading-title {
    margin: 0 0 7px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: .075em;
    text-transform: uppercase;
    color: var(--sisu-wce-accent, #f39200) !important;
}

/* Product title */
#prodArchive .elementor-element-8a7509b {
    margin: 0 !important;
}

#prodArchive .elementor-element-8a7509b .product_title,
#prodArchive .elementor-element-8a7509b .elementor-heading-title {
    margin: 0 !important;
    min-height: 50px;
    font-family: inherit !important;
    font-size: 17px !important;
    line-height: 1.45 !important;
    font-weight: 700 !important;
    text-transform: none !important;
    color: var(--sisu-card-text) !important;
}

#prodArchive .elementor-element-8a7509b .product_title a,
#prodArchive .elementor-element-8a7509b .elementor-heading-title a {
    color: inherit !important;
    text-decoration: none !important;
}

#prodArchive .elementor-element-8a7509b .product_title a:hover,
#prodArchive .elementor-element-8a7509b .elementor-heading-title a:hover {
    color: var(--sisu-wce-accent, #f39200) !important;
}

/* Price */
#prodArchive .elementor-element-041831b {
    margin: auto 0 0 !important;
    padding-top: 16px;
}

#prodArchive .elementor-element-041831b .price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 7px;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
    color: var(--sisu-card-price) !important;
}

#prodArchive .elementor-element-041831b .price del {
    order: 1;
    font-size: 13px;
    font-weight: 500;
    color: #98a2b3 !important;
    opacity: 1 !important;
}

#prodArchive .elementor-element-041831b .price ins {
    order: 2;
    color: #b45309 !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

#prodArchive .elementor-element-041831b .price > .woocommerce-Price-amount,
#prodArchive .elementor-element-041831b .price > span:not(.woocommerce-Price-currencySymbol) {
    color: var(--sisu-card-price) !important;
}

#prodArchive .elementor-element-041831b .price small {
    order: 3;
    width: 100%;
    margin-top: 2px;
    font-size: 11px !important;
    line-height: 1.3;
    font-weight: 600 !important;
    color: var(--sisu-card-muted) !important;
}

/* Sale badge */
#prodArchive .custom-sale-badge.elementor-element-303506e {
    top: 25px !important;
    left: 25px !important;
    right: auto !important;
    z-index: 5;
}

#prodArchive .custom-sale-badge.elementor-element-303506e > .elementor-widget-container {
    padding: 6px 10px !important;
    background: var(--sisu-wce-accent, #f39200) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

#prodArchive .custom-sale-badge.elementor-element-303506e .elementor-heading-title {
    font-family: inherit !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: #fff !important;
}

/* Real page navigation replacing Elementor load more */
#prodArchive .sisu-el-pagination {
    clear: both;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 42px 0 10px;
}

#prodArchive .sisu-el-pagination__meta {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 650;
    color: #7a8492;
}

#prodArchive .sisu-el-pagination__links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

#prodArchive .sisu-el-pagination__page,
#prodArchive .sisu-el-pagination__prev,
#prodArchive .sisu-el-pagination__next,
#prodArchive .sisu-el-pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    background: #fff;
    color: #172033;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

#prodArchive .sisu-el-pagination__prev,
#prodArchive .sisu-el-pagination__next {
    gap: 5px;
    min-width: auto;
}

#prodArchive a.sisu-el-pagination__page:hover,
#prodArchive .sisu-el-pagination__prev:hover,
#prodArchive .sisu-el-pagination__next:hover {
    border-color: var(--sisu-wce-accent, #f39200);
    color: #111827;
    transform: translateY(-1px);
}

#prodArchive .sisu-el-pagination__page.is-current {
    border-color: var(--sisu-wce-accent, #f39200);
    background: var(--sisu-wce-accent, #f39200);
    color: #fff;
    box-shadow: 0 5px 12px rgba(243, 146, 0, .18);
}

#prodArchive .sisu-el-pagination__dots {
    min-width: 26px;
    padding: 0 3px;
    border-color: transparent;
    background: transparent;
    color: #98a2b3;
}

/* Hide Elementor load-more only if the JS fallback has successfully built pagination. */
#prodArchive.sisu-wce-js-paginated .e-loop__load-more,
#prodArchive.sisu-wce-js-paginated .e-load-more-message,
#prodArchive.sisu-wce-js-paginated .e-load-more-anchor {
    display: none !important;
}

/* Modern category navigation */
body.sisu-wce-category-design.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories .elementor-widget-container {
    padding: 8px !important;
    background: #fff;
    border: 1px solid #e5e8ec;
    border-radius: var(--sisu-wce-category-radius, 10px);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories {
    width: 100%;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories li {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 0 !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li + li {
    margin-top: 4px !important;
}

/* Main category rows */
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li > a {
    position: relative;
    display: flex !important;
    align-items: center;
    min-height: 42px;
    padding: 10px 38px 10px 12px !important;
    border: 1px solid transparent;
    border-radius: calc(var(--sisu-wce-category-radius, 10px) - 3px);
    background: #f7f8fa;
    color: #172033 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li > a:hover {
    background: #f1f3f6;
    color: var(--sisu-wce-accent, #f39200) !important;
    transform: translateX(1px);
}

/* Clean chevron; overrides the old triangle style. */
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories li.cat-parent > a::after {
    content: "›" !important;
    position: absolute;
    right: 13px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7c8796;
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    transform: rotate(0deg);
    transition: transform .16s ease, color .16s ease;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories li.cat-parent > a.open::after,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories li.current-cat-parent > a::after,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories li.current-cat-ancestor > a::after {
    transform: rotate(90deg);
    color: var(--sisu-wce-accent, #f39200);
}

/* Active main branch */
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li.current-cat-parent > a,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li.current-cat-ancestor > a,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li.current-cat > a,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories > li > a.active {
    border-color: rgba(243, 146, 0, .22);
    background: rgba(243, 146, 0, .085);
    color: #a85f00 !important;
    box-shadow: inset 3px 0 0 var(--sisu-wce-accent, #f39200);
}

/* Children */
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children {
    margin: 5px 5px 8px 14px !important;
    padding: 4px 0 4px 12px !important;
    border-left: 2px solid #edf0f3 !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children li + li {
    margin-top: 2px !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children a {
    position: relative;
    display: block !important;
    min-height: 0;
    padding: 7px 10px !important;
    border: 0 !important;
    border-radius: 6px;
    background: transparent;
    color: #344054 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 550 !important;
    text-decoration: none !important;
    transition: background .14s ease, color .14s ease, padding-left .14s ease;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children a:hover {
    padding-left: 13px !important;
    background: #f7f8fa;
    color: var(--sisu-wce-accent, #f39200) !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children .current-cat > a,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children a.active {
    padding-left: 13px !important;
    background: rgba(243, 146, 0, .09);
    color: #a85f00 !important;
    font-weight: 700 !important;
}

body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children .current-cat > a::before,
body.sisu-wce-category-design.tax-product_cat .widget_product_categories .product-categories .children a.active::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: var(--sisu-wce-accent, #f39200);
}

/* Give the heading a little more visual relation to the panel. */
body.sisu-wce-category-design.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories {
    margin-top: 10px;
}

/* Optional sticky mode. Kept off by default in settings. */
@media (min-width: 1025px) {
    body.sisu-wce-category-sticky.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories {
        position: sticky !important;
        top: 110px;
        z-index: 4;
    }

    body.sisu-wce-category-sticky.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories .elementor-widget-container {
        max-height: calc(100vh - 145px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #cfd5dc transparent;
    }

    body.sisu-wce-category-sticky.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories .elementor-widget-container::-webkit-scrollbar {
        width: 6px;
    }

    body.sisu-wce-category-sticky.tax-product_cat .elementor-widget-wp-widget-woocommerce_product_categories .elementor-widget-container::-webkit-scrollbar-thumb {
        background: #cfd5dc;
        border-radius: 10px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    #prodArchive .elementor-loop-container.elementor-grid {
        column-gap: 18px !important;
        row-gap: 22px !important;
    }

    #prodArchive .elementor-element-a19cab8 img {
        height: 235px !important;
    }

    #prodArchive .elementor-element-8a7509b .product_title,
    #prodArchive .elementor-element-8a7509b .elementor-heading-title {
        min-height: 0;
        font-size: 16px !important;
    }
}

@media (max-width: 767px) {
    #prodArchive .elementor-loop-container.elementor-grid {
        row-gap: 18px !important;
    }

    #prodArchive .e-loop-item > .elementor-element-80b9fbf > .e-con-inner {
        padding: 11px 11px 15px !important;
    }

    #prodArchive .elementor-element-a19cab8 img {
        height: 230px !important;
        padding: 10px !important;
    }

    #prodArchive .custom-sale-badge.elementor-element-303506e {
        top: 20px !important;
        left: 20px !important;
    }

    #prodArchive .sisu-el-pagination {
        margin-top: 30px;
    }

    #prodArchive .sisu-el-pagination__page,
    #prodArchive .sisu-el-pagination__prev,
    #prodArchive .sisu-el-pagination__next {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }

    #prodArchive .sisu-el-pagination__prev span,
    #prodArchive .sisu-el-pagination__next span {
        display: none;
    }
}
