/*
 * WooCommerce Product Category Archive Styles
 */

/* ==========================================================================
   Category Hero Section (Targeted via template-specific class)
   ========================================================================== */
   .section--hero.category {
    position: relative;
    padding: 80px 0;
    min-height: 300px;
    /* background-color: var(--alpine-dark-bg, #2a2a2a); */ /* Fallback */
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 0; /* Remove space below hero */
}
.section--hero.category.alpine-category-hero:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #0000005e;
    opacity: 1;
}
.section--hero div#breadcrumbs a {
    color: white;
}

.section--hero h1.title {
    color: white;
}
a.woof_front_toggle {
    font-family: fangsong;
    padding: 10px;
    margin: -10px;
    margin-inline-end: 5px;
}

.section--hero.category .title.h1 {
    color: white;
}
.section--hero.category .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55); /* Slightly darker overlay */
    z-index: 1;
}

.section--hero.category .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
}

.section--hero.category .hero-content h1.title {
    font-size: 3em; /* Adjusted size */
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.section--hero.category .hero-content .category-description {
    font-size: 1.1em;
    max-width: 750px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

@media (max-width: 767px) {
    .section--hero.category {
        padding: 40px 0;
        min-height: 180px;
    }
    .section--hero.category .hero-content h1.title {
        font-size: 2.2em;
    }
    .section--hero.category .hero-content .category-description {
        font-size: 1em;
        /* display: none; /* Optionally hide description on small screens */
    }
}

/* ==========================================================================
   Main Content & Sidebar Layout (Scoped to Category Page)
   ========================================================================== */
body.archive .container { /* Apply spacing only on cat pages */
    /* padding-top: 40px; */
    /* padding-bottom: 40px; */
    /* max-width: 1600px; */
}

body.archive .container > .row {
    align-items: flex-start; /* Align columns to top */
}

/* Sticky Sidebar for Desktop */
@media (min-width: 992px) {
    body #sidebar-category {
        position: sticky;
        top: 40px; /* Default gap */
        height: calc(100vh - 95px); /* Adjust based on desired top/bottom gap */
        overflow-y: auto;
        padding-bottom: 40px;
        padding-left: 15px; /* Space for scrollbar */
        top: 95px;
        /* height: calc(100vh - 140px); */
        padding: 0;
        width: 400px;
        max-width: 400px;
        scrollbar-color: #c9c9c9 white;
        scrollbar-width: thin;
    }
     /* Account for sticky header */
     body.sticky-header-active.tax-product_cat #sidebar-category {
        /* !!! ADJUST THIS VALUE based on actual sticky header height + desired gap !!! */
        /* Inspect element to find header height when sticky */
        /* top: 45px; */ /* EXAMPLE VALUE - Adjust this! */
        /* height: calc(100vh - 140px); */ /* EXAMPLE VALUE - Adjust this! */
        /* padding: 30px; */
     }
}

/* Mobile Layout Adjustments */
@media (max-width: 991px) {
    body.archive #sidebar-category {
        order: -1;
    }
     body.archive .col-lg-9 {
         order: 1;
     }
        
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(139px, 2fr));
        padding-bottom: 90px;
    }
    
    .woocommerce ul.products li.product .onsale {
        /* transform: scale(0.75); */
        transform-origin: top right;
        top: 16px;
        left: 1px;
    }
}



.woof_list label {margin-bottom: 0;}

div#sidebar > ul {
    padding: 0;
}

div#sidebar-category h1.title {
    margin-bottom: 10px;
}


.woof_container .woof_container_inner input[type="search"] {
    line-height: 40px;
    height: 40px;
    padding: 0px 10px;
    border-radius: 3px;
}



/* ==========================================================================
   Sidebar Widget Styling (Scoped to Category Page)
   ========================================================================== */
body.archive #sidebar-category .widget {
    margin-bottom: 30px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
}

body.archive #sidebar-category .widget:last-child {
    margin-bottom: 0;
}

body.archive #sidebar-category .widget-title {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid var(--alpine-red);
    background-color: transparent;
    border-radius: 0;
    display: none;
    color: var(--alpine-dark-text);
}

body.archive #sidebar-category .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.archive #sidebar-category .widget ul li {
    margin-bottom: 0;
    padding-bottom: 0px;
    /* border-bottom: 1px dotted var(--alpine-border-color); */
    line-height: 1.3;
    display: flex;
    gap: 10px;
}
body.archive #sidebar-category .widget ul li:last-child {
     margin-bottom: 0;
     padding-bottom: 0;
     border-bottom: none;
}

body.archive #sidebar-category .widget ul li a {
    color: var(--alpine-text-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
    padding: 2px 0;
}
body.archive #sidebar-category .widget ul li a:hover {
    color: var(--alpine-red);
}

/* Specific widget types */
body.archive #sidebar-category .widget_product_categories ul li.cat-parent > a {
    font-weight: 600;
    color: var(--alpine-text-main);
}
body.archive #sidebar-category .widget_product_categories ul li.current-cat > a {
    color: var(--alpine-red);
    font-weight: 700;
}
body.archive #sidebar-category .widget_product_categories ul li.current-cat-parent > a {
     color: var(--alpine-red);
}
body.archive #sidebar-category .widget_product_categories ul ul.children {
    margin-top: 8px;
    padding-right: 15px; /* Indent */
    border-top: 1px dotted var(--alpine-border-color);
    padding-top: 8px;
}
body.archive #sidebar-category .widget_product_categories ul ul.children li {
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

/* WooCommerce Filter Widgets */
body.archive #sidebar-category .woocommerce-widget-layered-nav-list { }
body.archive #sidebar-category .woocommerce-widget-layered-nav-list__item {
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
body.archive #sidebar-category .woocommerce-widget-layered-nav-list__item a {
    color: var(--alpine-text-secondary);
    text-decoration: none;
}
body.archive #sidebar-category .woocommerce-widget-layered-nav-list__item a:hover {
    color: var(--alpine-red);
}
body.archive #sidebar-category .woocommerce-widget-layered-nav-list__item.woocommerce-widget-layered-nav-list__item--chosen a {
    font-weight: 700;
    color: var(--alpine-red);
}
body.archive #sidebar-category .woocommerce-widget-layered-nav-list__item .count {
    font-size: 0.9em;
    color: var(--alpine-text-secondary);
    margin-right: 5px; /* RTL */
    background-color: var(--alpine-light-grey);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Price Filter */
body.archive #sidebar-category .widget_price_filter .price_slider_wrapper {margin-top: 15px;}
body.archive #sidebar-category .widget_price_filter .ui-slider {margin-bottom: 15px;width: 100%;}
body.archive #sidebar-category .widget_price_filter .price_label {
   margin-top: 15px;
   display: flex;
   justify-content: space-between;
   align-items: center;
   font-size: 0.9em;
}
body.archive #sidebar-category .widget_price_filter .price_label span { font-weight: 600; }
body.archive #sidebar-category .widget_price_filter .price_label .button {
    font-size: 13px;
    padding: 5px 10px;
    line-height: 1.5;
    background-color: var(--alpine-light-grey);
    color: var(--alpine-dark-text);
    border: 1px solid var(--alpine-border-color);
}
body.archive #sidebar-category .widget_price_filter .price_label .button:hover {
     background-color: var(--alpine-red);
     color: #fff;
     border-color: var(--alpine-red);
}

/* ==========================================================================
   Result Count & Sorting (Scoped to Category Page)
   ========================================================================== */
body.archive .woocommerce .woocommerce-products-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--alpine-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
body.archive .woocommerce-result-count {
    margin: 20px 0 10px 0;
    font-size: 0.9em;
    color: var(--alpine-text-secondary);
}

body.archive .woocommerce-ordering { margin: 0; }
body.archive .woocommerce-ordering select {
    padding: 8px 12px;
    border: 1px solid var(--alpine-border-color);
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9em;
    display: none;
}

/* ==========================================================================
   Pagination (Scoped to Category Page)
   ========================================================================== */
body.archive nav.woocommerce-pagination { margin-top: 30px; text-align: center; }
body.archive nav.woocommerce-pagination ul {
    display: inline-flex;
    list-style: none; padding: 0; margin: 0;
    border-radius: 4px; overflow: hidden; border: 1px solid var(--alpine-border-color);
}
body.archive nav.woocommerce-pagination ul li { margin: 0; border-left: 1px solid var(--alpine-border-color); /* RTL */ }
body.archive nav.woocommerce-pagination ul li:first-child { border-left: none; }
body.archive nav.woocommerce-pagination ul li a,
body.archive nav.woocommerce-pagination ul li span {
    padding: 10px 18px; display: block; text-decoration: none;
    color: var(--alpine-text-secondary); background-color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-width: 45px; line-height: 1.4;
}
body.archive nav.woocommerce-pagination ul li a:hover,
body.archive nav.woocommerce-pagination ul li span.current {
    background-color: var(--alpine-red); color: #fff; border-color: var(--alpine-red);
}
body.archive nav.woocommerce-pagination ul li span.current { font-weight: 600; }
ul.woof_list.woof_list_checkbox {
    margin: 0;
    padding: 0;
}
.woof_container_inner h4 {
    font-size: 18px;
}

/* ==========================================================================
   Brand Description Section
   ========================================================================== */
.brand-description-section {
    margin-top: 60px;
    padding: 40px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.brand-description-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand-description-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.3;
}

.brand-description-content {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.brand-description-content p {
    margin-bottom: 20px;
}

.brand-description-content p:last-child {
    margin-bottom: 0;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .brand-description-section {
        margin-top: 40px;
        padding: 30px 0;
    }
    
    .brand-description-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .brand-description-content {
        font-size: 15px;
        text-align: right; /* RTL for Hebrew text */
    }
    
    .brand-description-section .container {
        padding: 0 15px;
    }
}

/* ===================================================================
   Shop Page Bottom Content & Category Bottom Content
   =================================================================== */
.shop-bottom-content,
.category-bottom-content,
.brand-bottom-content,
.tag-bottom-content {
    padding: 40px 0;
    background-color: #f8f9fa;
    margin-top: 40px;
    border-top: 1px solid #e9ecef;
    direction: rtl; /* RTL support for Hebrew text */
}

.shop-bottom-content .bottom-inner,
.category-bottom-content .bottom-inner,
.brand-bottom-content .bottom-inner,
.tag-bottom-content .bottom-inner {
    max-width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
    text-align: start;
}

.shop-bottom-content h2,
.category-bottom-content h2,
.brand-bottom-content h2,
.tag-bottom-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #2c5e3f;
    text-align: start;
}

.shop-bottom-content p,
.category-bottom-content p,
.brand-bottom-content p,
.tag-bottom-content p {
    margin-bottom: 20px;
    text-align: start; /* RTL for Hebrew text */
}

.shop-bottom-content p:last-child,
.category-bottom-content p:last-child,
.brand-bottom-content p:last-child,
.tag-bottom-content p:last-child {
    margin-bottom: 0;
}

/* Additional styling for bottom content elements */
.shop-bottom-content ul,
.category-bottom-content ul,
.brand-bottom-content ul,
.tag-bottom-content ul {
    text-align: start;
    padding-inline-start: 20px;
    margin-bottom: 20px;
}

.shop-bottom-content ol,
.category-bottom-content ol,
.brand-bottom-content ol,
.tag-bottom-content ol {
    text-align: start;
    padding-inline-start: 20px;
    margin-bottom: 20px;
}

.shop-bottom-content li,
.category-bottom-content li,
.brand-bottom-content li,
.tag-bottom-content li {
    margin-bottom: 8px;
}

.shop-bottom-content strong,
.category-bottom-content strong,
.brand-bottom-content strong,
.tag-bottom-content strong {
    font-weight: 600;
    color: #2c5e3f;
}

/* Mobile responsive for bottom content */
@media (max-width: 767px) {
    .shop-bottom-content,
    .category-bottom-content,
    .brand-bottom-content,
    .tag-bottom-content {
        padding: 30px 0;
        margin-top: 30px;
    }
    
    .shop-bottom-content .bottom-inner,
    .category-bottom-content .bottom-inner,
    .brand-bottom-content .bottom-inner,
    .tag-bottom-content .bottom-inner {
        font-size: 15px;
        text-align: start; /* RTL for Hebrew text */
        padding: 0 15px;
    }
    
    .shop-bottom-content h2,
    .category-bottom-content h2,
    .brand-bottom-content h2,
    .tag-bottom-content h2 {
        font-size: 24px;
        margin-bottom: 20px;
        text-align: start; /* RTL for Hebrew text */
    }
}

