/**
 * global.css
 *
 * استایل‌های سراسری سایت رادیا الکترونیک.
 * این فایل در همه صفحات لود می‌شود.
 *
 * بخش‌ها:
 *   1. فونت و تایپوگرافی سراسری (فونت، رنگ متن، هدینگ‌ها، لینک‌ها)
 *   2. اسکرول‌بار سفارشی
 *   3. منوی ناوبری
 *   4. پری‌لودر
 *   5. بلاگ و مقالات
 *   6. متفرقه
 *
 * فایل‌های CSS اختصاصی:
 *   - single-product.css  → صفحه محصول
 *   - cart.css            → صفحه سبد خرید
 */

/* ─── ۱. فونت و تایپوگرافی سراسری ─────────────────────────────────────────── */

/* ─── ۱.۱ تعریف فونت ──────────────────────────────────────────────────────── */

@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;
}

/* ─── ۱.۲ تایپوگرافی سراسری ────────────────────────────────────────────────── */

/* فونت متن اصلی */
body {
    font-family: 'IRANYekanXVF', Tahoma, Arial, sans-serif;
    text-align: justify;
    text-justify: inter-word;
    direction: rtl;
}

/* اعمال فونت به المان‌های متنی — بدون دست زدن به آیکون‌ها و ویجت‌های قالب */
p, h1, h2, h3, h4, h5, h6,
li, td, th, label, input, textarea, select,
blockquote, figcaption, cite, small, strong, em, b {
    font-family: 'IRANYekanXVF', Tahoma, Arial, sans-serif;
}

/* ─── ۲. اسکرول‌بار سفارشی ─────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F6F8FC;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #C0C8D0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1b4f72;
}

/* ─── ۳. منوی ناوبری ────────────────────────────────────────────────────────── */

/* خط جداکننده بین آیتم‌های منوی چسبان */
.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: #C0C8D0;
    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;
}

/* هاور کل ردیف منوی چسبان عمودی */
.wd-sticky-nav .wd-nav-vertical .menu-item .woodmart-nav-link:hover {
    background-color: #F1F8FF;
    border-radius: 8px;
}

/* آیکون‌های منوی اصلی افقی */
.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;
}

/* ─── ۴. پری‌لودر ────────────────────────────────────────────────────────────── */

#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;
}

/* ─── ۵. بلاگ و مقالات ──────────────────────────────────────────────────────── */

.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: #2471A3;
    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;
}
.rmp-rating { font-size: 28px; }
.rmp-result {
    font-size: 14px;
    margin-top: 8px;
}
.rmp-main-container,
.rmp-main-container h5,
.rmp-main-container p,
.rmp-main-container span,
.rmp-main-container div {
    color: #ffffff !important;
}