/**
 * Product Category Archive Styles
 * Custom styling for first-level product category pages
 */
body .widget_price_filter .price_slider_amount .button,
body .widget .tagcloud a,
body .widget.widget_product_tag_cloud a {
    background-color: #224F6E;
}
/* Top Level Category Styles */
.top-level-category .content-area {
    float: none;
    width: 100%;
}

.top-level-category .content-area h2 {
    font-size: 36px;
    letter-spacing: -0.1px;
    margin-top: 64px;
    text-align: center;
}

.top-level-category .subcategories-list {
    display: flex;
    flex-direction: column;
}

/* Sub-subcategories flexbox layout */
.top-level-category .content-area .sub-subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 24px;
}

.top-level-category .content-area .sub-subcategory-item {
    flex: 0 0 calc(25% - 24px); /* 4 columns with gap consideration */
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    min-height: 100px; /* Ensure equal heights */
}

.top-level-category .content-area .sub-subcategory-item:hover {
    transform: translateY(-1px);
}

.top-level-category .content-area .sub-subcategory-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    padding: 12px 0;
    text-align: center;
    flex: 1; /* Fill available space for equal heights */
}

.top-level-category .content-area .sub-subcategory-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Sub-subcategory images - centered */
.top-level-category .content-area .sub-subcategory-image {
    margin: 0 auto 8px;
    background-color: #f1f3f4;
    flex-shrink: 0;
    width: 100%;
    height: 268px;
}

.top-level-category .content-area .sub-subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sub-subcategory placeholder - centered */
.top-level-category .sub-subcategory-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.top-level-category .sub-subcategory-placeholder .placeholder-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

/* Sub-subcategory title - centered */
.content-area .sub-subcategory-name {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #495057;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    letter-spacing: -0.3px;
    margin-top: 16px;
    text-transform: lowercase;
}

.content-area .sub-subcategory-name:first-letter {
    text-transform: uppercase;
}

/* Elementor Integration Styles */
.bitprice-elementor-before,
.bitprice-elementor-after {
    width: 100%;
    margin: 0 auto;
}

.bitprice-elementor-before {
    margin-bottom: 48px;
}

.bitprice-elementor-after {
    margin-top: 48px;
}

/* Elementor template wrapper */
.bitprice-elementor-template {
    width: 100%;
}

/* Ensure Elementor content respects theme container */
.top-level-category .bitprice-elementor-before .elementor-container,
.top-level-category .bitprice-elementor-after .elementor-container,
.top-level-category .bitprice-elementor-template .elementor-container {
    max-width: 100%;
}

/* Remove default Elementor margins for better integration */
.bitprice-elementor-before .elementor-section:first-child,
.bitprice-elementor-after .elementor-section:first-child,
.bitprice-elementor-template .elementor-section:first-child {
    margin-top: 0;
}

.bitprice-elementor-before .elementor-section:last-child,
.bitprice-elementor-after .elementor-section:last-child,
.bitprice-elementor-template .elementor-section:last-child {
    margin-bottom: 0;
}

/* Ensure proper spacing between Elementor content and subcategories */
.bitprice-elementor-before + .bitprice-subcategories-grid {
    margin-top: 0;
}

.bitprice-subcategories-grid + .bitprice-elementor-after {
    margin-top: 48px;
}

/* Handle full-width Elementor sections */
.bitprice-elementor-template .elementor-section.elementor-section-full_width {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* Standard Category Layout Styles */
.bitprice-category-standard-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.bitprice-category-standard-layout #secondary {
    float: none;
    width: 100%;
    margin: 0 auto;
}

.bitprice-category-sidebar {
    flex: 0 0 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0 50px 0 0;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.bitprice-category-main-content {
    flex: 1;
}

/* Category Header */
.bitprice-category-header {
    margin-bottom: 24px;
}

.bitprice-category-title {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -1px;
}

/* Category Sorting */
.bitprice-category-sorting {
    margin-bottom: 32px;
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
}

/* Products Section */
.bitprice-category-products {
    margin-bottom: 48px;
}

.bitprice-category-products ul.products li.product {
    padding-left: 8px;
    padding-right: 8px;
}

.bitprice-category-products ul.products {
    margin-left: -8px;
    width: calc(100% + 16px);
}

/* Related Categories */
.bitprice-related-categories {
    margin: 64px 0 96px;
}

.bitprice-related-categories-title {
    font-size: 36px;
    font-weight: 600;
    color: #222;
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.5px;
}
.bitprice-category-standard-layout .close-drawer {
    display: none !important;
}
/* Related Categories Grid */

.bitprice-related-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.bitprice-related-category-item {
    transition: all 0.3s ease;
    text-align: center;
}

.bitprice-related-category-item:hover {
    transform: translateY(-2px);
}

.bitprice-related-category-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bitprice-related-category-link:hover {
    text-decoration: none;
    color: inherit;
}

.bitprice-related-category-image {
    width: 100%;
    height: 282px;
    margin-bottom: 16px;
    background-color: #FFF;
    overflow: hidden;
}

.bitprice-related-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bitprice-related-category-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.bitprice-related-category-placeholder .placeholder-text {
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.bitprice-related-category-name {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    text-align: center;
    letter-spacing: -0.3px;
}
body .woocommerce-info, body .woocommerce-noreviews, body p.no-comments {
    background-color: #224f6e;
}

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    /* Standard Category Layout */
    .bitprice-category-standard-layout {
        flex-direction: column;
        gap: 24px;
    }

    .bitprice-category-sidebar {
        flex: none;
        position: static;
        order: 2;
    }

    .bitprice-category-main-content {
        order: 1;
    }
   .top-level-category .content-area .sub-subcategory-item {
        flex: 0 0 calc(50% - 16px);
    }
}

/* Tablets */
@media (max-width: 768px) {
    /* Top Level Categories */
    .content-area .sub-subcategory-item {
        flex: 0 0 calc(33.333% - 8px); /* 3 columns on tablet */
    }
    .content-area .sub-subcategory-image {
        width: 32px;
        height: 32px;
    }
    .content-area .sub-subcategory-placeholder .placeholder-text {
        font-size: 14px;
    }
    .content-area .sub-subcategory-name {
        font-size: 11px;
    }
    /* Elementor Content */
    .bitprice-elementor-before,
    .bitprice-elementor-after {
        margin-left: -15px;
        margin-right: -15px;
    }
    .bitprice-elementor-before {
        margin-bottom: 32px;
    }
    .bitprice-elementor-after {
        margin-top: 32px;
    }
    /* Standard Category Layout */
    .bitprice-category-standard-layout {
        gap: 16px;
    }
    .bitprice-category-sidebar {
        padding: 16px;
    }
    .bitprice-category-title {
        font-size: 24px;
    }
    .bitprice-related-categories-title {
        font-size: 22px;
    }
    .bitprice-related-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    .bitprice-related-category-item {
        padding: 16px;
    }
    .bitprice-related-category-image {
        height: 120px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Top Level Categories */
    .content-area .sub-subcategory-item {
        flex: 0 0 calc(50% - 6px); /* 2 columns on mobile */
    }
    .top-level-category .content-area .sub-subcategory-item {
        flex: 0 0 100%;
    }
    .content-area .sub-subcategories-list {
        gap: 8px;
    }
    /* Elementor Content */
    .bitprice-elementor-before {
        margin-bottom: 24px;
    }
    .bitprice-elementor-after {
        margin-top: 24px;
    }
    /* Standard Category Layout */
    .bitprice-category-sidebar {
        padding: 12px;
    }
    .bitprice-category-title {
        font-size: 20px;
    }    .bitprice-related-categories-title {
        font-size: 18px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bitprice-related-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .bitprice-related-category-image {
        height: 120px;
    }
    .bitprice-related-category-content {
        padding: 12px;
    }
    .bitprice-related-category-name {
        font-size: 14px;
    }
    .bitprice-related-categories-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .bitprice-related-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .bitprice-related-category-image {
        height: 100px;
    }
    .bitprice-related-category-content {
        padding: 10px;
    }
    .bitprice-related-category-name {
        font-size: 13px;
    }
    .bitprice-related-categories-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
}