/* استایل فلش اسکرول به بالا */
@media (max-width: 1024px) {
    .scrollToTop {
        left: 12px;
        bottom: 160px !important;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

.custom-product-tabs-wrapper,
.custom-product-extra-tabs-wrapper {
    margin: 0;
    direction: rtl;
    border: 2px solid #e7e7e7;
    border-radius: 12px;
    overflow: hidden;
}

.custom-product-tabs-headers,
.custom-product-extra-tabs-headers {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 0;
    padding: 10px;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #e7e7e7;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    cursor: grab;
    user-select: none;
}

.custom-product-tabs-headers.dragging,
.custom-product-extra-tabs-headers.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* مخفی کردن اسکرولبار اما اجازه اسکرول */
.custom-product-tabs-headers::-webkit-scrollbar,
.custom-product-extra-tabs-headers::-webkit-scrollbar {
    display: none;
}

.custom-tab-header,
.custom-extra-tab-header {
    padding: 12px 12px !important;
    background: none !important;
    border: none !important;
    border-radius: 4px 4px 0 0 !important;
    font-size: 14.96px !important;
    cursor: pointer !important;
    color: #495057 !important;
    position: relative !important;
    bottom: 0px !important;
    transition: none !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
    user-select: none;
}

.custom-tab-header:hover,
.custom-extra-tab-header:hover {
    background: #e9ecef;
}

.custom-tab-header.active,
.custom-extra-tab-header.active {
    background: none !important;
    color: #25A595 !important;
    font-weight: 700  !important;
}

.custom-tab-content,
.custom-extra-tab-content {
    display: none;
    line-height: 1.8;
    color: #212529;
    animation: fadeIn 0.3s ease;
}

.custom-tab-content.active,
.custom-extra-tab-content.active {
    display: block;
    padding: 0;
}

.custom-tab-title,
.custom-extra-tab-title {
    padding: 0px 0px 8px 0px;
    border-style: solid;
    border-width: 0px 0px 2px 0px;
    border-color: #25A595;
    font-size: 16px;
    font-weight: 600;
    margin: 0 !important;
    margin-bottom: 10px !important;
    color: #2c3e50;
    width: fit-content !important;
}

.custom-tab-inner-content,
.custom-extra-tab-inner-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-content: center;
}

.custom-extra-tab-inner-content .video-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.custom-tab-content img,
.custom-extra-tab-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
}

.custom-tab-content ul,
.custom-tab-content ol,
.custom-extra-tab-content ul,
.custom-extra-tab-content ol {
    padding-right: 20px;
    margin: 15px 0;
}

.custom-tab-content li,
.custom-extra-tab-content li {
    margin-bottom: 10px;
    position: relative;
    padding-right: 10px;
}

/* .custom-tab-content ul li:before,
.custom-extra-tab-content ul li:before {
    content: "•";
    color: #25A595;
    position: absolute;
    right: -10px;
} */

.custom-tab-content h2,
.custom-tab-content h3,
.custom-tab-content h4,
.custom-extra-tab-content h2,
.custom-extra-tab-content h3,
.custom-extra-tab-content h4 {
    color: #2c3e50;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.custom-tab-content h2,
.custom-extra-tab-content h2 {
    font-size: 22px;
    padding-bottom: 10px;
}

.custom-tab-content h3,
.custom-extra-tab-content h3 {
    font-size: 18px;
}

.custom-tab-content p,
.custom-extra-tab-content p {
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
    font-size: 14.08px;
}

.custom-extra-tab-content p.video-description {
    display: none;
}

/* استایل جدول ویژگی های محصول - نسخه دو ستونه با CSS Grid */
.custom-tab-content .woocommerce-product-attributes {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin: 0;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0;
}

.custom-tab-content .woocommerce-product-attributes tbody {
    display: contents;
}

.custom-tab-content .woocommerce-product-attributes tr {
    background: #f5f5f5;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: row;
    min-height: 0;
    justify-content: flex-start;
    align-items: stretch;
    padding: 5px 0px;
    gap: 10px;
    border: none;
}
@media (min-width: 1024px) {
    .custom-tab-content .woocommerce-product-attributes tr:nth-child(odd) {
        border-left: 2px solid #e7e7e7;
    }
    
    .custom-tab-content .woocommerce-product-attributes tr:nth-child(even) {
        border-left: none;
    }
}

.custom-tab-content .woocommerce-product-attributes tr td a {
    color: #192736;
}

.custom-tab-content .woocommerce-product-attributes tr:nth-child(4n+3), .custom-tab-content .woocommerce-product-attributes tr:nth-child(4n+4) {
    background: #fff;
}

.custom-tab-content .woocommerce-product-attributes-item__label {
    padding: 10px 20px;
    border-radius: 0;
    text-align: right;
    font-weight: 400;
    color: #333;
    border: none;
    font-size: 14.08px;
    width: 50%;
    box-sizing: border-box;
}

.custom-tab-content .woocommerce-product-attributes-item__value {
    font-size: 14.08px;
    font-weight: 400;
    color: #192736;
    padding: 10px 20px;
    border: none;
    text-align: left;
    width: 50%;
    box-sizing: border-box;
    line-height: 1.5;
    align-items: center;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.custom-tab-content .woocommerce-product-attributes-item__value p {
    margin: 0;
    text-align: right;
    line-height: 1.5;
}

.custom-tab-content .wd-attr-name {
    display: block;
}

.custom-tab-content .wd-attr-name-label {
    display: block;
    padding: 0;
}

.custom-tab-content .wd-attr-term {
    display: block;
}

.custom-tab-content .wd-attr-term p {
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.custom-tabs-no-product {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-tab-header,
    .custom-extra-tab-header {
        padding: 12px 16px 7px !important;
        font-size: 14px !important;
    }
    
    .custom-product-tabs-headers,
    .custom-product-extra-tabs-headers {
        flex-wrap: nowrap;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        cursor: grab;
    }
    
    .custom-tab-content .woocommerce-product-attributes {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .custom-tab-content .woocommerce-product-attributes-item__label,
    .custom-tab-content .woocommerce-product-attributes-item__value {
         padding: 8px 12px 8px 20px;
         direction: rtl;
        text-align: right;
    }
}

/* بهبود عملکرد لمسی برای موبایل */
@media (hover: none) and (pointer: coarse) {
    .custom-product-tabs-headers,
    .custom-product-extra-tabs-headers {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        cursor: grab;
    }
    
    .custom-tab-header,
    .custom-extra-tab-header {
        padding: 14px 20px;
        min-height: 44px;
    }
}

#tab-content-composition table {
    border-collapse: separate !important;
    border-spacing: 5px;
    width: 100%;
    border-radius: 12px;
    border: none !important;
}

#tab-content-composition table tbody tr {
    border-radius: 8px;
    overflow: hidden;
}

#tab-content-composition table td {
    padding: 12px 15px;
    text-align: right;
    border: 1px solid #e7e7e7 !important;
    text-align: center;
}

#tab-content-composition table tbody tr:first-child td {
    background-color: rgba(37, 165, 149, 0.1); 
    color: #000;
    font-weight: bold;
}

#tab-content-composition table tbody tr:nth-child(even):not(:first-child) {
    background-color: #f8f9fa; 
}

#tab-content-composition table tbody tr:nth-child(odd):not(:first-child) {
    background-color: #ffffff; 
}

#tab-content-composition tbody tr td:first-child {
    border-radius: 0px 8px 8px 0px;
}

#tab-content-composition tbody tr td:last-child {
    border-radius: 8px 0px 0px 8px;
}

/* استایل های جدید برای ویجت تب های اضافی */
.description-toggle {
    margin: 10px 0;
    background: none !important;
    border: none !important;
    color: #373737 !important;
    cursor: pointer !important;
    padding: 5px 0 !important;
    margin-top: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    font-family: inherit !important;
    font-size: 14px !important;
    text-decoration: none !important;
    flex-direction: row-reverse;
    width: 100%;
}

.description-toggle:hover {
    color: #25A595 !important;
}

.description-toggle:hover .toggle-icon {
    border-color: #25A595 !important;
}

/* استایل برای ویدیو */
.custom-extra-tab-content video {
    max-width: 100% !important;
    height: auto;
    border-radius: 12px !important;
}

/* استایل برای سوالات متداول */
.faq-list {
    min-width: 100%;
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding: 10px;
    border-radius: 12px;
    background: #e7e7e7;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-question {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    cursor: pointer;
    position: relative;
    padding-right: 25px;
}

.faq-question:after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    color: #25A595;
    transition: transform 0.3s;
}

.faq-item.active .faq-question:after {
    content: '-';
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 10px;
    color: #495057;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-item h4.faq-question {
    margin: 5px auto;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* استایل Swiper برای تب های اضافی */
.has-swiper .custom-product-tabs-headers,
.has-swiper .custom-product-extra-tabs-headers {
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

.has-swiper .custom-product-tabs-headers .swiper-slide,
.has-swiper .custom-product-extra-tabs-headers .swiper-slide {
    width: auto !important;
}

.has-swiper .custom-product-tabs-headers .swiper-slide .custom-tab-header,
.has-swiper .custom-product-extra-tabs-headers .swiper-slide .custom-extra-tab-header {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .has-swiper .custom-product-tabs-headers,
    .has-swiper .custom-product-extra-tabs-headers {
        flex-direction: row !important;
    }
    
    .has-swiper .custom-tab-header,
    .has-swiper .custom-extra-tab-header {
        width: auto !important;
        margin-bottom: 0 !important;
    }
    
    .custom-tab-content h3.custom-tab-title {
        font-size: 17px;
    }
}

/* استایل دکمه نمایش بیشتر/بستن - مینیمال و شبیه فلش Swiper */
.description-toggle .toggle-icon {
    margin-right: 5px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #373737;
    border-bottom: 2px solid #373737;
    transition: transform 0.3s ease;
    display: inline-block;
}

.description-toggle .toggle-icon.down {
    transform: rotate(45deg);
}

.description-toggle .toggle-icon.up {
    transform: rotate(-135deg);
}

.description-toggle .toggle-text {
    margin-left: 5px;
    font-size: 14.08px;
    font-weight: 600;
}

#tab-content-attributes .custom-tab-inner-content {
    padding: 0;
}

@media (max-width: 768px) {
    .custom-tab-content .woocommerce-product-attributes tr:nth-child(odd) {
        background-color: #f5f5f5;
        border-left: none;
    }

    .custom-tab-content .woocommerce-product-attributes tr:nth-child(even) {
        background-color: #fff;
        border-left: none;
    }
}

@media (max-width: 480px) {
    .single-product footer.wd-footer.footer-container {
        padding-bottom: 100px;
    }
    .scrollToTop {
        bottom: 170px;
    }
}

/* ============================================
   استایل پایه برای همه جدول ها (دسکتاپ)
============================================ */

#tab-content-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#tab-content-description table td,
#tab-content-description table th {
    padding: 10px 12px;
    text-align: right;
    border: 1px solid #ddd;
    font-size: 14px;
    text-align: center;
}

#tab-content-description table th {
    background-color: rgb(37, 165, 149);
    color: white;
    font-weight: 600;
}

#tab-content-description table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ============================================
   استایل برای جدول های داخل .responsive-table
============================================ */

.responsive-table {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
}

/* در موبایل: اسکرول افقی */
@media screen and (max-width: 768px) {
    .responsive-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .responsive-table table {
        min-width: 600px;
    }
    
    .responsive-table::-webkit-scrollbar {
        height: 6px;
        background: #f1f1f1;
    }
    
    .responsive-table::-webkit-scrollbar-thumb {
        background: rgb(37, 165, 149);
        border-radius: 3px;
    }
    
    .responsive-table table td,
    .responsive-table table th {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ============================================
   استایل برای جدول های خارج از .responsive-table
============================================ */

/* در موبایل: فیکس و بدون اسکرول */
@media screen and (max-width: 768px) {
    #tab-content-description table:not(.responsive-table table) {
        display: table;
        width: 100%;
    }
    
    #tab-content-description table:not(.responsive-table table) td,
    #tab-content-description table:not(.responsive-table table) th {
        padding: 6px 8px;
        font-size: 12px;
        word-break: break-word;
        max-width: 100px;
    }
}

/* استایل بهبود یافته برای Swiper - حذف فلش های ناوبری */
.custom-product-tabs-headers.swiper .swiper-button-next,
.custom-product-tabs-headers.swiper .swiper-button-prev,
.custom-product-extra-tabs-headers.swiper .swiper-button-next,
.custom-product-extra-tabs-headers.swiper .swiper-button-prev {
    display: none !important;
}

/* بهبود عملکرد کشیدن با موس و تاچ */
.custom-product-tabs-headers.swiper,
.custom-product-extra-tabs-headers.swiper {
    cursor: grab;
}

.custom-product-tabs-headers.swiper:active,
.custom-product-extra-tabs-headers.swiper:active {
    cursor: grabbing;
}

/* استایل برای نمایش بهتر اسکرول در موبایل */
@media (max-width: 768px) {
    .custom-product-tabs-headers,
    .custom-product-extra-tabs-headers {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #25A595 #f1f1f1;
    }
    
    .custom-product-tabs-headers::-webkit-scrollbar,
    .custom-product-extra-tabs-headers::-webkit-scrollbar {
        height: 4px;
        display: block;
    }
    
    .custom-product-tabs-headers::-webkit-scrollbar-track,
    .custom-product-extra-tabs-headers::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .custom-product-tabs-headers::-webkit-scrollbar-thumb,
    .custom-product-extra-tabs-headers::-webkit-scrollbar-thumb {
        background: #25A595;
        border-radius: 2px;
    }
    
    /* برای نمایش اسکرول بار فقط هنگام کشیدن */
    .custom-product-tabs-headers:not(.dragging)::-webkit-scrollbar,
    .custom-product-extra-tabs-headers:not(.dragging)::-webkit-scrollbar {
        display: none;
    }
}

/* استایل برای Swiper از المنتور */
.custom-product-tabs-headers.swiper,
.custom-product-extra-tabs-headers.swiper {
    overflow: hidden !important;
}

.custom-product-tabs-headers.swiper .swiper-wrapper,
.custom-product-extra-tabs-headers.swiper .swiper-wrapper {
    display: flex;
    align-items: center;
}

/* بهبود نمایش در حالت Swiper فعال */
.has-swiper .custom-product-tabs-headers,
.has-swiper .custom-product-extra-tabs-headers {
    padding: 10px 0 !important;
}

.has-swiper .custom-product-tabs-headers .swiper-slide,
.has-swiper .custom-product-extra-tabs-headers .swiper-slide {
    padding: 0 5px;
}


.custom-product-tabs-headers .swiper-slide,
.custom-product-extra-tabs-headers .swiper-slide {
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

/* بهبود cursor برای حالت کشیدن */
.custom-product-tabs-headers .swiper.grab-cursor .swiper-wrapper,
.custom-product-extra-tabs-headers .swiper.grab-cursor .swiper-wrapper{
    cursor: grab;
}

.custom-product-tabs-headers .swiper.grab-cursor .swiper-wrapper:active,
.custom-product-extra-tabs-headers .swiper.grab-cursor .swiper-wrapper:active{
    cursor: grabbing;
}

/* استایل های جدید برای نمایش بیشتر/کمتر */
.description-short {
    display: block;
}

.description-full {
    display: none;
}

.description-full.show {
    display: block !important;
}

.description-short.hide {
    display: none !important;
}