/**
 * single-product.css
 *
 * استایل‌های اختصاصی صفحه محصول رادیا الکترونیک.
 * این فایل فقط در صفحه محصول لود می‌شود (از طریق enqueue.php).
 *
 * بخش‌ها:
 *   1.  تاریخ بروزرسانی قیمت
 *   2.  جدول ویژگی‌های محصول
 *   3.  رنگ‌بندی تایپوگرافی (هدینگ‌ها و لینک‌ها)
 *   4.  نوار ابزار صفحه محصول
 *   5.  زبانه‌های المنتور (دسکتاپ)
 *   6.  زبانه‌های المنتور (موبایل و تبلت)
 *   7.  فرم پرسش و پاسخ
 *   8.  نمایش پرسش و پاسخ (Q&A)
 *   9.  بج نظرات (خریدار / کاربر)
 *   10. ویدیوی آپارات
 *   11. لیست FAQ محصول
 *   12. نظرات کاربران
 *   13. شمارنده رنگی
 */

/* ─── ۱. تاریخ بروزرسانی قیمت ──────────────────────────────────────────────── */

.radia-price-update {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
    font-size: 14px !important;
    color: #333;
    white-space: nowrap;
}
.radia-price-update .pulse-dot {
    width: 12px;
    height: 12px;
    background: #4caf50;
    border-radius: 50%;
    flex-shrink: 0;
    animation: radia-pulse 1.5s infinite;
}
@keyframes radia-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.5); opacity: .6; }
    100% { transform: scale(1);   opacity: 1; }
}
@media (max-width: 480px) {
    .radia-price-update {
        font-size: 13px;
        gap: 6px;
    }
    .radia-price-update .pulse-dot {
        width: 10px;
        height: 10px;
    }
}

/* ─── ۲. جدول ویژگی‌های محصول ──────────────────────────────────────────────── */

.vizhegiha .shop_attributes {
    overflow: visible;
    margin-top: 20px;
}
.vizhegiha .shop_attributes tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    column-gap: 20px;
    row-gap: 15px;
}
.vizhegiha .shop_attributes tr {
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 15px rgba(70,72,77,.06);
    border-bottom: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}
.vizhegiha .shop_attributes tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(70,72,77,.1);
}
.vizhegiha .shop_attributes th,
.vizhegiha .shop_attributes td {
    padding: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .vizhegiha .shop_attributes tbody {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 10px;
        row-gap: 12px;
    }
    .vizhegiha .shop_attributes tr {
        flex-direction: column;
        padding: 10px 12px;
    }
    .vizhegiha .shop_attributes th,
    .vizhegiha .shop_attributes td {
        width: 100%;
        text-align: right;
        font-size: 13px;
    }
}

/* ─── ۳. رنگ‌بندی تایپوگرافی صفحه محصول ───────────────────────────────────── */

/* حذف شد */

/* ─── ۴. نوار ابزار صفحه محصول ─────────────────────────────────────────────── */

body.single-product .wd-toolbar,
body.single-post .wd-toolbar {
    display: none !important;
}

/* ─── ۵. زبانه‌های المنتور (دسکتاپ) ───────────────────────────────────────── */

@media (min-width: 1024px) {
    .e-n-tabs-heading {
        display: flex !important;
        gap: 12px !important;
        border-bottom: 2px solid #C0C8D0 !important;
        flex-wrap: wrap !important;
    }
    .e-n-tabs-heading .e-n-tab-title {
        padding: 8px 16px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        position: relative !important;
        cursor: pointer !important;
    }
    .e-n-tabs-heading .e-n-tab-title::after {
        content: '' !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) scaleX(0) !important;
        transform-origin: center !important;
        width: 100% !important;
        height: 3px !important;
        background-color: #1B4F72 !important;
        transition: transform 0.3s ease !important;
    }
    .e-n-tabs-heading .e-n-tab-title:hover {
    }
    .e-n-tabs-heading .e-n-tab-title:hover::after {
        transform: translateX(-50%) scaleX(1) !important;
    }
    .e-n-tabs-heading .e-n-tab-title.active {
        color: #ffffff !important;
    }
    .e-n-tabs-heading .e-n-tab-title.active::after {
        transform: translateX(-50%) scaleX(1) !important;
    }
}

/* ─── ۶. زبانه‌های المنتور (موبایل و تبلت) ─────────────────────────────────── */

@media (max-width: 1023px) {
    .e-n-tabs.e-activated {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        border-bottom: none;
    }
    .e-n-tabs.e-activated .e-n-tab-title {
        padding: 8px 12px;
        font-size: 14px;
        font-weight: 600;
        position: relative;
        cursor: pointer;
        white-space: normal;
        flex-shrink: 0;
        text-align: center;
    }
    .e-n-tabs.e-activated .e-n-tab-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: #1B4F72;
        opacity: 0;
        transition: opacity 0.25s ease;
        will-change: opacity;
    }
    .e-n-tabs.e-activated .e-n-tab-title:hover::after,
    .e-n-tabs.e-activated .e-n-tab-title.active::after {
        opacity: 1;
    }
}

/* ─── ۷. فرم پرسش و پاسخ ────────────────────────────────────────────────────── */

:root {
    --btn-bg: #1B4F72;
    --btn-text: #ffffff;
    --related-link: #2471A3;
    --related-link-hover: #1B4F72;
}

.user-question-form {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 24px;
    font-family: inherit;
    font-size: 15px;
    box-sizing: border-box;
    margin-top: 40px;
}
.user-question-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: inherit;
}
.user-question-form textarea,
.user-question-form select {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: transparent;
    font-family: inherit;
    margin-bottom: 20px;
    box-sizing: border-box;
    text-align: right;
}
.user-question-form .acf-checkbox-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F6F8FC;
}
.user-question-form .acf-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: normal;
    font-family: inherit;
}
.user-question-form button {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    font-family: inherit;
}
.uq-success,
.uq-error {
    font-weight: 600;
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    font-family: inherit;
}
.uq-success { color: green; }
.uq-error   { color: red; }

/* لیست قدیمی FAQ */
.faq-list {
    font-family: inherit;
    font-size: 15px;
    margin-top: 40px;
}
.faq-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}
.faq-item h3 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #444;
}
.faq-store-answer {
    font-size: 14px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #1B4F72;
}
.faq-answer {
    font-size: 15px;
    line-height: 1.8;
    color: #777;
    text-align: justify;
    font-family: inherit;
}
.related-products {
    font-size: 14px;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.related-products ul {
    padding-left: 20px;
    margin: 0;
}
.related-products li {
    margin-bottom: 8px;
}
.related-products a {
    color: var(--related-link);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s ease;
}
.related-products a:hover {
    color: var(--related-link-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .user-question-form,
    .faq-list { padding: 15px; }
    .user-question-form button { width: 100%; }
    .user-question-form textarea,
    .user-question-form select { font-size: 14px; }
    .faq-item h3 { font-size: 15px; }
    .faq-answer { font-size: 14px; }
    .user-question-form .acf-checkbox-list { max-height: 400px; }
}

/* ─── ۸. نمایش پرسش و پاسخ (Q&A) ───────────────────────────────────────────── */

.radia-qa-list {
    font-family: inherit;
    margin-top: 16px;
    max-width: 100%;
}
.radia-qa-item {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.radia-qa-question {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    direction: rtl;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.radia-qa-answer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    direction: rtl;
    background: #fff;
}
.radia-qa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.4;
    margin-top: 2px;
}
.radia-qa-icon--q {
    background-color: #F6F8FC;
    color: #1B4F72;
}
.radia-qa-icon--a {
    background-color: #1B4F72;
    color: #fff;
}
.radia-qa-question-body {
    flex: 1;
    min-width: 0;
}
.radia-qa-question-body p {
    margin: 4px 0 0;
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    text-align: justify;
}
.radia-qa-author {
    font-size: 12px;
    color: #2471A3;
    font-weight: 600;
}
.radia-qa-answer-body {
    flex: 1;
    min-width: 0;
}
.radia-qa-answer-body div {
    margin: 4px 0 0;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    text-align: justify;
}
.radia-qa-store-label {
    font-size: 12px;
    color: #1B4F72;
    font-weight: 600;
}

@media (max-width: 768px) {
    .radia-qa-question,
    .radia-qa-answer {
        padding: 12px 14px;
        gap: 10px;
    }
    .radia-qa-icon {
        font-size: 11px;
        padding: 3px 10px;
    }
    .radia-qa-question-body p,
    .radia-qa-answer-body div {
        font-size: 13px;
    }
}

/* ─── ۹. بج نظرات (خریدار / کاربر) ───────────────────────────────────────── */

.wc-review-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
    margin-left: 6px;
    line-height: 1.4;
    vertical-align: middle;
}
.buyer-badge { background-color: #0f9d58; }
.user-badge  { background-color: #999; }

@media (max-width: 767px) {
    .wc-review-badge { font-size: 10px; padding: 1px 4px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .wc-review-badge { font-size: 10.5px; padding: 2px 5px; }
}

/* ─── ۱۰. ویدیوی آپارات ─────────────────────────────────────────────────────── */

.radia-video-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    overflow: hidden;
}
.radia-video-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ─── ۱۱. لیست FAQ محصول ───────────────────────────────────────────────────── */

.radia-faq-question-title {
    color: #2471A3;
}
.radia-faq-answer-body {
    margin-top: 5px;
}

/* ─── ۱۲. نظرات کاربران ────────────────────────────────────────────────────── */

.woocommerce #reviews .comment-text p,
.woocommerce #reviews .description p,
.woocommerce .commentlist .comment-text p {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 1.8;
}

/* ─── ۱۳. شمارنده رنگی ─────────────────────────────────────────────────────── */

.text-colored-count {
    color: #2471A3;
    font-weight: bold;
}

/* ─── ۱۴. نوار چسبان افزودن به سبد خرید (موبایل) ──────────────────────────── */

@media (max-width: 768px) {

    /* فضای اضافه در پایین صفحه تا محتوا زیر نوار مخفی نشه */
    .single-product .site-main {
        padding-bottom: 80px;
    }

    /* نوار اصلی */
    .radia-sticky-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 10px 16px;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        direction: rtl;
        font-family: inherit;
        box-sizing: border-box;
    }

    /* مخفی کردن state ها */
    .radia-hidden {
        display: none !important;
    }

    /* state عمومی */
    .radia-sticky-state {
        width: 100%;
    }

    /* ─── حالت ۱: انتخاب وضعیت ─── */
    .radia-state-select {
        text-align: center;
        padding: 8px 0;
    }
    .radia-select-msg {
        font-size: 15px;
        font-weight: 700;
        color: #1B4F72;
        font-family: 'IRANYekanXVF', Tahoma, Arial, sans-serif;
    }

    /* ─── حالت ۲: افزودن به سبد ─── */
    #radia-state-add {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: row-reverse;
        gap: 10px;
    }

    /* ─── حالت ۳: بعد از افزودن ─── */
    #radia-state-cart {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .radia-cart-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: row-reverse;
    }

    /* ─── قیمت ─── */
    .radia-price-area {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }
    .radia-old-price {
        font-size: 12px;
        color: #999;
        text-decoration: line-through;
    }
    .radia-old-price .woocommerce-Price-amount {
        font-size: 12px;
        color: #999;
    }
    .radia-discount-badge {
        background: #e53935;
        color: #fff;
        font-size: 11px;
        font-weight: bold;
        padding: 2px 6px;
        border-radius: 4px;
    }
    .radia-final-price {
        font-size: 14px;
        font-weight: bold;
        color: #1B4F72;
    }
    .radia-final-price .woocommerce-Price-amount {
        font-size: 14px;
        font-weight: bold;
        color: #1B4F72;
    }

    /* ─── دکمه‌ها ─── */
    .radia-btn {
        display: block;
        text-align: center;
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        border: none;
        text-decoration: none;
        font-family: inherit;
        box-sizing: border-box;
    }
    .radia-btn-add {
        background: #1B4F72;
        color: #fff;
        flex-shrink: 0;
        min-width: 140px;
    }
    .radia-btn-add:disabled {
        background: #bbb;
        cursor: not-allowed;
    }
    .radia-btn-cart {
        background: transparent;
        color: #1B4F72;
        border: 1.5px solid #1B4F72;
        width: 100%;
    }

    /* ─── تعداد ─── */
    .radia-qty-wrap {
        display: flex;
        align-items: center;
        gap: 10px;
        border: 1.5px solid #1B4F72;
        border-radius: 8px;
        padding: 4px 12px;
    }
    .radia-qty-btn {
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #1B4F72;
        line-height: 1;
        padding: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: inherit;
    }
    .radia-qty-num {
        font-size: 14px;
        font-weight: bold;
        min-width: 20px;
        text-align: center;
        color: #1B4F72;
    }

    /* ─── ناموجود ─── */
    .radia-state-unavailable {
        text-align: center;
        padding: 8px 0;
        font-size: 15px;
        font-weight: 700;
        color: #1B4F72;
        font-family: 'IRANYekanXVF', Tahoma, Arial, sans-serif;
    }
}