/* تبلیغات داخلی سایت — جایگاه‌ها ارتفاع ثابت و ابعاد تصویر دارند تا چیدمان مقاله نپرد. docs/MERCH.md */
.rcm { --rcm-green: #198754; --rcm-deep: #14663f; --rcm-soft: #f3faf4; --rcm-line: #dcebdf; --rcm-ink: #1f2a22; --rcm-muted: #6c7a70; font-family: inherit; color: var(--rcm-ink); }
.rcm a, .blog-content .rcm a { color: inherit; text-decoration: none; }
.rcm img { display: block; margin: 0; max-width: 100%; border-radius: 12px; object-fit: cover; }
.rcm-tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--rcm-deep); background: #e4f4e7; padding: 2px 10px; border-radius: 99px; line-height: 1.8; }
.rcm-title { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.7; }
.rcm-name { display: block; font-size: .84rem; font-weight: 600; line-height: 1.7; }
.rcm-text { font-size: .86rem; line-height: 1.9; color: #47544b; text-align: right; }
.rcm-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: .95rem; }
.rcm-price b { font-weight: 800; color: var(--rcm-deep); }
.rcm-price del { font-size: .76rem; color: var(--rcm-muted); }
.rcm-price small { font-size: .72rem; color: var(--rcm-muted); }
.rcm-price em { font-style: normal; font-size: .72rem; font-weight: 700; color: #fff; background: #d9480f; padding: 0 7px; border-radius: 6px; }
.rcm-btn, .blog-content .rcm a.rcm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--rcm-green); color: #fff; font-family: inherit; font-size: .84rem; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s; }
.rcm-btn:hover { background: var(--rcm-deep); }
.rcm-link { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--rcm-green); }

/* کارت عریض: داخل متن، پایان مقاله، بین لیست */
.rcm-feature { display: grid; grid-template-columns: 160px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 18px; align-items: center; margin: 28px 0; padding: 16px; background: var(--rcm-soft); border: 1px solid var(--rcm-line); border-radius: 16px; }
.rcm-media { grid-row: 1 / 3; }
.rcm-feature .rcm-media img { width: 160px; height: 160px; }
.rcm-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.rcm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; min-width: 0; }
.rcm-perks, .blog-content .rcm-perks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0; padding: 0; list-style: none; }
.rcm-perks li, .blog-content .rcm-perks li { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .82rem; font-weight: 600; line-height: 1.7; color: var(--rcm-ink); list-style: none; }
.rcm-perks i { font-size: .72rem; color: var(--rcm-green); }
.rcm-row > .rcm-perks { margin-bottom: 10px; }
.rcm-is-deal { background: #fff8f0; border-color: #f6e0c7; }
.rcm-is-deal .rcm-tag { background: #fde8d3; color: #a2460c; }

/* ردیف محصولات: اسکرول بومی با نمای نیمه از کارت بعدی */
.rcm-row { margin: 28px 0; padding: 16px; background: var(--rcm-soft); border: 1px solid var(--rcm-line); border-radius: 16px; }
.rcm-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rcm-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.rcm-tile { flex: 0 0 170px; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--rcm-line); border-radius: 14px; scroll-snap-align: start; }
.rcm-tile:hover { border-color: var(--rcm-green); }
.rcm-tile img { width: 100%; height: 150px; }
.rcm-tile .rcm-name { min-height: 3.4em; }

/* کارت فشرده: ستون کناری و محصول ناموجود */
.rcm-compact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px; background: var(--rcm-soft); border: 1px solid var(--rcm-line); border-radius: 16px; }
.rcm-compact-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; }
.rcm-compact-item img { width: 72px; height: 72px; }
.rcm-compact-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pdp .rcm-compact { margin: 12px 0; }

.rcm-rail > .rcm-compact { margin-top: 14px; }
@media (min-width: 992px) {
    .rcm-rail { position: sticky; top: 104px; }
    .rcm-rail .toc-box { position: static; }
    .rcm-rail .toc-list { max-height: 34vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .rcm-rail .rcm-compact { display: none; }
}

/* بنر تصویری */
.rcm-banner { margin: 24px 0; }
.rcm-banner img { width: 100%; height: auto; }
.rcm-rail .rcm-banner { margin: 14px 0 0; }

/* نوار پایین موبایل، بالای منوی پایین سایت */
.rcm-sticky { position: fixed; z-index: 1030; right: 8px; left: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; background: #fff; border: 1px solid var(--rcm-line); border-radius: 14px; box-shadow: 0 6px 22px rgba(20, 60, 35, .16); }
.rcm-sticky[hidden] { display: none; }
.rcm-sticky-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.rcm-sticky img { width: 44px; height: 44px; flex: none; }
.rcm-sticky-text { flex: 1; min-width: 0; }
.rcm-sticky .rcm-name { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcm-sticky .rcm-price { font-size: .8rem; }
.rcm-sticky .rcm-price del { display: none; }
.rcm-sticky .rcm-btn { min-height: 36px; padding: 0 14px; }
.rcm-sticky .rcm-link { display: block; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcm-close { width: 32px; height: 32px; flex: none; border: 0; background: none; color: var(--rcm-muted); font-size: .9rem; cursor: pointer; }
@media (min-width: 768px) {
    .rcm-sticky { display: none !important; }
}

/* موبایل: حباب چت باز پهن است و نوار را می‌پوشاند، پس تا نوار دیده می‌شود حباب بالای آن می‌رود */
@media (max-width: 767.98px) {
    html.rcm-bar-on .woot-widget-bubble { bottom: calc(134px + env(safe-area-inset-bottom)) !important; }
}

/* موبایل: تبلیغ حاشیه‌ی متن را می‌خورد؛ قیمت و دکمه زیر تصویر تمام‌عرض می‌شوند تا کارت در عرض کم کش نیاید */
@media (max-width: 640px) {
    .blog-content .rcm-feature, .blog-content .rcm-row { margin-right: -16px; margin-left: -16px; }
    .rcm-feature { grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto; gap: 10px 12px; padding: 12px; align-items: start; }
    .rcm-media { grid-row: auto; }
    .rcm-feature .rcm-media img { width: 84px; height: 84px; }
    .rcm-foot { grid-column: 1 / -1; flex-wrap: nowrap; }
    .rcm-title { font-size: .92rem; line-height: 1.6; }
    .rcm-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: .8rem; line-height: 1.8; }
    .rcm-row { padding: 12px; }
    .rcm-row-head { flex-wrap: wrap; gap: 4px 10px; }
    .rcm-tile { flex-basis: 142px; padding: 8px; }
    .rcm-tile img { height: 124px; }
    .rcm-tile .rcm-price del { flex-basis: 100%; }
    .rcm-perks li { font-size: .78rem; }
}
@media (max-width: 359.98px) {
    .rcm-sticky img { display: none; }
    .rcm-foot { flex-wrap: wrap; }
    .rcm-foot .rcm-btn { width: 100%; }
}
