/*
Theme Name: bamoosepidan-theme
Theme URI: https://bamoosepidan.com
Description: قالب اختصاصی باموسپیدان - نسخه بهینه‌سازی‌شده بر پایه Adforest با رفع کامل خطاها، بهینه‌سازی عملکرد، پشتیبانی RTL/فارسی و امکانات پیشرفته
Author: باموسپیدان
Author URI: https://bamoosepidan.com
Template: adforest
Version: 1.0.0
License: RTL-Theme License
License URI: https://rtl-theme.com
Text Domain: bamoosepidan
Tags: classifieds, rtl, persian, farsi, optimized, responsive
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ===================================================
   قالب فرزند باموسپیدان
   فایل‌های اضافی در functions.php بارگذاری می‌شوند
   =================================================== */

/* ---- اصلاح ریسپانسیو جداول ---- */
.entry-content table,
.wp-block-table table,
.woocommerce table,
.adforest-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- اصلاح z-index برگر منو ---- */
.burger-menu {
    position: relative !important;
    z-index: 9999 !important;
    cursor: pointer;
}
.sb-menu > ul {
    z-index: 9998 !important;
}
@media (max-width: 991px) {
    .sb-menu > ul {
        display: none;
        width: 100%;
    }
    .sb-menu > ul.menu-open {
        display: block !important;
    }
}

/* ---- بهینه‌سازی نقشه Leaflet ---- */
.leaflet-container {
    z-index: 1;
}
.leaflet-pane {
    z-index: 4;
}
.leaflet-overlay-pane {
    z-index: 4;
}
.leaflet-marker-pane {
    z-index: 6;
}
.leaflet-tooltip-pane {
    z-index: 7;
}
.leaflet-popup-pane {
    z-index: 8;
}
.leaflet-map-pane canvas {
    z-index: 1;
}
.leaflet-map-pane svg {
    z-index: 2;
}

/* ---- تایپوگرافی پایه RTL/فارسی ---- */
body {
    font-family: var(--bmp-font-body, 'Vazirmatn', 'IRANSans', Tahoma, Arial, sans-serif) !important;
    font-size: var(--bmp-font-size-base, 14px);
    color: var(--bmp-color-text, #333);
    background-color: var(--bmp-color-bg, #fff);
    direction: rtl;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--bmp-font-heading, 'Vazirmatn', 'IRANSans', Tahoma, Arial, sans-serif) !important;
    color: var(--bmp-color-heading, #222);
    font-weight: var(--bmp-font-weight-heading, 700);
}
a {
    color: var(--bmp-color-primary, #1e88e5);
    transition: color 0.2s ease;
}
a:hover {
    color: var(--bmp-color-primary-hover, #1565c0);
}
.btn-primary, .sb-btn-primary {
    background-color: var(--bmp-color-primary, #1e88e5) !important;
    border-color: var(--bmp-color-primary, #1e88e5) !important;
    color: var(--bmp-color-btn-text, #fff) !important;
}
.btn-primary:hover {
    background-color: var(--bmp-color-primary-hover, #1565c0) !important;
    border-color: var(--bmp-color-primary-hover, #1565c0) !important;
}

/* ---- آگهی استایل ۱: کارت مینیمال ---- */
.bmp-ad-layout-1 .sb-ad-box {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    background: #fff;
}
.bmp-ad-layout-1 .sb-ad-box:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transform: translateY(-3px);
}
.bmp-ad-layout-1 .sb-ad-box .ad-img {
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}
.bmp-ad-layout-1 .sb-ad-box .ad-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 10px 12px 4px;
}
.bmp-ad-layout-1 .sb-ad-box .ad-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bmp-color-primary, #1e88e5);
    margin: 0 12px 10px;
}

/* ---- آگهی استایل ۲: لیست مدرن ---- */
.bmp-ad-layout-2 .sb-ad-box {
    display: flex;
    flex-direction: row;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    background: #fff;
    margin-bottom: 14px;
    transition: box-shadow 0.2s;
    overflow: hidden;
}
.bmp-ad-layout-2 .sb-ad-box:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.09);
}
.bmp-ad-layout-2 .sb-ad-box .ad-img {
    width: 180px;
    min-width: 180px;
    max-height: 140px;
    overflow: hidden;
}
.bmp-ad-layout-2 .sb-ad-box .ad-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bmp-ad-layout-2 .sb-ad-box .ad-content {
    padding: 14px 16px;
    flex: 1;
}
.bmp-ad-layout-2 .sb-ad-box .ad-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.bmp-ad-layout-2 .sb-ad-box .ad-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bmp-color-primary, #1e88e5);
}
@media (max-width: 576px) {
    .bmp-ad-layout-2 .sb-ad-box {
        flex-direction: column;
    }
    .bmp-ad-layout-2 .sb-ad-box .ad-img {
        width: 100%;
        min-width: unset;
        max-height: 200px;
    }
}

/* ---- آگهی استایل ۳: ماسونری مینیمال ---- */
.bmp-ad-layout-3 .sb-ads-grid {
    column-count: 3;
    column-gap: 16px;
}
.bmp-ad-layout-3 .sb-ad-box {
    break-inside: avoid;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 16px;
    background: #fff;
    transition: box-shadow 0.2s;
}
.bmp-ad-layout-3 .sb-ad-box:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
}
@media (max-width: 768px) {
    .bmp-ad-layout-3 .sb-ads-grid { column-count: 2; }
}
@media (max-width: 480px) {
    .bmp-ad-layout-3 .sb-ads-grid { column-count: 1; }
}

/* ---- پنل کاربری استایل ۱: مدرن کارتی ---- */
.bmp-dashboard-style-1 .dashboard-wrapper {
    background: #f7f8fc;
    min-height: 100vh;
}
.bmp-dashboard-style-1 .dashboard-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px 0;
}
.bmp-dashboard-style-1 .dashboard-sidebar .user-avatar {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
}
.bmp-dashboard-style-1 .dashboard-sidebar .user-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bmp-color-primary, #1e88e5);
}
.bmp-dashboard-style-1 .dashboard-sidebar .nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #555;
    border-right: 3px solid transparent;
    transition: all 0.2s;
}
.bmp-dashboard-style-1 .dashboard-sidebar .nav-item a:hover,
.bmp-dashboard-style-1 .dashboard-sidebar .nav-item.active a {
    background: #f0f6ff;
    color: var(--bmp-color-primary, #1e88e5);
    border-right-color: var(--bmp-color-primary, #1e88e5);
}
.bmp-dashboard-style-1 .dashboard-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
}

/* ---- پنل کاربری استایل ۲: تاریک/مدرن ---- */
.bmp-dashboard-style-2 .dashboard-wrapper {
    background: #1a1f2e;
    min-height: 100vh;
    color: #e0e0e0;
}
.bmp-dashboard-style-2 .dashboard-sidebar {
    background: #22283a;
    border-radius: 12px;
    padding: 20px 0;
}
.bmp-dashboard-style-2 .dashboard-sidebar .user-avatar {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #2d3448;
    margin-bottom: 12px;
}
.bmp-dashboard-style-2 .dashboard-sidebar .user-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4f8aff;
}
.bmp-dashboard-style-2 .dashboard-sidebar .nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #aaa;
    border-right: 3px solid transparent;
    transition: all 0.2s;
}
.bmp-dashboard-style-2 .dashboard-sidebar .nav-item a:hover,
.bmp-dashboard-style-2 .dashboard-sidebar .nav-item.active a {
    background: rgba(79,138,255,0.12);
    color: #4f8aff;
    border-right-color: #4f8aff;
}
.bmp-dashboard-style-2 .dashboard-content {
    background: #22283a;
    border-radius: 12px;
    padding: 24px;
    color: #e0e0e0;
}

/* ---- آمار بازدید ادمین ---- */
.bmp-stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f6ff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #1e88e5;
    margin: 4px 2px;
}
.bmp-stats-badge .dashicons {
    font-size: 14px;
    line-height: 1.4;
}
