/* ===========================
   style.css – یکپارچه و بهینه
   =========================== */

:root {
    --primary: #f7941d;        /* نارنجی صنعتی */
    --secondary: #0a1929;      /* آبی نفتی */
    --dark: #1b2a3a;
    --light: #f4f6f9;
    --white: #ffffff;
    --text: #222;
}

/* ---------- Reset & Base ---------- */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--text);
    background: #fff;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    line-height: 1.8;
}

/* جلوگیری از overflow افقی در تمام المان‌ها */
img, video, iframe, table, pre, .table-responsive {
    max-width: 100%;
    height: auto;
}
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---------- تایپوگرافی عمومی ---------- */
p, li {
    text-align: justify;
}

/* ---------- هدر صنعتی ---------- */
.top-bar {
    background: var(--secondary);
    color: #ccc;
    font-size: 0.9rem;
}
.top-bar a {
    color: #ccc;
    text-decoration: none;
}
.top-bar i {
    color: var(--primary);
}

.navbar {
    border-bottom: 3px solid var(--primary);
}
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: #fff;
}
.nav-link {
    color: #838383;
    transition: 0.3s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.navbar-logo {
    object-fit: contain;
    max-height: 45px;
    width: auto;
    max-width: 150px; /* حداکثر عرض برای جلوگیری از overflow در موبایل */
}
.section-title {
    text-align: right; /* پیش‌فرض برای راست‌چین */
}
@media (min-width: 768px) {
    .section-title {
        text-align: center;
    }
}
/* ===== اسلایدر ===== */
/* ===== اسلایدر اصلی ===== */
.hero-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
}
.hero-slider .swiper-slide {
    min-height: 220px;
    height: auto;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
}
/* ارتفاع برای تبلت و دسکتاپ */
@media (min-width: 768px) {
    .hero-slider .swiper-slide {
        min-height: 400px;
    }
}
@media (min-width: 1200px) {
    .hero-slider .swiper-slide {
        min-height: 500px;
    }
}

/* overlay تیره برای خوانایی متن */
.hero-slider .slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

/* کپشن */
.hero-caption {
    position: absolute;
    top: 50%;
    right: 8%;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 500px;
    width: 90%;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    word-wrap: break-word;
}
.hero-caption h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--site-secondary, #f7941d);
}
.hero-caption p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}
.hero-caption .btn {
    font-size: 1rem;
    padding: 12px 30px;
    border-radius: 50px;
    background-color: var(--site-secondary, #f7941d);
    color: var(--text-on-secondary, #fff);
    border: none;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}
.hero-caption .btn:hover {
    background-color: var(--site-primary, #0a1929);
    transform: translateY(-2px);
}

/* تنظیمات دکمه‌های نویگیشن و پیجینیشن */
.swiper-button-next,
.swiper-button-prev {
    color: #fff;
    background: rgba(0,0,0,0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background 0.3s;
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(0,0,0,0.7);
}
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 1.2rem;
    font-weight: bold;
}
.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.7;
}
.swiper-pagination-bullet-active {
    background: var(--site-secondary, #f7941d);
    opacity: 1;
}

/* در موبایل کپشن کوچک‌تر */
@media (max-width: 575.98px) {
    .hero-caption {
        right: 5%;
        max-width: 90%;
    }
    .hero-caption h2 {
        font-size: 1.5rem;
    }
    .hero-caption p {
        font-size: 0.9rem;
    }
}
/* بنرهای 4 گانه */
.section-title {
    text-align: right;       /* موبایل: راست‌چین */
    font-weight: 700;
    color: var(--site-primary);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}
@media (min-width: 768px) {
    .section-title {
        text-align: center;   /* دسکتاپ: وسط‌چین */
    }
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--site-secondary);
    border-radius: 2px;
}
/* ===== کارت خدمات ===== */
.service-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    background: #fff;
}
.service-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}
.service-icon {
    font-size: 2.8rem;
    color: var(--secondary);
    transition: 0.3s;
}
.service-card:hover .service-icon {
    color: var(--primary);
}

/* ===== کارت مقالات ===== */
.blog-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
}
.blog-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.blog-card img {
    height: 220px;
    object-fit: cover;
}

/* ===== دکمه‌ها ===== */
.btn-primary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #000;
}
.btn-warning {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: bold;
}
.btn-outline-primary {
    color: var(--secondary);
    border-color: var(--secondary);
}
.btn-outline-primary:hover {
    background-color: var(--secondary);
    color: #fff;
}

/* ===== فوتر ===== */
.footer {
    background: var(--secondary);
    color: #aaa;
    padding: 2rem 0;
}
.footer h5 {
    color: var(--primary);
}
.footer a {
    color: #aaa;
    text-decoration: none;
}
.footer a:hover {
    color: var(--primary);
}

/* ===== بخش‌های رنگی ===== */
.bg-dark-section {
    background-color: var(--secondary);
    color: #fff;
}

/* ===== صفحه‌بندی ===== */
.pagination .page-link {
    color: var(--secondary);
}
.pagination .active .page-link {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

/* ===== کارت‌های دسته‌بندی ===== */
.cat-swiper .swiper-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}
.cat-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s;
}
.cat-circle img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}
.cat-circle i {
    font-size: 3rem;
    color: var(--secondary);
}
.cat-name {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* ===== کارت درگاه پرداخت ===== */
.gateway-card {
    cursor: pointer;
    transition: 0.2s;
}
.gateway-card:hover {
    border-color: var(--site-primary, var(--primary));
}
.gateway-card input[type="radio"]:checked + span {
    color: var(--site-primary, var(--primary));
}

/* ===== بردکرامب ===== */
.breadcrumb-swiper-container {
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.breadcrumb-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}
.breadcrumb-link:hover {
    color: var(--site-primary, var(--primary));
}
.breadcrumb-current {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.9rem;
}
.breadcrumb-next, .breadcrumb-prev {
    color: var(--site-primary, var(--primary));
}

/* ===== تصویر شاخص مقاله ===== */
.post-thumbnail {
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
}
.post-thumbnail img {
    object-fit: cover;
    width: 100%;
}

/* ===== سایدبار ===== */
.sidebar .card {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.sidebar .card-header {
    background-color: var(--site-primary, var(--secondary));
    color: #fff;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
}
.sidebar ul li {
    list-style: none;
}
.sidebar a {
    text-decoration: none;
    color: var(--site-primary, var(--secondary));
}
.sidebar a:hover {
    color: var(--primary);
}
.sidebar .border-bottom:last-child {
    border-bottom: 0;
}

/* ===== المان‌های قابل ویرایش (پنل مدیریت) ===== */
.editable {
    cursor: pointer;
}
.editable:hover {
    background-color: #f8f9fa;
}
.editable input {
    width: 100%;
}
.letter-btn.active {
    background-color: var(--site-primary, var(--secondary));
    color: #fff;
}

/* ===== استایل محتوای مقاله و صفحات ===== */
.post-content, .page-content, .product-description, article .content {
    line-height: 2;
    color: #222;
}
.post-content h1, .page-content h1, .post-content h1 {
    font-size: 2em;
    color: #0b3d5e;
    border-bottom: 3px solid #0b3d5e;
    padding-bottom: 10px;
}
.post-content h2, .page-content h2, .post-content h2 {
    color: #1a5276;
    margin-top: 40px;
    border-right: 5px solid #2980b9;
    padding-right: 10px;
}
.post-content h3, .page-content h3, .post-content h3 {
    font-size: 1.2em;
    color: #2c3e50;
    margin-top: 25px;
}
.post-content .intro, .page-content .intro, .post-content .intro {
    background: #f0f7fb;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    margin: 25px 0;
    border-right: 6px solid #2980b9;
}
.post-content ul, .post-content ol,
.page-content ul, .page-content ol {
    padding-right: 25px;
}
.post-content li, .page-content li {
    margin-bottom: 8px;
}
.post-content strong, .page-content strong {
    color: #0b3d5e;
}
.post-content .highlight, .page-content .highlight {
    background: #eaf2f8;
    padding: 2px 6px;
    border-radius: 4px;
}

/* تنظیمات واکنش‌گرا */
@media (max-width: 600px) {
    .post-content, .page-content {
        padding: 10px;
    }
    .post-content h1, .page-content h1 {
        font-size: 1.5em;
    }
}

/* ===== حذف overflow اضافی ===== */
.container, .container-fluid, .row, .col, [class*="col-"] {
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* منوی اصلی */
.navbar-nav .mega-dropdown {
    position: static;
}
.mega-menu {
    width: 100%;
    right: 0;
    left: 0;
    margin-top: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: #fff;
    padding: 2rem;
}
.mega-menu .mega-content {
    max-width: 100%;
}
.mega-cat-list {
    list-style: none;
    padding: 0;
    columns: 3;
    column-gap: 2rem;
}
.mega-cat-list li a {
    display: block;
    padding: 0.3rem 0;
    color: #333;
    text-decoration: none;
}
.mega-cat-list li a:hover {
    color: var(--site-primary);
}

/* منوی نوار بالا (topbar) */
.topbar-menu .navbar-nav {
    flex-direction: row;   /* افقی */
    gap: 1.5rem;                     /* فاصله بین آیتم‌ها */
    list-style: none;
    padding: 0;
    margin: 0;
}
.topbar-menu .navbar-nav .nav-link {
    color: #555;
    padding: 0;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}
.topbar-menu .navbar-nav .nav-link:hover {
    color: var(--site-primary);
}

/* منوی اصلی (header) */
.header-nav .navbar-nav .nav-link {
    color: var(--text-on-primary);
    padding: 0.8rem 1.2rem;          /* کمی پهن‌تر */
    border-radius: 6px;              /* گوشه‌های گرد */
    margin: 0 2px;                   /* فاصله بین آیتم‌ها */
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.header-nav .navbar-nav .nav-link:hover,
.header-nav .navbar-nav .nav-link:focus {
    background-color: rgba(255,255,255,0.12);  /* روشن‌تر */
    color: #fff;
}

/* برای آیتم فعال (با کلاس active) */
.header-nav .navbar-nav .nav-link.active {
    background-color: var(--site-secondary);
    color: var(--text-on-secondary);
}

/* دراپ‌دان‌ها */
.header-nav .dropdown-menu {
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}
.header-nav .dropdown-item {
    color: #333;
    padding: 0.5rem 1.5rem;
    transition: background 0.2s, color 0.2s;
}
.header-nav .dropdown-item:hover {
    background: var(--site-primary);
    color: #fff;
}

/* مگامنو */
.mega-menu {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    padding: 2rem;
}
.mega-content a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
.mega-content a:hover {
    color: var(--site-secondary);
}

/* آیکون‌های اقدام */
.action-icons .btn {
    background: #fff;                /* پس‌زمینه سفید دایره‌ای */
    color: #333;                    /* رنگ تیره برای خود آیکون */
    border-radius: 20%;             /* دایره کامل */
    width: 36px;                    /* عرض و ارتفاع یکسان */
    height: 36px;
    display: flex;                  /* وسط‌چین کردن آیکون */
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 8px;               /* فاصله بین دکمه‌ها */
    position: relative;             /* برای نشانگر تعداد */
    transition: background 0.2s;
    border: none;                   /* حذف حاشیه */
}
.action-icons .btn:hover {
    background: #f0f0f0;            /* کمی تیره‌تر در hover */
}
.action-icons .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    background-color: var(--site-primary); /* رنگ نشانگر */
    color: var(--text-on-primary);
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* برای دکمه کاربر (dropdown toggle) هم همین استایل */
.action-icons .dropdown .btn {
    background: #fff;
    color: #333;
}

/* کارت محصول */
.product-card-link {
    display: block;
    color: inherit;
    width: 100%;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s;
    border: 1px solid #eee;
}
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card-image {
    width: 100%;
    padding-top: 100%; /* نسبت ۱:۱ */
    position: relative;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}
.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.product-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.product-card-prices {
    margin-top: auto;
}
.discount-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
    line-height: 1.2;
}
.final-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0a1929; /* var(--site-primary) */
}
.currency-icon {
    font-size: 0.7rem;
    color: #666;
    margin-right: 2px;
}
.original-price {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    margin-top: 2px;
}

/* کارت محصول */
.product-card-link {
    display: block;
    color: inherit;
    height: 100%;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid #eee;
    position: relative;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.product-card-colors {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}
.product-card-image {
    width: 100%;
    padding-top: 100%; /* نسبت ۱:۱ */
    position: relative;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}
.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}
.product-card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    line-height: 1.45;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}
.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.75rem;
}
.stock-low {
    color: #0d6efd; /* رنگ primary */
    font-weight: 500;
}
.rating {
    display: flex;
    align-items: center;
    gap: 2px;
}
.rating-value {
    font-weight: 600;
    color: #333;
}
.rating-star {
    color: #f59e0b;
    font-size: 0.7rem;
}
.product-card-prices {
    margin-top: auto;
}
.discount-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
    line-height: 1.2;
}
.final-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0a1929; /* var(--site-primary) */
}
.currency-icon {
    font-size: 0.7rem;
    color: #666;
    margin-right: 2px;
}
.original-price {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    margin-top: 2px;
}

@media (min-width: 992px) {
    .sticky-sidebar {
        position: sticky;
        top: 130px; /* ارتفاع تقریبی هدر sticky (بسته به طراحی شما) */
        z-index: 10;
    }
}

/* بهبود ظاهر لیست برندها */
.card-body .list-unstyled li a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
.card-body .list-unstyled li a:hover {
    color: var(--site-primary);
}