/*
Theme Name: وردپرس کمک
Theme URI: http://example.com/wp-komak
Author: شما
Author URI: http://example.com
Description: یک قالب فروشگاهی و محتوایی زیبا برای وردپرس (نسخه پیشرفته هدر).
Version: 3.0
License: GNU General Public License v2 or later
Text Domain: wp-komak
*/

/* پایه و ریست */
body { direction: rtl; text-align: right; font-family: Tahoma, Arial, sans-serif; margin: 0; padding: 0; background-color: #f4f4f9; color: #333; line-height: 1.6; overflow-x: hidden; }
* { box-sizing: border-box; }
a { text-decoration: none; transition: all 0.3s ease; }
img { max-width: 100%; height: auto; }

/* کلاس کانتینر برای وسط‌چین کردن */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* هدر سایت */
header { background: #2271b1; color: #ffffff; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 900; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; }

/* دکمه همبرگری موبایل */
.mobile-menu-toggle { display: none; cursor: pointer; color: #fff; padding: 5px; }

/* لوگو */
.logo h1 { margin: 0; font-size: 24px; white-space: nowrap; }
.logo a { color: #ffffff; }

/* منوی دسکتاپ */
.offcanvas-header { display: none; }
.main-menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 25px; }
.main-menu a { color: #fff; font-weight: bold; font-size: 15px; position: relative; }
.main-menu a:hover { color: #ffeb3b; }

/* آیکون‌های هدر (ورود و سبد خرید) */
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions .icon-btn { color: #fff; cursor: pointer; display: flex; align-items: center; position: relative; transition: transform 0.2s; }
.header-actions .icon-btn:hover { transform: scale(1.1); color: #ffeb3b; }
.header-actions svg { width: 28px; height: 28px; }

/* بج تعداد سبد خرید */
.cart-count {
    position: absolute; top: -6px; right: -8px; background: #ffeb3b; color: #2271b1; font-size: 12px; font-weight: bold;
    border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ------------------------------------ */
/* سایدبار سبد خرید (از چپ به راست) */
/* ------------------------------------ */
.offcanvas-cart {
    position: fixed; top: 0; left: 0; width: 350px; height: 100vh; background: #fff; z-index: 1000;
    transform: translateX(-100%); box-shadow: 2px 0 15px rgba(0,0,0,0.2); transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex; flex-direction: column;
}
.offcanvas-cart.active { transform: translateX(0); }
.cart-content { padding: 20px; overflow-y: auto; flex-grow: 1; color: #333; }
.cart-content .woocommerce-mini-cart__empty-message { text-align: center; margin-top: 50px; color: #999; }
.cart-content a { color: #2271b1; }

/* ------------------------------------ */
/* استایل‌های موبایل و منوی سایدبار */
/* ------------------------------------ */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .logo { flex-grow: 1; text-align: center; }
    .logo h1 { font-size: 20px; }
    
    /* منوی سایدبار (از راست به چپ) */
    .offcanvas-menu {
        position: fixed; top: 0; right: 0; width: 280px; height: 100vh; background: #fff; z-index: 1000;
        transform: translateX(100%); box-shadow: -2px 0 15px rgba(0,0,0,0.2); transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        display: flex; flex-direction: column;
    }
    .offcanvas-menu.active { transform: translateX(0); }
    .offcanvas-header {
        display: flex; justify-content: space-between; align-items: center; padding: 20px; background: #f8f9fa;
        border-bottom: 1px solid #eee; color: #333; font-weight: bold; font-size: 18px;
    }
    .close-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: #e74c3c; line-height: 1; }
    
    .main-menu ul { flex-direction: column; gap: 0; width: 100%; }
    .main-menu a { color: #333; display: block; padding: 15px 20px; border-bottom: 1px solid #f1f1f1; }
    .main-menu a:hover { color: #2271b1; background: #f9f9f9; padding-right: 25px; }
    
    .offcanvas-cart { width: 100%; max-width: 320px; } /* عرض کمتر در موبایل برای سبد خرید */
}

/* پرده تاریک پس‌زمینه (Overlay) */
.site-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(2px);
}
.site-overlay.active { opacity: 1; visibility: visible; }

/* بقیه استایل‌های قبلی (سرویس‌ها، مقالات و...) */
section { margin: 40px auto; }
.section-title { text-align: center; font-size: 24px; margin-bottom: 30px; color: #2271b1; position: relative; }
.section-title::after { content: ''; display: block; width: 60px; height: 3px; background: #2271b1; margin: 10px auto 0; }
.hero { background: #ffffff; padding: 60px 20px; text-align: center; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.hero h2 { font-size: 32px; margin-bottom: 15px; color: #333; }
.hero p { font-size: 18px; color: #666; margin-bottom: 30px; }
.btn { display: inline-block; padding: 12px 25px; border-radius: 5px; font-weight: bold; margin: 0 5px; }
.btn-primary { background: #2271b1; color: #fff; border: 2px solid #2271b1; }
.btn-primary:hover { background: #135e96; color: #fff; border-color: #135e96; }
.btn-secondary { background: transparent; color: #2271b1; border: 2px solid #2271b1; }
.btn-secondary:hover { background: #2271b1; color: #fff; }
.grid-4, .grid-3 { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.service-box { background: #fff; padding: 30px 20px; border-radius: 8px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.3s; }
.service-box:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.service-box h3 { margin-top: 0; color: #333; font-size: 18px; margin-bottom: 10px; transition: color 0.3s; }
.service-box p { color: #666; font-size: 14px; margin: 0; line-height: 1.8; }
.service-box:hover h3 { color: #2271b1; }
.service-icon { display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 70px; background: #e9f2f9; border-radius: 50%; margin-bottom: 20px; transition: all 0.3s ease; }
.service-box:hover .service-icon { transform: scale(1.1) rotate(5deg); background: #2271b1; }
.service-icon svg { width: 32px; height: 32px; stroke: #2271b1; transition: stroke 0.3s ease; }
.service-box:hover .service-icon svg { stroke: #ffffff; }
.blog-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.blog-card img { width: 100%; display: block; border-bottom: 1px solid #eee; }
.post-content { padding: 20px; }
.post-content h4 { margin: 0 0 10px; font-size: 18px; }
.post-content h4 a { color: #333; }
.post-content h4 a:hover { color: #2271b1; }
.post-content p { color: #666; font-size: 14px; margin-bottom: 15px; }
.read-more { display: inline-block; color: #2271b1; font-weight: bold; font-size: 14px; }
.products-grid .woocommerce ul.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin:0; padding:0; }
.products-grid .woocommerce ul.products li.product { width: 100%; margin: 0; background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-align:center;}
footer { background: #1a2a3a; color: #ccc; padding: 40px 0 0; margin-top: 50px; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.widget h4 { color: #fff; font-size: 18px; margin-bottom: 15px; border-bottom: 1px solid #334; padding-bottom: 10px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { margin-bottom: 8px; }
.widget ul li a { color: #ccc; }
.widget ul li a:hover { color: #fff; }
.footer-bottom { background: #111d28; padding: 15px 0; text-align: center; color: #888; font-size: 13px; }
