/* ================================================================
   تب‌بندی بخش‌های پایین صفحه محصول
   توضیحات | مشخصات | پرسش‌های متداول | نظرات
   - دسکتاپ: خط زیرین فعال (indicator) با انیمیشن نرم
   - موبایل: نوار افقی قابل اسکرول، چسبان زیر هدر، تب فعال در مرکز
   ================================================================ */

.product-tabs {
    grid-column: 1 / -1;
    margin-top: 28px;
    /* فاصله از هدر چسبان هنگام اسکرول با hash */
    scroll-margin-top: calc(var(--header-height, 76px) + 12px);
}

/* [hidden] همیشه برنده باشد (جلوگیری از تداخل با display های دیگر) */
.product-tabs [hidden] { display: none !important; }

/* ---------- نوار تب ---------- */
.product-tabs__bar {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 2px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.product-tabs__bar::-webkit-scrollbar { display: none; }

.product-tabs__tab {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    padding: 12px 20px 14px;
    font-family: 'Vazir', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.25s ease;
    flex: 0 0 auto;
}

.product-tabs__tab:hover { color: #334155; }

.product-tabs__tab.is-active { color: #4f46e5; }

.product-tabs__tab:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.45);
    outline-offset: -3px;
    border-radius: 10px;
}

.product-tabs__count {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 3px;
}

.product-tabs__tab.is-active .product-tabs__count { color: #818cf8; }

/* خط زیرین فعال (indicator متحرک) */
.product-tabs__indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 3px;
    width: 0;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

/* ---------- پنل‌ها ---------- */
.product-tabs__panels { padding-top: 22px; }

.product-tabs__panel { animation: productTabFade 0.35s ease; }

@keyframes productTabFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .product-tabs__panel { animation: none; }
    .product-tabs__indicator { transition: none; }
}

.product-tabs__panel:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 4px;
    border-radius: 8px;
}

/* عنوان داخل پنل — هماهنگ با استایل h2های قبلی سایت (نوار کناری رنگی) */
.product-tabs__title {
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-right: 16px;
}

.product-tabs__title::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #764ba2 100%);
    border-radius: 9999px;
}

/* بخش FAQ داخل تب — حذف حاشیه کارت قبلی */
.product-tabs__panel .product-faqs__list { margin: 0; }

/* بخش نظرات داخل تب — بدون ظاهر کارت جدا (پنل تب خودش جای آن است) */
.reviews-section--panel {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ---------- موبایل/تبلت: نوار چسبان زیر هدر + اسکرول افقی ---------- */
@media (max-width: 992px) {
    .product-tabs {
        scroll-margin-top: calc(var(--header-height, 76px) + 52px);
        margin-top: 22px;
    }

    .product-tabs__bar {
        position: sticky;
        top: var(--header-height, 76px);
        z-index: 60;
        background: #fff;
        /* پهنای نوار کمی فراتر از پنل تا لبه‌ها در حالت چسبان خالی نمانند */
        margin: 0 -20px;
        padding: 0 12px;
        border-bottom: 2px solid #e2e8f0;
        box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.25);
    }

    .product-tabs__tab {
        padding: 10px 14px 12px;
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .product-tabs__tab { padding: 9px 11px 11px; font-size: 0.84rem; }
    .product-tabs__count { font-size: 0.72rem; }
}
