/*
Theme Name: B2B Sales System
Description: قالب سفارشی سیستم فروش B2B
Version: 1.0
Text Domain: b2b-theme
*/

/* Reset & Base Styles */
    @font-face {
    font-family: 'IRANSansX';
    src: url('assets/fonts/IRANSansXFaNum-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSansX';
    src: url('assets/fonts/IRANSansXFaNum-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
:root {
    --primary-color: #29296e;
    --primary-color-hover: #1a2226;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IRANSansX', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5282;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #2c5282;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #2c5282;
    color: white;
}

.btn-primary:hover {
    background: #2a4b7c;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2d3748;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}
 .mobile-auth-container {
        max-width: 400px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #f9f9f9;
    }
    
    .mobile-register-form h2 {
        text-align: center;
        margin-bottom: 20px;
        color: #333;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }
    
    .form-group input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
    }
    
    .form-group button {
        width: 100%;
        padding: 12px;
        background: #007cba;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        cursor: pointer;
    }
    
    .form-group button:hover {
        background: #005a87;
    }
    
/* پیام کلی */
#message,
#login-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
    z-index: 15;
}

/* موفقیت: سبز */
.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* خطا: قرمز مرتب */
.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}

/* لینک داخل پیام خطا */
.error a {
    color: #1F2B75;        /* رنگ برند */
    font-weight: 600;
    text-decoration: underline;
    pointer-events: auto;
    cursor: pointer;
}

    #mobile-register-form button,
#mobile-login-form button {
    font-family: inherit; /* مهم: این خط باعث می‌شود فونت IRANSansX اعمال شود */
    background: var(--primary-color); /* استفاده از رنگ سازمانی شما */
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
/* ===== استایل صفحه فروشگاه ووکامرس (نسخه نهایی و اصلاح شده) ===== */

/* تمام عرض کردن کانتینر اصلی */
.woocommerce-page .content-area {
    width: 100%;
    max-width: 100%;
}

.woocommerce {
    padding: 20px 0;
}

/* اصلاح چیدمان هدر فروشگاه */
.woocommerce-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}
.woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { margin-bottom: 0; }
.woocommerce .woocommerce-ordering select { border: 1px solid var(--border-color); border-radius: 5px; padding: 8px; background-position: left 0.5rem center; }




/* طراحی کارت هر محصول (نسخه نهایی با Flexbox) */
.woocommerce ul.products li.product {
    padding: 0;
    margin: 0;
    width: auto;
    float: none;
    list-style: none;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    /* این بخش جدید و کلیدی است */
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* لینک تصویر محصول */
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    text-decoration: none;
    display: block;
    padding: 20px 20px 0; /* کمی فاصله برای تصویر */
}

/* محتوای متنی کارت */
.woocommerce ul.products li.product .product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    align-items: center;
}

/* عنوان محصول */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
    text-decoration: none;
    color: var(--text-color);
}

/* قیمت محصول */
.woocommerce ul.products li.product .price {
    color: var(--primary-color);
    font-size: 1.25em;
    font-weight: bold;
    display: block;
    margin-bottom: 20px;
}

/* دکمه افزودن به سبد */
.woocommerce ul.products li.product .button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #03c04a; /* زرد برند پوک به عنوان رنگ اصلی */
    color: #fff; /* متن تیره برای خوانایی روی زرد */
    font-family: "Vazirmatn", sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #008733; /* تیرگی حاشیه برای عمق */
    padding: 10px;
    width: 90%;
    margin: 0 auto 10px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #f8f8f8; /* برگشت به خاکستری روشن در حالت هاور */
    border-color: #d0d5e0;
    color: #444;
}

/* استایل بج تخفیف */
.woocommerce ul.products li.product .onsale {
    background-color: #ffc107;
    color: #212529;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 20px;
    margin: 15px; /* کمی فاصله از لبه‌ها */
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9;
}

/* اصلاح چیدمان هدر فروشگاه (تعداد نتایج و مرتب‌سازی) */
.woocommerce .woocommerce-ordering,
.woocommerce .woocommerce-result-count {
    margin-bottom: 2em;
}
/* ===== ساختار اصلی صفحه و فوتر چسبان ===== */

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%; /* برای سازگاری بهتر با مرورگرهای قدیمی */
    min-height: 100vh; /* صفحه را حداقل به اندازه ارتفاع کامل مرورگر می‌کشد */
}

.main-content {
    flex-grow: 1; /* این بخش تمام فضای خالی را پر می‌کند و فوتر را به پایین هل می‌دهد */
}

.main-footer {
    flex-shrink: 0; /* از کوچک شدن فوتر جلوگیری می‌کند */
    width: 100%;
    text-align: center;
    padding: 25px 0;
    background-color: #ffffff;
    margin-top: 40px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
/* حذف لینک "مشاهده سبد" بعد از افزودن به سبد */
.woocommerce ul.products li.product .added_to_cart {
    display: none !important;
}
/* استایل سبد خرید در هدر (نسخه متنی) */
.header-cart .cart-contents {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-cart .cart-text {
    color: #e53935; /* رنگ قرمز */
    font-size: 14px;
    font-weight: bold;
    background-color: #ffcdd2; /* یک پس‌زمینه قرمز بسیار روشن */
    padding: 5px 12px;
    border-radius: 20px;
}
/* حل مشکل هم‌تراز نبودن قیمت‌ها در کارت محصول */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    /* یک ارتفاع ثابت به اندازه دو خط متن به عنوان اختصاص می‌دهیم */
    height: 3.6em;
    overflow: hidden;
}
/* استایل نمایش موجودی انبار در صفحه فروشگاه */
.woocommerce ul.products li.product .product-info .stock {
    font-size: 0.9em;
    color: #038521 ;
    margin-bottom: 15px;
    display: block;
    font-weight: bold; /* این خط فونت را ضخیم می‌کند */
}
/* ===== استایل چیدمان صفحه فروشگاه (محتوا + سایدبار) - نسخه نهایی ===== */
/* کانتینر اصلی صفحه فروشگاه (نسخه اصلاح شده و نهایی) */
.woocommerce-container {
    display: flex;
    flex-direction: row-reverse; /* سایدبار را به راست منتقل می‌کند */
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start; /* هر دو ستون را از بالا هم‌تراز می‌کند */
}
/* کانتینر اصلی که کل فروشگاه و سایدبار را در بر می‌گیرد */
/* ستون محتوای اصلی */
.woocommerce-container .content-area {
    flex: 1;
    min-width: 0;
    width: 100%; 
}

/* ستون سایدبار */
.woocommerce-container .widget-area {
    flex-basis: 280px;
    flex-shrink: 0;
}


/* استایل ویجت‌های داخل سایدبار */
.widget-area .widget {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.widget-area .widget-title {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.widget-area ul {
    list-style: none;
    padding-right: 0;
    margin-bottom: 0;
}

.widget-area ul li {
    margin-bottom: 10px;
}

.widget-area ul li:last-child {
    margin-bottom: 0;
}

.widget-area ul li a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.widget-area ul li a:hover {
    color: var(--primary-color);
}
/* ۱. حل مشکل پر نشدن ردیف اول گرید */
/* این کد قوانین قدیمی ووکامرس را که باعث شکستن گرید می‌شوند، خنثی می‌کند */
.woocommerce ul.products li.product.first {
    clear: none !important;
}


.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    display: block !important;
}

/* حذف کلاس‌های مخرب ووکامرس */
.woocommerce ul.products li.product.first,
.woocommerce ul.products li.product.last,
.woocommerce ul.products li.product:nth-child(3n+1) {
    clear: none !important;
}
/* ===== ریسپانسیو سازی نهایی ===== */

/* برای تبلت و نمایشگرهای کوچکتر (کمتر از ۱۰۲۴ پیکسل) */
@media (max-width: 1024px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* برای تبلت‌های عمودی و موبایل‌های بزرگ (کمتر از ۷۶۸ پیکسل) */
@media (max-width: 768px) {
    body.woocommerce .woocommerce-container {
        flex-direction: column-reverse;
    }
}

/* برای موبایل (کمتر از ۴۸۰ پیکسل) */
@media (max-width: 480px) {
    body.woocommerce ul.products {
        grid-template-columns: 1fr;
    }
}
.quantity-controller {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	width: 120px;
	margin: 10px auto;
}

.quantity-controller input.qty {
	border: none;
	width: 50px;
	text-align: center;
	font-size: 16px;
	background: #fff;
}

.quantity-controller button {
	background: #f7f7f7;
	border: none;
	width: 35px;
	height: 35px;
	cursor: pointer;
	font-size: 18px;
	color: #333;
	transition: background 0.2s;
}

.quantity-controller button:hover {
	background: #e1e1e1;
}
.product-card form.cart {
  display: flex;
  flex-direction: column;
  align-items: center; /* مرکز‌چین عمودی */
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.product-card form.cart .button {
  width: 90%;
  text-align: center;
}
.product-box-info {
    width: 90%;
    margin: 0 auto 12px;
    text-align: center;
    background: linear-gradient(135deg, #f6f8ff 0%, #e9ecf5 100%);
    border-radius: 8px;
    border: 1px solid #d0d5e0;
    padding: 10px;
    color: #2c3e50;
    font-size: 0.95em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-box-info .box-icon {
    font-size: 18px;
    opacity: 0.7;
}

.product-box-info strong.box-number {
    color: var(--primary-color);
    font-weight: 600;
}

.product-box-info span {
    line-height: 1;
}
.b2b-max-limit {
    font-family: 'IRANSansX', sans-serif !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f8f8; /* رنگ زمینه مثل باکس */
    border: 1px solid #d0d5e0; /* حاشیه خاکستری ملایم */
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #444;
    gap: 5px;
    width: 90%;
    margin: 0 auto 10px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04); /* سایه سبک مثل باکس */
    font-family: "Vazirmatn", sans-serif;
}

.b2b-max-limit .b2b-max-value {
    font-weight: 600;
    color: #000;
}

.product-card .b2b-max-text {
    display: inline-block;
    font-weight: 500;
    color: #444;
}


/* === اطلاعات هر باکس === */
.product-card .product-box-info {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #444;
    gap: 5px;
    margin-bottom: 10px;
}
/* حذف فلش‌های بالا و پایین از input تعداد */
input.qty::-webkit-outer-spin-button,
input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input.qty[type=number] {
    -moz-appearance: textfield; /* برای فایرفاکس */
}
.b2b-max-limit .max-icon {
    font-size: 15px;
    opacity: 0.7;
    margin-right: 5px;
    color: #777;
}
/* === استایل باکس قیمت مثل بلوک‌های سقف مجاز و باکس === */
.product-card .price-display {
    width: 90%;
    margin: 0 auto 10px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f8f8;
    border: 1px solid #d0d5e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2b75;
    font-family: "IRANSansX", sans-serif !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    gap: 6px;
}

/* آیکون قبل از مبلغ */
.product-card .price-display::before {
    content: "💰";
    font-size: 16px;
    opacity: 0.8;
    color: #777;
}
/* ===== صفحه ورود متحرک (نهایی و بدون تداخل) ===== */
body.page-login {
    background: #e9f1fa;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IRANSansX";
    overflow: hidden;
}

/* کارت اصلی فرم */
.mobile-auth-container {
    position: relative;
    z-index: 10;             /* فرم بالاتر از انیمیشن */
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.1);
    width: 360px;
    padding: 40px 30px;
    text-align: center;
    overflow: hidden;        /* مربع‌ها داخل محدوده کارت بمانند */
}

/* مربع‌های متحرک داخل کارت */
.login-bg-animated {
    position: absolute;
    inset: 0;                /* مساوی top:0; right:0; bottom:0; left:0 */
    z-index: 0;
    overflow: hidden;
}

.login-bg-animated .square {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(31, 43, 117, 0.08);
    border-radius: 6px;
    animation: floatSquares 16s ease-in-out infinite;
}

/* پراکندگی مربع‌ها */
.login-bg-animated .square:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.login-bg-animated .square:nth-child(2) { top: 30%; left: 70%; animation-delay: 3s; }
.login-bg-animated .square:nth-child(3) { top: 75%; left: 25%; animation-delay: 6s; }
.login-bg-animated .square:nth-child(4) { top: 20%; left: 85%; animation-delay: 9s; }
.login-bg-animated .square:nth-child(5) { top: 60%; left: 45%; animation-delay: 12s; }

/* انیمیشن حرکت نرم مربع‌ها */
@keyframes floatSquares {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.7; }
    50%  { transform: translateY(-40px) rotate(90deg); opacity: 0.3; }
    100% { transform: translateY(0) rotate(180deg); opacity: 0.7; }
}

/* سایر بخش‌های کارت ورود */
.login-logo {
    max-width: 180px;
    margin-bottom: 15px;
    position: relative; /* برای قرارگیری بالای مربع‌ها */
    z-index: 2;
}

.mobile-auth-container h2 {
    color: #1F2B75;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.sub-text {
    color: #555;
    font-size: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #c4c4c4;
    padding: 10px;
    font-size: 15px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.btn-login {
    width: 100%;
    background-color: #1F2B75;
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-top: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 2;
}

.btn-login:hover {
    background-color: #141B55;
}

.terms-text {
    font-size: 13px;
    color: #777;
    margin-top: 25px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}
/* ====== استایل منوی حساب کاربری با آیکون‌ها - نسخه نهایی Saeed | ddshorder.ir ====== */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ===== نسخه تضمینی: آیکون سمت چپ در حالت RTL ===== */

.woocommerce-MyAccount-navigation ul li a {
    position: relative;
    display: block;
    font-family: IRANSansX, sans-serif;
    direction: ltr; /* 👈 کلید اصلی برای آزاد شدن مختصات چپ/راست */
    text-align: right; /* متن همچنان راست‌چین می‌ماند */
    color: #1F2B75;
    background-color: #b2d3c2;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px 15px 12px 40px; /* حالا سمت چپ برای آیکون */
    transition: background-color 0.3s ease;
}

/* آیکون سمت چپ */
.woocommerce-MyAccount-navigation ul li a::before {
    content: '';
    position: absolute;
    left: 12px; /* 👈 موقعیت واقعی در چپ */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.85;
}

/* حالت hover بدون تغییر رنگ فعال */
.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: #b2d3c2 !important;
    filter: brightness(0.95);
}

/* دکمه فعال را همان رنگ نگه دار */
.woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: #1F2B75 !important;
    color: white !important;
}

/* ====== آیکون‌های اختصاصی ====== */

/* داشبورد */
.woocommerce-MyAccount-navigation-link--dashboard a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/dashboards.png');
}

/* سفارشات */
.woocommerce-MyAccount-navigation-link--orders a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/shopping-cart.png');
}

/* بخش‌نامه‌ها */
.woocommerce-MyAccount-navigation-link--downloads a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/interview.png');
}

/* آدرس‌ها */
.woocommerce-MyAccount-navigation-link--edit-address a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/location.png');
}

/* کیف پول */
.woocommerce-MyAccount-navigation-link--woo-wallet a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/money-bag.png');
}

/* جزئیات حساب */
.woocommerce-MyAccount-navigation-link--edit-account a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/user.png');
}

/* پیش سفارش‌ها */
.woocommerce-MyAccount-navigation-link--premium-support a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/quote-request.png');
}

/* خروج */
.woocommerce-MyAccount-navigation-link--customer-logout a::before {
    background-image: url('/wp-content/themes/b2b-pook/assets/images/icons/logout.png');
}
/* ----------------------------------------
   حالت فعال: آیکون‌ها سفید شوند
   نسخه نهایی Saeed | ddshorder.ir
---------------------------------------- */

.woocommerce-MyAccount-navigation ul li.is-active a::before {
    filter: brightness(0) invert(1); /* 👈 مشکی → سفید */
    opacity: 1; /* وضوح کامل */
}