/* فیلترها */
.tamland-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;

}
.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-direction: column;
    font-size: 16px !important;
    font-family: 'YekanBakhFanum', sans-serif;
}
.filter-group label {
    font-weight: bold;
    color: #333;
}
.tamland-category-filter, .tamland-tag-filter {
    border-radius: 15px;
    border: 1px solid #D7D7D7;
    font-family: inherit;
    color: #58595B;
    font-size: 14px;
    max-width: 500px !important;
    width: 250px;
}
.filter-group.teacher{
    display :none;
}

/* استایل‌های Swiper */
.tamland-swiper {
    padding: 10px 5px 40px 5px !important; /* padding-bottom for pagination space */
}

/* استایل کارت محصول جدید */
.product-categories-slider-wrapper {
    direction: rtl;
    font-family: 'YekanBakhFaNum', sans-serif;
    margin: 20px 0;
}

/* --- NEW: Improved Tab Carousel --- */
.product-tabs {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 5px; /* Reduced padding for mobile */
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: thin; /* For Firefox */
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    /* --- NEW: Scroll Snap for better UX --- */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* Hide scrollbar for cleaner look but keep functionality */
.product-tabs::-webkit-scrollbar {
    display: none;
}

.product-tab {
    display: inline-flex;
    height: 35px;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background-color: transparent;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #57595B;
    border-color: #D5D5D6;
    /* --- NEW: Scroll Snap for tabs --- */
    scroll-snap-align: center;
    flex-shrink: 0; /* Prevents tabs from shrinking */
}

.product-title{
    font-family: 'YekanBakhFaNum', sans-serif !important;
    font-weight: 800 !important;
    font-size: 14px !important;    
}

.product-tab:hover { background-color: #FBDADB; color: #57595B; }
.product-tab.active {
    background-color: #C5161C;
    color: #ffffff;
}

.product-slider-container {
    position: relative;
}
.product-slider-container .swiper {
    padding: 10px 0 50px 0 !important;
}

/* --- NEW: Centering Product Cards in Slides --- */
.swiper-slide {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important; /* Makes card and slide same height */
}

/* Product Card Styles */
.product-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #d6d6d6;
    width: 100%; /* Ensure card takes full width of the slide */
    max-width: 245px; /* Keep original max width */
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 5px 20px #0000001a;
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    width: 100%; /* Use full width of parent */
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #d6d6d6;
    box-shadow: 0px 0px 10px #00000026;
}

.product-image-wrapper img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-inner > img {
    /* aspect-ratio: 1/1;
    object-fit: cover; */
    border-radius: 16px;
    border: 1px solid #d6d6d6;
    box-shadow: 0px 0px 10px #00000026;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 8px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-color: #a7a9ac;
}

/* --- FIX: Multi-line title with ellipsis --- */
.product-title {
    position: relative;
    width: 100%; /* Changed from fit-content to 100% */
    margin-top: -1.00px;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 800 !important; 
    font-size: 14px;
    color: #231f20;
    line-height: 22px;
    direction: rtl;
    /* --- NEW: Multi-line clamp --- */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    letter-spacing: 0;
}

.product-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0px 8px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
}

.product-price-discount-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
}

.product-price-column {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    gap: 5px;
    position: relative;
}

.current-price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
}

.toman-icon {
    position: relative;
    width: 17.47px;
    height: 24.09px;
    aspect-ratio: 0.73;
    object-fit: cover;
    margin-right: 5px;
}

.current-price {
    position: relative;
    width: 108px;
    height: 18px;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 900;
    color: #231f20;
    font-size: 20px;
    line-height: 18px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0;
}

.original-price-container {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 22.16px;
    margin-right: -2.00px;
}

.original-price {
    position: absolute;
    top: 0;
    left: 0;
    width: 125px;
    height: 22px;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 700;
    color: #9e9e9e;
    font-size: 12px;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0;
}

.strikethrough {
    position: absolute;
    top: 11px;
    left: 30px;
    width: 65px;
    height: 1px;
    background-color: #9e9e9e;
}

.discount-badge {
    display: flex;
    flex-direction: column;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px;
    position: relative;
    background-color: #c4161c;
    border-radius: 4px;
    flex-shrink: 0;
}

.discount-text {
    position: relative;
    width: fit-content;
    margin-left: -1.00px;
    margin-right: -1.00px;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 900;
    color: #ffffff;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0;
}

.view-all-btn-container {
    display: none;
}

.view-all-btn {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.view-all-btn button {
    background-color: transparent;
    border: 1px solid #C5161C;
    color: #C5161C;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.view-all-btn button:hover {
    background-color: #C5161C;
    color: #ffffff;
}

/* Swiper Navigation */
.swiper-button-next, .swiper-button-prev {
    background-color: #f5f5f5 !important;
    border: 1px solid #C5161C !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    color: #C5161C !important;
    transition: all 0.3s ease !important;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: #C5161C !important;
    color: #ffffff !important;
}
.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 20px !important;
    font-weight: bold !important;
}
.swiper-button-next { left: 10px; }
.swiper-button-prev { right: 10px; }
.swiper-pagination-bullet-active {
    background: #0073aa !important;
}

span.woocommerce-Price-currencySymbol {
    display: none !important;
}

.swiper-pagination.swiper-pagination-clickable.swiper-pagination-bullets.swiper-pagination-horizontal {
    display: none !important;
}

.pc-loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: pc-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes pc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.free-price {
    color: #28a745;
    font-weight: 700;
    font-size: 18px;
}

.free-price + .toman-icon {
    display: none;
}

.product-card-link {
    text-decoration: none; /* Remove underline */
    color: inherit;     /* Inherit text color */
    display: inline-flex; /* Make it behave like the original card */
    align-items: center;
    gap: 10px;
}

.product-card-link:hover {
    text-decoration: none; /* Ensure no underline on hover */
}

.product-card-link:hover .product-card {
    transform: translateY(-5px); /* Apply hover effect to the card itself */
    box-shadow: 0px 5px 20px #0000001a;
}

/* --- Responsive --- */

/* Tablets: 768px to 1023px */
@media (max-width: 1023px) {
    .product-card-inner {
        width: 100%; /* Ensure full width */
    }
    .product-image-wrapper {
        height: 180px;
    }
    .product-title {
        font-size: 13px;
        line-height: 20px; /* Adjust line-height for mobile */
    }
    .current-price {
        font-size: 18px;
    }
    .swiper-button-next, .swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
    }
    .swiper-button-next::after, .swiper-button-prev::after {
        font-size: 18px !important;
    }
}

/* Mobile Phones: 767px and below */
@media (max-width: 767px) {
    .product-categories-slider-wrapper {
        margin: 15px 0;
    }

    .product-tabs {
        margin-bottom: 15px;
        padding: 8px 5px; /* Adjust padding */
        gap: 8px; /* Reduce gap */
    }
    
    .product-tab {
        height: 30px;
        padding: 8px 16px;
        font-size: 12px;
    }

    .product-slider-container .swiper {
        padding-bottom: 40px !important;
    }

    .product-card {
        padding: 8px;
        gap: 8px;
    }

    .product-card-inner {
        width: 100%; /* Full width on mobile */
        max-width: 280px; /* Adjust max-width for mobile */
    }

    .product-image-wrapper {
        height: 160px;
    }

    .product-title-wrapper {
        padding: 12px 6px;
    }
    
    /* --- FIX: Mobile title style --- */
    .product-title {
        font-size: 12px;
        line-height: 18px;
        -webkit-line-clamp: 2; /* Ensure clamp is active on mobile too */
    }

    .product-price-wrapper {
        gap: 12px;
        padding: 0 6px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .toman-icon {
        width: 15px;
        height: 20px;
    }

    .discount-badge {
        width: 32px;
        height: 32px;
    }
    
    .discount-text {
        font-size: 11px;
    }

    .view-all-btn {
        margin-top: 20px;
    }
    
    .view-all-btn button {
        padding: 10px 20px;
        font-size: 13px;
    }

    .swiper-button-next, .swiper-button-prev {
        width: 35px !important;
        height: 35px !important;
    }
    .swiper-button-next::after, .swiper-button-prev::after {
        font-size: 16px !important;
    }
    .swiper-button-next { left: 5px !important; }
    .swiper-button-prev { right: 5px !important; }
}

/* Very Small Mobile Phones: 480px and below */
@media (max-width: 480px) {
    .product-tab {
        font-size: 11px;
        padding: 6px 12px;
    }
    .product-title {
        font-size: 11px;
        line-height: 16px;
    }
    .current-price {
        font-size: 15px;
    }
    .view-all-btn button {
        font-size: 12px;
        padding: 8px 16px;
    }
}