/**
 * global.css
 *
 * استایل‌های سراسری سایت رادیا الکترونیک.
 * این فایل در همه صفحات لود می‌شود.
 *
 * بخش‌ها:
 *   1. فونت IRANYekanXVF
 *   2. اسکرول‌بار سفارشی
 *   3. منوی ناوبری
 *   4. پری‌لودر
 *   5. فرم پرسش و پاسخ
 *   6. نوار موبایل سبد خرید
 *   7. بلاگ و مقالات
 *   8. متفرقه
 */

/* ─── ۱. فونت ──────────────────────────────────────────────────────────────── */

@font-face {
    font-family: 'IRANYekanXVF';
    src: url('/wp-content/uploads/fonts/IRANYekanXVF.woff2') format('woff2'),
         url('/wp-content/uploads/fonts/IRANYekanXVF.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ─── ۲. اسکرول‌بار سفارشی ─────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #A0A0A0;
}

/* ─── ۳. منوی ناوبری ────────────────────────────────────────────────────────── */

/* خط جداکننده بین آیتم‌های منوی چسبان */
.wd-sticky-nav.wd-hide-md .menu-item {
    position: relative;
}
.wd-sticky-nav.wd-hide-md .menu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background-color: #F0F0F0;
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

/* چینش آیکون و متن منو */
.menu-item a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    text-align: right;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.5;
}

/* آیکون‌های منوی چسبان عمودی */
.wd-sticky-nav .wd-nav-vertical .menu-item .woodmart-nav-link .wd-nav-img {
    font-size: 24px !important;
    height: auto !important;
    width: auto !important;
    transform: scale(1.5) !important;
    transition: transform 0.3s ease !important;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
}
.wd-sticky-nav .wd-nav-vertical .menu-item .woodmart-nav-link .wd-nav-img:hover {
    transform: scale(1.3) !important;
    box-shadow: 0 6px 12px rgba(0,0,0,.15);
}
.wd-sticky-nav .wd-nav-vertical .menu-item .woodmart-nav-link .wd-nav-img img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: none;
}

/* آیکون‌های منوی اصلی افقی */
.whb-header .whb-main-header .whb-flex-flex-middle .wd-nav-img {
    font-size: 16px !important;
    height: 16px !important;
    width: 16px !important;
    transform: scale(1.2) !important;
    transition: transform 0.3s ease !important;
}
#menu-header-menu-radya-electronic .menu-item .woodmart-nav-link .wd-nav-img {
    font-size: 32px !important;
    transform: scale(1.5) !important;
}

/* فونت نازک منوی افقی */
.menu.wd-nav.wd-nav-main .nav-link-text {
    font-weight: 400;
}

/* تصاویر دایره‌ای دسته‌بندی در منو */
.menu-item.menu-item-type-taxonomy.menu-item-object-product_cat img {
    min-height: 22px;
    min-width: 22px;
    border-radius: 50%;
    object-fit: cover;
}

/* هاور ابزارهای هدر */
.wd-tools-text:hover {
    background-color: #E0F7FA;
    border-radius: 10px;
    color: #00796B;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

/* ─── ۴. پری‌لودر ────────────────────────────────────────────────────────────── */

#preloader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .35s ease, visibility .35s ease;
}

/* ─── پرسش و پاسخ (طراحی جدید) ─────────────────────────────────────────────── */

.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: #E4F4F4;
    color: #009999;
}
.radia-qa-icon--a {
    background-color: #009999;
    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;
}

/* نام کاربر */
.radia-qa-author {
    font-size: 12px;
    color: #009999;
    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;
}

/* برچسب فروشگاه */
.radia-qa-store-label {
    font-size: 12px;
    color: #009999;
    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;
    }
}

:root {
    --btn-bg: #E4F4F4;
    --btn-text: #009999;
    --btn-bg-hover: #009999;
    --btn-text-hover: #fff;
    --related-link: #009999;
    --related-link-hover: #009999;
}

.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: #f9f9f9;
}
.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;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    font-family: inherit;
}
.user-question-form button:hover {
    background-color: var(--btn-bg-hover);
    color: var(--btn-text-hover);
}
.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-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-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: #009999;
    font-family: inherit;
}
.faq-author {
    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: #444;
}
.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;
}

/* ─── ۶. نوار موبایل سبد خرید ──────────────────────────────────────────────── */
/* نکته: استایل نوار محصول داخل mobile-bar.php مدیریت می‌شود */

.mobile-fixed-bar-cart {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 10px 16px;
    box-shadow: 0 -1px 5px rgba(0,0,0,.1);
    border-top: 1px solid #eee;
    z-index: 9999;
    font-family: inherit;
}
.checkout-btn-wdm {
    background-color: #E4F4F4;
    color: #009999;
    padding: 10px 16px;
    width: 100%;
    border-radius: 8px;
    font-size: 15px;
    border: none;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background-color .3s, color .3s;
}
.checkout-btn-wdm:hover {
    background-color: #009999;
    color: #fff;
}
.checkout-btn-wdm:hover .divider {
    background-color: rgba(255,255,255,.4);
}
.checkout-btn-wdm .btn-text {
    font-weight: 600;
    font-size: 15px;
}
.checkout-btn-wdm .divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background-color: #ccc;
    flex-shrink: 0;
}
.checkout-btn-wdm .cart-total {
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    font-family: inherit;
}
@media (min-width: 768px) {
    .mobile-fixed-bar-cart { display: none; }
}

/* ─── ۷. بلاگ و مقالات ──────────────────────────────────────────────────────── */

.elementor-post__excerpt,
.wd-post-desc,
.entry-summary {
    text-align: justify !important;
    line-height: 1.8;
    word-spacing: 0.05em;
}

.single-post .elementor-widget-text-editor {
    direction: rtl !important;
    text-align: justify !important;
    text-align-last: right !important;
    font-family: 'IRANYekanXVF', Tahoma, Arial, sans-serif !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
    word-spacing: 0.03em !important;
    overflow-wrap: break-word !important;
}
.single-post .elementor-widget-text-editor p {
    padding-left: 6px !important;
    padding-right: 6px !important;
    margin: 0 !important;
}

/* حذف فاصله اضافی در موبایل و تبلت */
@media (max-width: 1024px) {
    .single-post .elementor-section,
    .single-post .elementor-container,
    .single-post .elementor-column,
    .single-post .elementor-widget-text-editor,
    .single-post .elementor-widget-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }
}

body.blog .wd-sidebar-opener { display: none !important; }
body.blog .wd-toolbar,
body.woodmart-archive-blog .wd-toolbar { display: none !important; }

/* ─── ۸. متفرقه ─────────────────────────────────────────────────────────────── */

/* تراز متن فیلدهای ACF و المنتور */
.acf-field,
.acf-field p,
.acf-field div,
[data-field-name] p,
[data-field-name] div,
.elementor-widget-text-editor p,
.elementor-widget-text-editor div {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 2;
}

/* جعبه امتیازدهی */
.rmp-main-container {
    background-color: #E4F4F4;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
    box-shadow: 0 4px 10px rgba(0,0,0,.05);
}
.rmp-main-container h5 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}
.rmp-rating { font-size: 28px; }
.rmp-result {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* ریسپانسیو فرم پرسش و پاسخ */
@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; }
}
