/* =========================================
   single-product/tabs.css
   Product tabs, content and specifications
========================================= */

.product-details {
    width: 100%;
    direction: rtl;
}

.product-details__container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1rem;
}

.product-details__wrapper {
    width: 100%;
}

/* =========================================
   Tabs navigation
========================================= */

.product-tabs {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2.5rem;

    width: 100%;
    margin-bottom: 2rem;
    padding: 0;

    border-bottom: 1px solid #e8e8e8;
}

/* =========================================
   Tab buttons
========================================= */

.product-tabs__button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;

    min-height: 68px;
    margin: 0;
    padding: 0.75rem 0.1rem 1rem;

    appearance: none;
    border: 0;
    border-radius: 0;
    background: transparent;

    color: #1d2b48;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;

    transition: color 0.2s ease;
}

/* خط زیر هر تب */
.product-tabs__button::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;

    width: 0;
    height: 3px;
    margin-inline: auto;

    border-radius: 4px 4px 0 0;
    background: #ef4774;

    content: "";
    transition: width 0.25s ease;
}

/* آیکن SVG */
.product-tabs__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 24px;
    height: 24px;

    color: #ef4774;
}

.product-tabs__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* متن تب */
.product-tabs__label {
    display: inline-block;
}

/* Hover */
.product-tabs__button:hover {
    color: #ef4774;
}

.product-tabs__button:hover::after {
    width: 45%;
}

/* Active tab */
.product-tabs__button.is-active {
    color: #1d2b48;
}

.product-tabs__button.is-active::after {
    width: 100%;
}

/* Keyboard accessibility */
.product-tabs__button:focus-visible {
    outline: 2px solid rgba(239, 71, 116, 0.45);
    outline-offset: 4px;
    border-radius: 4px;
}

/* =========================================
   Tabs content
========================================= */

.product-tabs__content {
    width: 100%;
}

/*
 * hidden توسط JavaScript کنترل می‌شود.
 * این بخش تضمین می‌کند پنل غیرفعال نمایش داده نشود.
 */
.product-tabs__panel,
.product-tabs__panel[hidden] {
    display: none;
}

.product-tabs__panel.is-active {
    display: block;
    width: 100%;
    animation: productTabFade 0.3s ease;
}

/* فاصله و تایپوگرافی محتوای تب */
.product-tabs__panel {
    color: #4c5566;
    font-size: 0.95rem;
    line-height: 2.1;
}

.product-tabs__panel > :first-child {
    margin-top: 0;
}

.product-tabs__panel > :last-child {
    margin-bottom: 0;
}

.product-tabs__panel p {
    margin: 0 0 1.15rem;
    line-height: 2.15;
}

.product-tabs__panel h1,
.product-tabs__panel h2,
.product-tabs__panel h3,
.product-tabs__panel h4,
.product-tabs__panel h5,
.product-tabs__panel h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.85rem;

    color: #1d2b48;
    font-weight: 700;
    line-height: 1.8;
}

.product-tabs__panel ul,
.product-tabs__panel ol {
    margin: 0 0 1.25rem;
    padding-right: 1.35rem;
    padding-left: 0;
}

.product-tabs__panel a {
    color: #ef4774;
    text-decoration: none;
}

.product-tabs__panel a:hover {
    color: #c92f59;
    text-decoration: underline;
}

/* =========================================
   Specifications table
========================================= */

.product-tabs__panel table,
.product-tabs__panel .woocommerce-product-attributes {
    width: 100%;
    margin: 0;
    border: 1px solid #ebedf1;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

/* حذف margin احتمالی جدول ووکامرس */
.product-tabs__panel .woocommerce-product-attributes {
    margin-top: 0;
}

.product-tabs__panel table th,
.product-tabs__panel table td,
.product-tabs__panel .woocommerce-product-attributes th,
.product-tabs__panel .woocommerce-product-attributes td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ebedf1;

    color: #3d4655;
    font-size: 0.94rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.9;
    text-align: right;
    vertical-align: middle;
}

.product-tabs__panel table tr:last-child th,
.product-tabs__panel table tr:last-child td,
.product-tabs__panel .woocommerce-product-attributes tr:last-child th,
.product-tabs__panel .woocommerce-product-attributes tr:last-child td {
    border-bottom: 0;
}

/* عنوان هر مشخصه */
.product-tabs__panel table th,
.product-tabs__panel .woocommerce-product-attributes th {
    width: 220px;
    border-left: 1px solid #ebedf1;
    background: #f8f9fb;

    color: #1d2b48;
    font-weight: 600;
}

/* مقدار هر مشخصه */
.product-tabs__panel table td,
.product-tabs__panel .woocommerce-product-attributes td {
    background: #ffffff;
    color: #5b6473;
}

.product-tabs__panel .woocommerce-product-attributes-item__value p {
    margin: 0;
}

/* =========================================
   Comments tab minor adjustments
========================================= */

.product-tabs__panel .woocommerce-Reviews,
.product-tabs__panel #reviews {
    width: 100%;
}

.product-tabs__panel .commentlist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-tabs__panel .commentlist li {
    margin-bottom: 1rem;
}

/* =========================================
   Tab opening animation
========================================= */

@keyframes productTabFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Tablet
========================================= */

@media (max-width: 768px) {
    .product-details__container {
        padding-inline: 0.85rem;
    }

    .product-tabs {
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .product-tabs__button {
        min-height: 60px;
        gap: 0.5rem;
        padding-bottom: 0.8rem;
        font-size: 0.9rem;
    }

    .product-tabs__icon {
        width: 21px;
        height: 21px;
    }

    .product-tabs__panel {
        font-size: 0.92rem;
    }

    .product-tabs__panel table th,
    .product-tabs__panel table td,
    .product-tabs__panel .woocommerce-product-attributes th,
    .product-tabs__panel .woocommerce-product-attributes td {
        padding: 0.85rem 1rem;
        font-size: 0.88rem;
    }

    .product-tabs__panel table th,
    .product-tabs__panel .woocommerce-product-attributes th {
        width: 34%;
    }
}

/* =========================================
   Mobile
========================================= */

@media (max-width: 575px) {
    .product-tabs {
        gap: 0;
        justify-content: space-between;
    }

    .product-tabs__button {
        flex: 1 1 0;
        flex-direction: column;
        gap: 0.25rem;

        min-height: 72px;
        padding: 0.55rem 0.25rem 0.75rem;

        font-size: 0.78rem;
        white-space: normal;
    }

    .product-tabs__icon {
        width: 20px;
        height: 20px;
    }

    .product-tabs__button::after {
        height: 2px;
    }

    .product-tabs__panel {
        font-size: 0.9rem;
        line-height: 2;
    }

    /* اسکرول افقی فقط در صورت بزرگ بودن جدول */
    .product-tabs__panel:has(table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-tabs__panel table,
    .product-tabs__panel .woocommerce-product-attributes {
        min-width: 500px;
    }

    .product-tabs__panel table th,
    .product-tabs__panel table td,
    .product-tabs__panel .woocommerce-product-attributes th,
    .product-tabs__panel .woocommerce-product-attributes td {
        padding: 0.75rem;
        font-size: 0.84rem;
    }

    .product-tabs__panel table th,
    .product-tabs__panel .woocommerce-product-attributes th {
        width: 170px;
    }
}

/* مشخصات فنی محصول - استایل مشابه تصویر مرجع */
.product-tabs__panel .woocommerce-product-attributes {
    width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 18px 10px;
    direction: rtl;
    margin: 0;
}

/* هر ردیف */
.product-tabs__panel .woocommerce-product-attributes tr {
    border: 0;
}

/* عنوان ویژگی؛ سمت راست */
.product-tabs__panel
.woocommerce-product-attributes-item__label {
    width: 22%;
    min-width: 180px;
    padding: 20px 24px;
    background: #f7f7f7;
    border: 0;
    border-radius: 0 16px 16px 0;
    color: #1d2b48;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.8;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

/* مقدار ویژگی؛ سمت چپ */
.product-tabs__panel
.woocommerce-product-attributes-item__value {
    padding: 20px 24px;
    background: #f7f7f7;
    border: 0;
    border-radius: 16px 0 0 16px;
    color: #555;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    text-align: right;
    vertical-align: middle;
}

/* حذف فاصله‌های اضافی داخل مقدار */
.product-tabs__panel
.woocommerce-product-attributes-item__value p {
    margin: 0;
}

/* لینک‌های داخل مشخصات */
.product-tabs__panel
.woocommerce-product-attributes-item__value a {
    color: inherit;
    text-decoration: none;
}

/* اگر مقدار شامل چند مورد یا لیست بود */
.product-tabs__panel
.woocommerce-product-attributes-item__value ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 768px) {
    .product-tabs__panel .woocommerce-product-attributes {
        border-spacing: 8px;
    }

    .product-tabs__panel
    .woocommerce-product-attributes-item__label {
        width: 32%;
        min-width: 110px;
        padding: 14px 12px;
        font-size: 13px;
        border-radius: 0 12px 12px 0;
    }

    .product-tabs__panel
    .woocommerce-product-attributes-item__value {
        padding: 14px 12px;
        font-size: 13px;
        border-radius: 12px 0 0 12px;
    }
}

