/* ============================================================
   Narmpa — Front Page  v3  (#B43F3F)
   ============================================================ */

.dm-front-page { padding-top: 0; padding-bottom: 60px; }
@media (max-width: 768px) {
    .dm-front-page { padding-top: 0px; padding-bottom: 16px; }
}

.site-main-content.dm-front-page .container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.dm-hp-section { margin-bottom: 48px; }
@media (max-width: 768px) {
    .dm-hp-section { margin-bottom: 24px; padding: 0 10px; }
}


/* ════════════════════════════════════════════
   Section Header
   ════════════════════════════════════════════ */
.dm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1.5px solid #f0f0f0;
}

.dm-section-title {
    background-color: transparent !important;
    font-size: 19px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
}
.dm-section-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 20px;
    background: var(--dm-primary, #B43F3F);
    border-radius: 2px;
    flex-shrink: 0;
}

.dm-view-all {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--dm-primary, #B43F3F);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: .85;
    transition: opacity .2s;
}
.dm-view-all:hover { opacity: 1; }

@media (max-width: 767px) {
    .dm-section-title { font-size: 16px; }
}


/* ════════════════════════════════════════════
   Grid helpers (fallback قبل از swiper)
   ════════════════════════════════════════════ */
.dm-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.dm-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 1200px) {
    .dm-products-grid { grid-template-columns: repeat(4, 1fr); }
    .dm-posts-grid    { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
    .dm-products-grid { grid-template-columns: repeat(3, 1fr); }
    .dm-posts-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .dm-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dm-posts-grid    { grid-template-columns: 1fr; gap: 12px; }
}


/* ════════════════════════════════════════════
   Hero Slider — تمام‌عرض، مدرن، مینیمال
   ════════════════════════════════════════════ */
.dm-hp-hero-full {
    width: 100%;
    margin-bottom: 48px;
}
@media (max-width: 768px) {
    .dm-hp-hero-full { margin-bottom: 24px; }
}

.dm-hero-slider-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    direction: ltr;
}
.dm-hero-slider-container .dm-main-slider { width: 100%; }

.dm-hero-slider-container .dm-slide-link {
    display: block; width: 100%;
    position: relative;
}
.dm-hero-slider-container .dm-slide-img {
    width: 100%;
    height: clamp(300px, 42vw, 620px);
    object-fit: cover;
    display: block;
}

/* nav buttons — شیشه‌ای */
.dm-hero-slider-container .swiper-button-next,
.dm-hero-slider-container .swiper-button-prev {
    color: #1a1a1a;
    background: rgba(255,255,255,.6);
    width: 10px; height: 10px;
    border-radius: 50%;
    transition: background .25s, transform .25s;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.dm-hero-slider-container .swiper-button-next { right: 24px; left: auto; }
.dm-hero-slider-container .swiper-button-prev { left: 24px; right: auto; }
.dm-hero-slider-container .swiper-button-next::after,
.dm-hero-slider-container .swiper-button-prev::after {
    font-size: 16px; font-weight: 900;
}
.dm-hero-slider-container .swiper-button-next:hover,
.dm-hero-slider-container .swiper-button-prev:hover {
    background: var(--dm-primary, #B43F3F);
    color: #fff;
    transform: scale(1.06);
}

/* pagination — باریک و مدرن */
.dm-hero-slider-container .swiper-pagination { bottom: 18px !important; }
.dm-hero-slider-container .swiper-pagination-bullet {
    background: rgba(255,255,255,.7);
    opacity: 1;
    width: 8px; height: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    transition: width .3s ease, background .3s ease;
}
.dm-hero-slider-container .swiper-pagination-bullet-active {
    background: var(--dm-primary, #B43F3F);
    width: 28px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .dm-hero-slider-container .swiper-button-next,
    .dm-hero-slider-container .swiper-button-prev { display: none; }
    .dm-hero-slider-container .dm-slide-img { height: clamp(180px, 56vw, 340px); }
}


/* ════════════════════════════════════════════
   Circle Categories
   ════════════════════════════════════════════ */
.dm-circle-cats-wrapper {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 14px;
    text-align: center;
}
.dm-circle-cats-wrapper .dm-circle-cat-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}
.dm-circle-cats-wrapper .dm-cat-img-box {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #f0f0f0;
    padding: 14px;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dm-circle-cats-wrapper .dm-circle-cat-item:hover .dm-cat-img-box {
    transform: translateY(-4px);
    border-color: var(--dm-primary, #B43F3F);
    box-shadow: 0 6px 18px rgba(180,63,63,.12);
}
.dm-circle-cats-wrapper .dm-cat-img-box img {
    width: 100%; height: auto; object-fit: contain;
}
.dm-circle-cats-wrapper .dm-cat-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #444;
    margin: 0;
}

@media (max-width: 800px) {
    .dm-circle-cats-wrapper {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    .dm-circle-cats-wrapper .dm-cat-img-box {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        padding: 16px;
    }
}
@media (max-width: 480px) {
    .dm-circle-cats-wrapper { grid-template-columns: repeat(3, 1fr); }
}


/* ════════════════════════════════════════════
   Double Banners
   ════════════════════════════════════════════ */
.dm-promo-boxes-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.dm-promo-boxes-wrapper .dm-promo-item {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.dm-promo-boxes-wrapper .dm-promo-img {
    width: 100%; height: auto;
    display: block;
    transition: transform .4s ease;
}
.dm-promo-boxes-wrapper .dm-promo-item:hover .dm-promo-img { transform: scale(1.03); }

@media (max-width: 767px) {
    .dm-promo-boxes-wrapper { grid-template-columns: 1fr; gap: 12px; }
}


/* ════════════════════════════════════════════
   Full-width image banner
   ════════════════════════════════════════════ */
.dm-hp-banner-img-wrap { display: block; border-radius: 14px; overflow: hidden; }
.dm-hp-banner-img { width: 100%; height: auto; display: block; }

/* بنرهای گرید (دوتایی / چهارتایی) */
.dm-hp-grid-banners { display: grid; gap: 16px; }
.dm-hp-grid-banners--double { grid-template-columns: repeat(2, 1fr); }
.dm-hp-grid-banners--quad   { grid-template-columns: repeat(2, 1fr); }
.dm-hp-grid-banner-item {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.dm-hp-grid-banner-item img {
    width: 100%; height: 100%;
    display: block; object-fit: cover;
    transition: transform .4s ease;
}
.dm-hp-grid-banner-item:hover img { transform: scale(1.03); }

@media (max-width: 767px) {
    .dm-hp-grid-banners--double { grid-template-columns: 1fr; }
    .dm-hp-grid-banners--quad   { grid-template-columns: 1fr 1fr; gap: 10px; }
}


/* دسته‌های دایره‌ای — کاروسل موبایل + استیکی */
.dm-circle-slider { width: 100%; overflow: hidden; }
.dm-circle-slider .swiper-wrapper { align-items: flex-start; }
.dm-circle-slider .swiper-slide { height: auto; }
.dm-circle-slider .dm-circle-cat-item {
    display: flex; flex-direction: column; align-items: center; gap: 9px; text-decoration: none; text-align: center;
}
.dm-circle-slider .dm-cat-img-box {
    width: 100%;
    max-width: 92px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 50%; background: #fff;
    border: 1.5px solid #f0f0f0; padding: 12%;
    display: flex; align-items: center; justify-content: center;
    box-sizing: border-box;
    transition: border-color .25s, transform .25s, box-shadow .25s;
}
.dm-circle-slider .dm-circle-cat-item:hover .dm-cat-img-box {
    transform: translateY(-3px);
    border-color: var(--dm-primary, #B43F3F);
    box-shadow: 0 6px 18px rgba(180,63,63,.12);
}
.dm-circle-slider .dm-cat-img-box img { width: 100%; height: 100%; object-fit: contain; }
.dm-circle-slider .dm-cat-title {
    font-size: 12px; font-weight: 700; color: #444; margin: 0;
    width: 100%; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .dm-circle-slider .dm-cat-title { font-size: 11px; }
}

/* استیکی بالای صفحه در موبایل — با کلاس JS (is-stuck) تا مستقل از overflow والدها کار کند */
@media (max-width: 768px) {
    .dm-circle-sticky-wrap.is-stuck {
        position: fixed !important;
        top: 0; left: 0; right: 0;
        z-index: 95;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,.08);
        padding:0px !important;
    }
    .dm-circle-sticky-wrap.is-stuck .dm-hp-section {
        margin-bottom: 0 !important;
        padding: 8px 10px !important;
    }
}


/* ════════════════════════════════════════════
   باکس تبلیغاتی (CTA)
   ════════════════════════════════════════════ */
.dm-cta-box {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: var(--dm-primary, #B43F3F);
    min-height: 100%;
    display: flex;
    width:100%;
}
/* overlay قابل تنظیم با کد رنگی؛ پیش‌فرض اگر رنگ ست نشده باشد */
.dm-cta-box__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0,0,0,.35);
}
.dm-cta-box--dark .dm-cta-box__overlay { background: rgba(255,255,255,.25); }
.dm-cta-box__inner {
    position: relative;
    z-index: 1;
    padding: 38px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}
.dm-cta-box--light .dm-cta-box__title,
.dm-cta-box--light .dm-cta-box__desc { color: #fff; }
.dm-cta-box--dark .dm-cta-box__title { color: #1a1a1a; }
.dm-cta-box--dark .dm-cta-box__desc  { color: #333; }
.dm-cta-box__title { font-size: 22px; font-weight: 900; margin: 0; line-height: 1.6; }
.dm-cta-box__desc  { font-size: 13.5px; line-height: 2.1; margin: 0; opacity: .95; }
.dm-cta-box__btn {
    display: inline-block;
    margin-top: 6px;
    padding: 11px 30px;
    border-radius: 8px;
    background:var(--dm-primary, #B43F3F);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .25s, transform .25s;
}
.dm-cta-box__btn:hover { background: var(--dm-primary, #B43F3F); transform: translateY(-2px); }
.dm-cta-box--dark .dm-cta-box__btn { background: var(--dm-primary, #B43F3F); }


/* آیکون‌های شبکه اجتماعی داخل باکس */
.dm-cta-box__socials { display: flex; gap: 10px; margin-top: 8px; }
.dm-cta-box__social {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(4px);
    color: #fff; transition: background .2s, transform .2s;
}
.dm-cta-box--dark .dm-cta-box__social { background: rgba(0,0,0,.08); color: #1a1a1a; }
.dm-cta-box__social:hover { background: var(--dm-primary, #B43F3F); color: #fff; transform: translateY(-2px); }
.dm-cta-box__social svg { width: 18px; height: 18px; }
.dm-cta-box__social img { width: 18px; height: 18px; object-fit: contain; }

/* CTA هم‌عرض بقیه سکشن‌ها — قیافهٔ مدرن */
.dm-hp-cta .dm-cta-box { min-height: 220px; border-radius: 18px; }
.dm-hp-cta .dm-cta-box__inner { padding: 40px 40px; }
@media (max-width: 768px) {
    .dm-hp-cta .dm-cta-box { min-height: 180px; }
    .dm-hp-cta .dm-cta-box__inner { padding: 28px 24px; }
}

/* کاروسل + باکس تبلیغاتی */
.dm-cta-carousel { display: flex; direction: rtl; gap: 18px; align-items: flex-start; }
.dm-cta-carousel__aside { flex: 0 0 300px; max-width: 300px; display: flex; order: 1; align-self: stretch; }
.dm-cta-carousel__main { flex: 1 1 0; min-width: 0; order: 2;width:100% !important; }
/* یکی‌درمیان: باکس سمت چپ */
.dm-cta-carousel--left .dm-cta-carousel__aside { order: 2; }
.dm-cta-carousel--left .dm-cta-carousel__main  { order: 1; }

@media (max-width: 900px) {
    .dm-cta-carousel { flex-direction: column; }
    .dm-cta-carousel__aside { flex: 1 1 auto; max-width: none; order: 1 !important; }
    .dm-cta-carousel__main  { order: 2 !important; }
    .dm-cta-box__inner { min-height: 180px; }
}

/* واحد پول کنار قیمت */
.dm-price-suffix-img { height: 16px; width: auto; display: inline-block; vertical-align: middle; margin-right: 2px; }
.dm-price-suffix-text { font-size: .82em; opacity: .85; margin-right: 2px; }


/* ════════════════════════════════════════════
   ویژگی‌های فروشگاه (features row)
   ════════════════════════════════════════════ */
.dm-hp-features { padding: 0 !important; }

.dm-features-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
}

.dm-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border-left: 1px solid #f0f0f0;
    transition: background .2s;
}
.dm-feature-item:last-child { border-left: none; }
.dm-feature-item:hover { background: #fdf9f9; }

.dm-feature-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--dm-primary-tint, #fdf2f2);
    color: var(--dm-primary, #B43F3F);
    display: flex; align-items: center; justify-content: center;
}

.dm-feature-text { display: flex; flex-direction: column; gap: 3px; }
.dm-feature-text strong { font-size: 13px; font-weight: 800; color: #1a1a1a; }
.dm-feature-text span   { font-size: 11.5px; color: #aaa; font-weight: 500; }

/* تبلت: ۲ ستون */
@media (max-width: 991px) {
    .dm-features-row { grid-template-columns: repeat(2, 1fr); }
    .dm-feature-item:nth-child(2n) { border-left: none; }
    .dm-feature-item:nth-child(n+3) { border-top: 1px solid #f0f0f0; }
}
/* موبایل: ۲ ستون فشرده */
@media (max-width: 600px) {
    .dm-feature-item { padding: 14px 12px; gap: 10px; flex-direction: column; text-align: center; }
    .dm-feature-icon { width: 40px; height: 40px; }
    .dm-feature-text { align-items: center; }
    .dm-feature-text strong { font-size: 12px; }
    .dm-feature-text span   { font-size: 10.5px; }
}


/* ════════════════════════════════════════════
   ریسپانسیو تجمیعی صفحهٔ اصلی (تبلت + موبایل)
   ════════════════════════════════════════════ */
/* جلوگیری از سرریز افقی که باعث به‌هم‌ریختگی کل صفحه می‌شود */
.dm-front-page { overflow-x: hidden; }

/* تبلت */
@media (max-width: 991px) {
    .dm-front-page .container { padding-left: 16px; padding-right: 16px; }
    .dm-hp-section { margin-bottom: 34px; padding: 0; }
    .dm-hp-hero-full { margin-bottom: 28px; }
    .dm-section-title { font-size: 17px; }
}

/* موبایل */
@media (max-width: 768px) {
    .dm-front-page .container { padding-left: 12px; padding-right: 12px; }
    .dm-hp-section { margin-bottom: 24px; padding: 0; }
    .dm-section-header { margin-bottom: 14px; padding-bottom: 10px; }
    .dm-section-title { font-size: 16px; }
    .dm-view-all { font-size: 11.5px; }

    /* اسلایدرهای محصول/مقاله: پدینگ کناری کم، فضای پیجینیشن */
    .dm-products-slider,
    .dm-posts-slider { padding: 4px 0 26px; }

    /* بنرهای گرید فاصلهٔ کمتر */
    .dm-hp-grid-banners { gap: 10px; }

    /* CTA + کاروسل: ستونی و جمع‌وجور */
    .dm-cta-carousel { gap: 14px; }
    .dm-cta-box__title { font-size: 18px; }
    .dm-cta-box__desc  { font-size: 12.5px; line-height: 1.9; }
}

/* موبایل کوچک */
@media (max-width: 480px) {
    .dm-hp-grid-banners--quad { grid-template-columns: 1fr 1fr; gap: 8px; }
}

@media (max-width: 900px) {
    .dm-features-row { grid-template-columns: repeat(2, 1fr); }
    .dm-feature-item:nth-child(2) { border-left: none; }
    .dm-feature-item:nth-child(3),
    .dm-feature-item:nth-child(4) { border-top: 1px solid #f0f0f0; }
}
@media (max-width: 480px) {
    .dm-features-row { grid-template-columns: 1fr; }
    .dm-feature-item { border-left: none !important; border-top: 1px solid #f0f0f0; }
    .dm-feature-item:first-child { border-top: none; }
}

/* ============================================================
   تطبیق صفحه اصلی با تم دارک (Dark Mode)
   ============================================================ */

/* پس‌زمینه‌ها */
body.theme-dark .dm-features-row,
body.theme-dark .dm-feature-item {
    background-color: var(--dm-bg-soft);
    border-color: var(--dm-border);
}

/* رنگ عناوین و متن‌ها */
body.theme-dark .dm-section-title,
body.theme-dark .dm-cat-title,
body.theme-dark .dm-feature-text strong {
    color: var(--dm-text);
}

body.theme-dark .dm-feature-text span {
    color: var(--dm-text-muted);
}

/* اصلاح باکس‌های تبلیغاتی و بنرها */
body.theme-dark .dm-cta-box {
    background-color: var(--dm-border);
}

/* اصلاح جداکننده‌ها و بوردرها */
body.theme-dark .dm-section-header {
    border-bottom-color: var(--dm-border);
}

body.theme-dark .dm-features-row,
body.theme-dark .dm-feature-item {
    border-color: var(--dm-border);
}

/* اصلاح آیکون‌ها و رنگ‌های هاور */
body.theme-dark .dm-feature-icon {
    background: var(--dm-primary-10);
}

body.theme-dark .dm-feature-item:hover {
    background: var(--dm-border);
}

/* اصلاح اسلایدرها (دکمه‌های شیشه‌ای) */
body.theme-dark .dm-hero-slider-container .swiper-button-next,
body.theme-dark .dm-hero-slider-container .swiper-button-prev {
    background: rgba(13, 17, 23, 0.7);
    color: var(--dm-text);
}

/* اصلاح اسلایدرها (پگینیشن) */
body.theme-dark .dm-hero-slider-container .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .dm-hero-slider-container .swiper-pagination-bullet-active {
    background: var(--dm-primary);
}

/* دایره‌های دسته‌بندی */
body.theme-dark .dm-circle-cats-wrapper .dm-cat-img-box,
body.theme-dark .dm-circle-slider .dm-cat-img-box {
    background: var(--dm-border);
    border-color: var(--dm-border);
}

body.theme-dark .dm-circle-cats-wrapper .dm-cat-title,
body.theme-dark .dm-circle-slider .dm-cat-title {
    color: var(--dm-text);
}