/* ============================================================
   بوتیک ریحانه — پایه: پالت، ریست، دکمه‌ها، فرم‌ها، دیالوگ، دراور
   بازسازی دقیق پالت globals.css نسخهٔ v56
   ============================================================ */

:root {
        --rh-radius: 0.8rem;
        --rh-background: #f7f3eb;
        --rh-foreground: #2b2e24;
        --rh-card: #fffdf8;
        --rh-popover: #fffdf8;
        --rh-primary: #2e5339;
        --rh-primary-fg: #f7f3eb;
        --rh-secondary: #ede5d3;
        --rh-secondary-fg: #4a4436;
        --rh-muted: #f0ebe0;
        --rh-muted-fg: #7c7a6d;
        --rh-accent: #e6ede2;
        --rh-accent-fg: #2e5339;
        --rh-destructive: #b4533c;
        --rh-border: #e3dac8;
        --rh-input: #e3dac8;
        --rh-ring: #2e5339;
        --rh-gold: #a98548;
        --rh-cream: #f7f3eb;
        --rh-sale: #b4533c;
        --rh-sky: #0369a1;
        --rh-emerald: #047857;
}

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--rh-border); }

/* ویژگی hidden همیشه برنده است — پنل‌های بسته واقعاً بسته بمانند */
[ hidden ] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* v1.7.3 — رنگ بومِ سند = سبز تیرهٔ فوتر. ناحیهٔ دکمه‌های لمسی سیستم‌عامل (زیر فوتر در موبایل)
 * رنگش را از «بوم سند» می‌گیرد نه از خود فوتر — بوم کرم/سفید بود و دکمه‌های سفیدِ
 * سیستم دیده نمی‌شدند (درخواست مشتری). بدنه همچنان کرم است؛ ظاهر صفحه عوض نمی‌شود. */
html { background: var(--rh-primary); }

html body { margin: 0; max-width: none; width: auto; }

body {
        margin: 0;
        background: var(--rh-background);
        color: var(--rh-foreground);
        font-family: "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
        font-feature-settings: "ss02";
        font-size: 16px;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        direction: rtl;
}

/* R14 — ستون فلکس سراسری: هدر چسبان + سایتِ flex:1 → فوتر همیشه کفِ دید است و
 * صفحات کوتاه (سبد/محصول/دربارهٔ ما) دیگر ۹۵px اسکرولِ اجباریِ «هدر + ۱۰۰vh» ندارند.
 * بقیهٔ فرزندان body همه fixed/absolute هستند و در فلکس وارد نمی‌شوند. */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > .rh-site { flex: 1 1 auto; }

::selection { background: #2e5339; color: #f7f3eb; }

img, svg, video { display: block; max-width: 100%; height: auto; }
img { border-style: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; cursor: pointer; border: 0; padding: 0; color: inherit; font-size: inherit; line-height: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

h1,h2,h3,h4,p,ul,ol { margin: 0; padding: 0; }
ul,ol { list-style: none; }

/* اسکرول‌بار ظریف برنجی — عین v56 */
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: #f0ebe0; }
::-webkit-scrollbar-thumb { background: #cbbfa4; border-radius: 8px; border: 2px solid #f0ebe0; }
::-webkit-scrollbar-thumb:hover { background: #a98548; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.rh-skip { position: absolute; right: 8px; top: -48px; z-index: 999; background: var(--rh-primary); color: #fff; padding: 8px 16px; border-radius: 999px; transition: top .2s; }
.rh-skip:focus { top: 8px; }

/* R14 — min-height:100vh حذف شد (با هدر چسبان همیشه ۹۵px اسکرول اجباری می‌ساخت)؛
 * حالا body ستون فلکس است و .rh-site با flex:1 جا را پر می‌کند. */
.rh-site { display: flex; flex-direction: column; flex: 1 1 auto; }
.rh-main { flex: 1; }

/* ---------- آیکن‌ها ---------- */
.rh-ic { width: 24px; height: 24px; flex-shrink: 0; }
/* v1.5.9 — همهٔ اندازه‌های آیکن له‌ناشدنی شدند؛ در دکمهٔ باریک «مشاهده محصول» کارت (موبایل)
 * فلاکس آیکن چشم را له می‌کرد (۱۴px ← ۵٫۷px!) چون فقط rh-ic پایه flex-shrink:0 داشت.
 * حالا آیکن هرگز فشرده نمی‌شود؛ سرریزِ چند پیکسلی بی‌صدا در padding دوطرف دکمه جذب می‌شود. */
.rh-ic--lg, .rh-ic--sm, .rh-ic--xs, .rh-ic--xl, .rh-ic--xxl { flex-shrink: 0; }
.rh-ic--lg { width: 24px; height: 24px; }
.rh-ic--sm { width: 16px; height: 16px; }
.rh-ic--xs { width: 14px; height: 14px; }
.rh-ic--xl { width: 24px; height: 24px; }
.rh-ic--xxl { width: 64px; height: 64px; }
.rh-ic--white { color: #fff; }
.rh-gold-ic { color: var(--rh-gold); }
.rh-primary-ic { color: var(--rh-primary); }
.rh-muted-ic { color: var(--rh-muted-fg); }
.rh-favfill { color: var(--rh-sale); fill: currentColor; }
.rh-star { width: 14px; height: 14px; }
.rh-stars--xs .rh-star { width: 12px; height: 12px; }
.rh-star--full { color: var(--rh-gold); fill: currentColor; }
.rh-star--empty { color: rgba(124,122,109,.3); fill: none; }
.rh-stars { display: inline-flex; align-items: center; gap: 2px; direction: rtl; }

/* ---------- دکمه‌ها ---------- */
.rh-btn {
        display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
        border-radius: calc(var(--rh-radius) + .2rem); font-weight: 500; font-size: 14px;
        padding: 0 16px; height: 36px; transition: all .25s; white-space: nowrap;
        outline: none;
}
.rh-btn:focus-visible { box-shadow: 0 0 0 2px var(--rh-background), 0 0 0 4px var(--rh-ring); }
.rh-btn--pill { border-radius: 9999px; }
.rh-btn--sm { height: 36px; font-size: 14px; padding: 0 14px; }
.rh-btn--lg { height: 40px; padding: 0 24px; font-size: 15px; }
.rh-btn--primary { background: var(--rh-primary); color: var(--rh-primary-fg); box-shadow: 0 10px 15px -3px rgba(46,83,57,.25); }
.rh-btn--primary:hover { background: #25432e; }
.rh-btn--primary:disabled { opacity: .5; cursor: not-allowed; }
.rh-btn--outline { border: 1px solid var(--rh-border); background: transparent; color: var(--rh-foreground); }
.rh-btn--outline:hover { background: var(--rh-accent); color: var(--rh-accent-fg); }
.rh-btn--outline-gold { border: 1px solid rgba(169,133,72,.5); color: var(--rh-gold); background: transparent; }
.rh-btn--outline-gold:hover { background: rgba(169,133,72,.1); }

/* ---------- بج‌های آیکن هدر ---------- */
.rh-icon-badge {
        position: absolute; top: -2px; inset-inline-start: -2px;
        min-width: 20px; height: 20px; padding: 0 4px; border-radius: 9999px;
        font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
        line-height: 1;
}
.rh-icon-badge--sale { background: var(--rh-sale); color: var(--rh-primary-fg); }
.rh-icon-badge--gold { background: var(--rh-gold); color: var(--rh-primary); }

/* ---------- کارت محصول — برجستگی لطیف هنگام هاور (عین v56) ---------- */
.product-card { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(46,83,57,.35); }
.product-card:hover .product-img { transform: scale(1.05); }
.product-img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }

/* ---------- قیمت ---------- */
.rh-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; max-width: 100%; }
.rh-price__regular { color: rgba(124,122,109,.7); text-decoration: line-through; font-size: 12px; }
.rh-price__main { font-weight: 600; color: var(--rh-primary); font-size: 16px; }
.rh-price__unit { font-size: 12px; color: var(--rh-muted-fg); }
.rh-price--sm .rh-price__main { font-size: 14px; }
.rh-price--lg .rh-price__main { font-size: 24px; }
.rh-price--xl .rh-price__main { font-size: 20px; }
.rh-price--xxl { flex-wrap: nowrap; }
.rh-price--xxl .rh-price__main { font-size: 26px; line-height: 32px; font-weight: 900; }
.rh-price--strong-unit .rh-price__unit { font-weight: 800; color: rgba(43,46,36,.75); }
.rh-price--call .rh-price__main { font-weight: 600; color: var(--rh-primary); font-size: 16px; }

/* ---------- استپر تعداد ---------- */
/* R14 — استپر تعداد هرگز نباید به‌عنوان فرزند فلکس له شود (دکمه‌ها ۳۶px → ۱۴px شده
 * بودند و «+/− به عدد می‌چسبیدند»)؛ flex:none روی خودِ استپر و فرزندانش + عدد عریض‌تر (۵۲px)
 * تا فاصلهٔ واضح بین +/− و رقم باشد. عین ساختار v56 ولی خواناتر. */
.rh-qty { display: inline-flex; align-items: center; border-radius: 9999px; border: 1px solid var(--rh-border); background: var(--rh-card); overflow: hidden; flex: none; }
.rh-qty__btn { width: 36px; height: 36px; font-size: 18px; font-weight: 700; color: var(--rh-primary); transition: background .2s; flex: none; }
.rh-qty__btn:hover:not(:disabled) { background: var(--rh-accent); }
.rh-qty__btn:disabled { opacity: .4; cursor: not-allowed; }
/* R15 — ۵۲→۳۶: عددشمار ۱۲۶px بیش از حد بزرگ بود و ردیف خرید دیالوگ سرریز می‌شد؛
 * ۱۱۰px = اندازهٔ اسمی v56 (دکمه‌های ۳۶ + عدد ۳۶) با فاصلهٔ تمیز گلیف‌ها */
.rh-qty__num { width: 36px; text-align: center; font-size: 14px; font-weight: 600; flex: none; }
/* R15 — position:fixed (نه absolute بدون لنگر): در RTL ورودیِ ربعِ حقیقی سبد ۱۲۲px به چپ بیرون
 * می‌زد و اسکرول افقیِ ۴۸۲/۳۶۰ می‌ساخت؛ fixed هرگز scrollWidth نمی‌سازد و مقدار برای ووکامرس خوانا می‌ماند */
.rh-qty__hidden { position: fixed !important; left: 0 !important; bottom: 0 !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }

/* ---------- عنوان بخش ---------- */
.rh-section-title { text-align: center; margin-bottom: 32px; }
.rh-section-title__gold { color: var(--rh-gold); font-size: 14px; font-weight: 600; letter-spacing: .025em; margin-bottom: 8px; }
.rh-section-title__bar { display: block; height: 3px; width: 56px; border-radius: 9999px; background: rgba(169,133,72,.7); margin: 16px auto 0; }
/* v1.4.5 — عنوان راست‌چین بدون خط، متن بزرگ‌تر (مجلهٔ ریحانه — انتخاب کاربر از بین راست/وسط) */
.rh-section-title--start { text-align: start; margin-bottom: 22px; }
.rh-section-title--start .rh-section-title__gold { font-size: 21px; font-weight: 900; color: var(--rh-primary); letter-spacing: 0; margin-bottom: 0; }
@media (min-width: 768px) { .rh-section-title--start .rh-section-title__gold { font-size: 25px; } }

/* ---------- سلکت عمومی ---------- */
.rh-select { position: relative; display: block; }
.rh-select select, .rh-select__fake {
        appearance: none; -webkit-appearance: none;
        width: 100%; height: 36px; border-radius: 12px;
        border: 1px solid var(--rh-input); background: var(--rh-card);
        padding: 0 12px; font-size: 14px; outline: none;
}
.rh-select select:focus { box-shadow: 0 0 0 2px rgba(46,83,57,.4); }
.rh-select__arrow { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; color: var(--rh-muted-fg); }
.rh-select--sort { width: 176px; }
.rh-select--sort select { border-radius: 9999px; background: var(--rh-card); height: 38px; }

/* ---------- دیالوگ عمومی (پنجره‌های ویترین) ---------- */
.rh-dialog { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
/* v1.4.6 — پس‌زمینهٔ پشت مودال تار می‌شود (درخواست کاربر: «وقتی مودال باز میشه صفحهٔ زیرین تار نمیشه») */
.rh-dialog__backdrop { position: absolute; inset: 0; background: rgba(20,24,18,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rh-dialog__panel {
        position: relative; background: var(--rh-card); border: 1px solid var(--rh-border);
        border-radius: 16px; width: 100%; max-height: 90vh; overflow-y: auto;
        box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}
.rh-dialog__panel--track { max-width: 512px; padding: 20px; }
.rh-dialog__panel--blog { max-width: 672px; max-height: 80vh; overflow-y: auto; }
/* R10 — کوییک‌ویو محصول = دیالوگ v56 (اندازه‌گیری زندهٔ v56: عکس ۲۰۵×۳۲۰، دکمهٔ خرید ۱۶۷×۴۰).
 * R15 — ۵۱۲→۵۶۰ (به‌همراه گرید ۲۰۵px+۱fr): ردیف خرید (عددشمار ۱۱۰ + دکمهٔ افزودن)
 * بدون سرریز و بدون «سواپ» جا می‌شود — گزینهٔ «پنجرهٔ بزرگ‌تر» کاربر */
.rh-qv { max-width: 560px; }
.rh-qv [data-qv-rating] { cursor: pointer; }
.rh-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rh-dialog__title { font-weight: 900; font-size: 18px; }
.rh-dialog__desc { font-size: 14px; color: var(--rh-muted-fg); margin-top: 2px; }
.rh-dialog__close {
        width: 36px; height: 36px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
        background: rgba(255,253,248,.95); border: 1px solid var(--rh-border); box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); z-index: 10;
}
.rh-dialog__close:hover { background: var(--rh-accent); }

/* در موبایل دیالوگ‌ها تمام‌صفحه (عین max-md: قواعد v56) */
@media (max-width: 767px) {
        .rh-dialog { padding: 0; align-items: stretch; }
        .rh-dialog__panel { max-width: 100% !important; border-radius: 0; border: 0; min-height: 100dvh; max-height: none !important; }
}

/* ---------- دراور سبد ---------- */
.rh-drawer { position: fixed; inset: 0; z-index: 90; }
.rh-drawer__backdrop { position: absolute; inset: 0; background: rgba(20,24,18,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.rh-drawer__panel {
        position: absolute; top: 0; bottom: 0; left: 0; width: 100%; max-width: 448px;
        background: var(--rh-card); box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
        display: flex; flex-direction: column;
}
@media (min-width: 640px) { .rh-drawer__panel { border-start-end-radius: 16px; border-end-end-radius: 16px; } }
.rh-drawer__head { padding: 20px 20px 12px 48px; border-bottom: 1px solid var(--rh-border); display: flex; align-items: flex-start; justify-content: space-between; }
.rh-drawer__title { font-weight: 900; font-size: 18px; }
.rh-drawer__desc { font-size: 12px; color: var(--rh-muted-fg); margin-top: 2px; }
.rh-drawer__body { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- بج‌های وضعیت ---------- */
.rh-badge { display: inline-block; border-radius: 9999px; border: 1px solid; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.st-pending  { background: rgba(169,133,72,.1); color: var(--rh-gold); border-color: rgba(169,133,72,.4); }
.st-paid     { background: rgba(46,83,57,.1); color: var(--rh-primary); border-color: rgba(46,83,57,.3); }
.st-shipped  { background: rgba(14,165,233,.1); color: var(--rh-sky); border-color: rgba(14,165,233,.3); }
.st-delivered{ background: rgba(16,185,129,.1); color: var(--rh-emerald); border-color: rgba(16,185,129,.3); }
.st-cancelled{ background: var(--rh-muted); color: var(--rh-muted-fg); border-color: var(--rh-border); }
.st-failed   { background: rgba(180,83,60,.1); color: var(--rh-destructive); border-color: rgba(180,83,60,.3); }

/* ---------- پنهان‌های فرم ووکامرس (فیلدهای غیر v56) ----------
 * R15 — position:fixed به‌جای left:-9999px: در سند RTL مقدار منفیِ left، ناحیهٔ
 * اسکرول افقیِ ~۱۰۲۲۴px روی فرم تسویه می‌ساخت (همان «سواپ به چپ و راست»).
 * المان fixed هرگز در محاسبهٔ scrollWidth مشارکت نمی‌کند؛ فیلد همچنان در DOM
 * و برای ووکامرس خوانا می‌ماند. */
.rh-hidden-field { position: fixed !important; left: 0 !important; bottom: 0 !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
.rh-only-desktop { display: none; }
.rh-only-mobile { display: block; }
@media (min-width: 768px) { .rh-only-desktop { display: block; } .rh-only-mobile { display: none; } }

/* ---------- فرم‌های عمومی ---------- */
input[type="text"], input[type="tel"], input[type="email"], input[type="search"], input[type="number"], textarea {
        border: 1px solid var(--rh-input); background: var(--rh-card); border-radius: 12px;
        padding: 0 12px; height: 36px; font-size: 14px; outline: none; width: 100%;
        transition: box-shadow .2s;
}
textarea { height: auto; padding: 8px 12px; line-height: 1.7; }
input:focus, textarea:focus { box-shadow: 0 0 0 2px rgba(46,83,57,.4); }
input::placeholder, textarea::placeholder { color: var(--rh-muted-fg); }

/* v1.5.72 — screen-reader-text: utility class for accessibility (هم‌تراز با WordPress core) */
.screen-reader-text {
        border: 0;
        clip: rect(1px, 1px, 1px, 1px);
        clip-path: inset(50%);
        height: 1px;
        width: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        white-space: nowrap;
}
.screen-reader-text:focus {
        background-color: #f1f1f1;
        border-radius: 3px;
        box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
        clip: auto;
        clip-path: none;
        color: #21759b;
        display: block;
        font-size: 14px;
        font-weight: 700;
        height: auto;
        left: 5px;
        line-height: normal;
        padding: 15px 23px 14px;
        text-decoration: none;
        top: 5px;
        width: auto;
        z-index: 100000;
}


/* v1.6.04 — Fix CLS: lazy images without dimensions get aspect-ratio: 1 (square)
 * Chrome DevTools recommendation: "define their aspect ratio using CSS"
 * Product images are typically square (800x800) so this is safe. */
img[loading="lazy"]:not([width]):not([height]) {
        aspect-ratio: 1;
}

/* v1.7.0 — نتایج جست‌وجو (index.php قالب جدید) */
.rh-searchlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.rh-searchlist__item{margin:0}
.rh-searchlist__link{display:flex;align-items:center;gap:14px;padding:12px 16px;background:var(--rh-card-bg,#fff);border:1px solid var(--rh-line,#e7e0d2);border-radius:14px;text-decoration:none;color:inherit;transition:box-shadow .18s ease,border-color .18s ease}
.rh-searchlist__link:hover{border-color:var(--rh-primary,#2e5339);box-shadow:0 4px 14px rgba(46,83,57,.10)}
.rh-searchlist__link img{width:60px;height:60px;object-fit:cover;border-radius:10px;flex:0 0 auto}
.rh-searchlist__title{margin:0 0 4px;font-size:15px;font-weight:700}
.rh-searchlist__tag{display:inline-block;font-size:11px;font-weight:600;color:var(--rh-primary,#2e5339);background:rgba(46,83,57,.08);border-radius:999px;padding:2px 8px;vertical-align:middle;margin-inline-start:6px}
.rh-searchlist__excerpt{margin:0;font-size:13px;color:var(--rh-muted-fg,#8a8471);line-height:1.7}
.rh-searchlist__nav{margin-top:18px;display:flex;gap:8px;justify-content:center}
.rh-searchlist__nav .page-numbers{display:inline-block;padding:6px 12px;border:1px solid var(--rh-line,#e7e0d2);border-radius:8px;text-decoration:none;color:inherit;font-size:13px}
.rh-searchlist__nav .page-numbers.current{background:var(--rh-primary,#2e5339);color:#fff;border-color:var(--rh-primary,#2e5339)}

/* v1.10.34 — تاریخِ انتشار در فهرستِ جست‌وجو/آرشیو */
.rh-searchlist__meta { display: block; font-size: 12px; color: var(--rh-muted-fg); margin-top: 2px; }

/* v1.10.35 — تاریخِ انتشار زیرِ عنوانِ نوشته‌های مجله (صفحهٔ خودِ مقاله) */
.rh-page__meta { margin: 4px 0 0; font-size: 13px; color: var(--rh-muted-fg); }
