/**
 * Category Tabs Section Styles
 * Optimized for faster loading and better performance
 */

/* Main Container */
.category-tabs-section {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin: 0 auto 30px;
    font-family: "Ezer-block", Sans-serif;
    direction: rtl;
    max-width: 1200px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: url("/wp-content/uploads/2025/06/canvas.webp");
    background-repeat: repeat;
    background-size: contain;
    background-position: center;
    border: 9px solid var(--maincolor);
    overflow: visible;
}


/* ======= 1. Subcategories Section ======= */
.category-tabs-subcategories {
    /* background-color: #f9f9f9; */
    padding: 20px;
    border-bottom: 1px solid #eee;
    width: 35%;
}

/* Desktop Version */
.subcategories-desktop {
    display: flex;
    flex-direction: column;
}

.subcategories-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.category-ribbon {
    position: absolute;
    right: -46px;
    top: -10px;
}

.category-ribbon-img {
    height: 70px !important;
    
}

.category-heading {
    font-size: 20px;
    margin-top: 2px;
    font-weight: 700;
    color: #333;
    margin: 0;
    position: relative;
    z-index: 1;
    padding-top: 5px;
}

.subcategories-list ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
}

.subcategories-list .product-category {
    text-align: center;
    transition: transform 0.3s ease;
}

.subcategories-list .product-category:hover {
    transform: scale(1.05);
}

.subcategories-list .product-category a{
    color: var( --e-global-color-text );
}

.subcategories-list .product-category img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.subcategories-list .woocommerce-loop-category__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding: 5px;
    text-align: right;
}

.subcategories-list .count {
    font-weight: normal;
    opacity: 0.7;
}

/* Mobile Version (Accordion) */
.subcategories-mobile {
    display: none;
    margin-bottom: 20px;
}


.category-accordion-title {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 18px;
    gap: 8px;
}

.category-accordion-icon .icon-opened, .category-accordion-icon .icon-closed{
    margin-bottom: -8px;
}

.category-accordion-icon .icon-opened svg, .category-accordion-icon .icon-closed svg{
    height: 18px;
    width: 18px;
}

.category-accordion-icon .icon-opened {
    display: none;
}

.category-accordion-item[open] .icon-opened {
    display: inline-block;
}

.category-accordion-item[open] .icon-closed {
    display: none;
}

.category-accordion-content {
    padding: 15px;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

/* This will be applied by JavaScript dynamically */
.category-accordion-item[open] .category-accordion-content {
    max-height: 500px; /* Adjusted dynamically by JS */
    opacity: 1;
}

/* Hide the default arrow */
.category-accordion-title::-webkit-details-marker {
    display: none;
}

.mobile-subcategories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-subcategory-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-subcategory-item:last-child {
    border-bottom: none;
}

.mobile-subcategory-item a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    display: block;
}

.mobile-subcategory-item .count {
    color: #777;
}

/* ======= 2. Tips Carousel ======= */
.tips-section-wrapper {
    margin-bottom: 30px;
}

.category-tips-carousel {
    position: relative;
    padding: 0px;
    border-radius: 0px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    width: 65%;
}

.tips-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 50px;
}

.tips-icon.accordion{
    left: 4px;
    right: auto;
    transform: rotate(-55deg);
}

.tips-carousel-container {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.tips-carousel {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.tip-slide {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.tip-image {
    width: 100%;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 0;

    outline: dashed;
    outline-width: 2px;
    outline-offset: -20px;
    outline-color: white;
}

.tip-video {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.tip-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.tip-content {
    /* background-color: #fff; */
    padding: 15px;
    text-align: center;
    width: fit-content;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);

    position: absolute;
    bottom: 8px;
    width: 90%;
    /* background: #ffffffaa; */
    display:flex;
    justify-content: center;
    align-items: center;
}

.tip-content-bg{
    filter: drop-shadow(0 0 0 var(--maincolor, #FFE));
    mix-blend-mode: lighten;
}

.tip-text {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    position:absolute;
    width: 80%;
}

.tips-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1;
    direction:ltr;
}

.tips-prev,
.tips-next {
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--maincolor);
    color: #4d4d4d;
}

.tips-prev:hover,
.tips-next:hover,
.tips-prev:focus,
.tips-next:focus {
    background: var(--maincolor);
    color: white;
}

.tips-carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: #333;
}

/* ======= 3. Product Tabs ======= */
.category-tabs-products {
    margin-bottom: 0;
    padding: 0;
    max-width: 50%;
    min-width: 45%;

    /* background: url(/wp-content/uploads/2025/03/gray-fabric-texture-for-background-2025-02-10-07-46-47-utc-scaled.webp); */
    /* background-size: contain;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.89);
    background-blend-mode: lighten; */
}

.product-tabs{
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tabs-content{
    flex-grow: 1;
    padding-top: 20px;
    border: 8px solid var(--maincolor);
    border-left: 0;
    border-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background:white;
}


.products-tabs-container {
    background-color: #fff;
    overflow: hidden;
}

.tabs-heading {
    display: flex;
    justify-content: right;
    /* border-bottom: 1px solid #e5e5e5; */
    position: relative;
}

.tabs-heading:before {
    /* content: ''; */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #f8c73e;
    opacity: 0.3;
}

.tab-title {
    background: none;
    border: none;
    padding: 12px 20px;
    margin: 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    position: relative;
    transition: color 0.3s, background-color 0.3s;
    min-width: 160px;
    background-image: var(--tab-bg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.tab-title:not(:last-child) {
    margin-left: -8%;
}

.tab-title .tab-icon {
    margin-left: 8px;
    color: #f8c73e;
    display: inline-block;
}

.tab-title:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s;
}

.tab-title.active, .tab-title:hover {
    color: #333;
    background-image: var(--tab-bg-active);
    background-color: transparent;
    z-index:3;
}

.tab-title.active:after {

    /* background-color: #f8c73e; */
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 20px 30px;
}

.product-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.05); */
    text-align: center;
    border: 1px solid #f0f0f0;
    display: none;
}

.product-item:nth-child(-n+6){
    display: block;
}

.product-item.mobile-grid {
    margin-bottom: 10px;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.product-image {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
    aspect-ratio: var(--ar-image);
}

.product-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.1);
}

.product-title {
    padding: 5px 5px 5px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex-grow: 1;
    line-height: 1;
}

.product-price {
    padding: 0 5px 5px;
    font-size: 15px;
    font-weight: 700;
    color: var( --e-global-color-primary );
    text-align: center;
}

.no-products {
    text-align: center;
    padding: 30px;
    color: #777;
}

/* ======= Responsive Styles ======= */
@media (max-width: 1024px) {
    .subcategories-list ul {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }
    
    .subcategories-desktop {
        display: none;
    }
    
    .subcategories-mobile {
        display: block;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 10px 15px;
    }

    .category-tabs-section{
        flex-direction:column;
    }

    .category-tabs-subcategories{
        width: 100%;
        border: 0;
        padding: 0;
    }
    
    .product-title {
        font-size: 16px;
        line-height: 1;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;

    }
    
    .product-price {
        font-size: 16px;
    }
    
    .tip-image {
        height: 150px;
    }
    
    .tip-text {
        font-size: 16px;
    }
    
    .tab-title {
        padding: 0;
        font-size: 14px;
        min-width: 115px;
        min-height: 34px;
    }

    /* tab-title margin left except of last */
    .tab-title:not(:last-child) {
        margin-left: -10%;
    }

    .tabs-content{
        border-right: 0;
    }
    
    .tab-icon {
        margin-left: 5px;
    }

    .category-tabs-products{
        max-width: 100%;
        width: 100%;
    }

    .product-item:nth-child(-n+4){
        display: block;
    }
    .product-item:nth-child(n+5) {
        display: none;
      }
}