/* ============================================================
   تم ابزار میهن — هویت صنعتی (سرمه ای / نارنجی)
   ------------------------------------------------------------
   این فایل را بعد از همه CSSهای دیگر در header اضافه کن:
   <link rel="stylesheet" href="<?= asset('css/theme-abzarmih.css') ?>">
   ------------------------------------------------------------
   الهام: تمیزی داروکده + هویت صنعتی ابزار
   ============================================================ */

:root {
    /* پالت اصلی ابزار میهن */
    --am-primary:      #1e3a5f;   /* آبی تیره صنعتی */
    --am-primary-dark: #14283f;   /* آبی تیره‌تر */
    --am-accent:       #f47b20;   /* نارنجی ابزار */
    --am-accent-dark:  #d9660f;   /* نارنجی تیره‌تر */
    --am-blue:         #2d6cb5;   /* آبی روشن لینک */
    --am-bg:           #f5f7fa;   /* پس‌زمینه تمیز */
    --am-primary-rgb:  30, 58, 95;
    --am-accent-rgb:   244, 123, 32;

    /* override متغیرهای رنگی قالب پایه */
    --primary:      #1e3a5f !important;
    --primary-dark: #14283f !important;
    --color-primary: #1e3a5f !important;
}

/* ============================================================
   ۱) پس‌زمینه‌ها (bg-primary صورتی → آبی صنعتی)
   ============================================================ */
.bg-primary,
.btn-primary,
button.bg-primary,
.bg-\[\#e0457b\],
.bg-\[\#c73367\] {
    background-color: var(--am-primary) !important;
}
.bg-primary-dark,
.hover\:bg-primary-dark:hover,
.bg-\[\#c73367\] {
    background-color: var(--am-primary-dark) !important;
}
.hover\:bg-primary:hover { background-color: var(--am-primary-dark) !important; }

/* گرادیان‌های صورتی → گرادیان صنعتی آبی/نارنجی */
[style*="#e0457b"],
[style*="#ff7a9e"],
[style*="#c73367"] {
    /* این‌ها inline هستند؛ با کلاس‌های زیر پوشش داده می‌شوند */
}

/* ============================================================
   ۲) متن‌ها (text-primary صورتی → آبی)
   ============================================================ */
.text-primary,
a.text-primary,
.text-\[\#e0457b\],
.text-\[\#c73367\] {
    color: var(--am-primary) !important;
}

/* ============================================================
   ۳) حاشیه‌ها (border-primary)
   ============================================================ */
.border-primary,
.focus\:border-primary:focus,
.border-\[\#e0457b\] {
    border-color: var(--am-primary) !important;
}
.ring-primary,
.focus\:ring-primary:focus {
    --tw-ring-color: var(--am-primary) !important;
}

/* ============================================================
   ۴) هدر و منو
   ============================================================ */
.site-header { border-top: 3px solid var(--am-accent); }
.top-bar { background: var(--am-primary) !important; }
.top-bar a { color: #dbe4f0 !important; }
.top-bar a:hover { color: #fff !important; }

/* منوی دسته‌بندی */
.cat-nav { background: var(--am-primary) !important; }
.cat-nav__item > a { color: #eaf0f7 !important; }
.cat-nav__item > a:hover,
.cat-nav__item:hover > a { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
.cat-nav__dropdown { border-top: 3px solid var(--am-accent) !important; }
.cat-nav__dropdown a:hover { color: var(--am-accent) !important; background: #f5f7fa !important; }

/* دکمه‌های اکشن هدر (سبد، علاقه‌مندی) */
.action-btn:hover { color: var(--am-accent) !important; }

/* ============================================================
   ۵) کارت محصول
   ============================================================ */
.pcard .pcard__price .pcard__footer .pcard__price-main { color: var(--am-primary) !important; }
.pcard .pcard__price .pcard__footer .add-to-cart-btn,
.pcard .pcard__price .pcard__price-row .pcard__discount-pill {
    background: linear-gradient(135deg, var(--am-accent) 0%, var(--am-accent-dark) 100%) !important;
    box-shadow: 0 4px 10px rgba(var(--am-accent-rgb), 0.35) !important;
}
.pcard .pcard__price .pcard__footer .add-to-cart-btn:hover {
    box-shadow: 0 6px 14px rgba(var(--am-accent-rgb), 0.5) !important;
}
.badge-best { background: var(--am-accent) !important; }
.badge-new  { background: var(--am-blue) !important; }

/* ============================================================
   ۶) صفحه محصول
   ============================================================ */
.product-brand-tag {
    background: #eaf1f8 !important;
    color: var(--am-primary) !important;
}
.price-box .price-current,
.product-price-main { color: var(--am-primary) !important; }
.product-internal-links a[style*="fce7f3"] {
    background: #eaf1f8 !important;
    color: var(--am-primary) !important;
}
/* دکمه افزودن به سبد بزرگ */
.add-to-cart-main,
.btn-add-cart,
button[class*="add"] {
    background: var(--am-accent) !important;
}
.add-to-cart-main:hover { background: var(--am-accent-dark) !important; }

/* بخش نظرات (مودال و کپچا که قبلا ساختیم) */
.review-modal-btn { background: var(--am-primary) !important; }
.bg-primary\/10 { background: rgba(var(--am-primary-rgb), 0.1) !important; }

/* ============================================================
   ۷) صفحه اصلی — بخش تخفیف‌های ویژه
   ============================================================ */
.dc-section {
    background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-primary-dark) 100%) !important;
}
.dc-timer, .dc-badge { background: var(--am-accent) !important; }
.dc-price { color: var(--am-accent) !important; }

/* ============================================================
   ۸) پس‌زمینه کلی و بخش‌ها
   ============================================================ */
body.bg-gray-50 { background: var(--am-bg) !important; }
.bg-gray-100 { background: #eef1f6 !important; }

/* عنوان بخش‌ها با خط نارنجی */
.section-title,
.bw-smart-related-title {
    border-color: var(--am-accent) !important;
}
.bw-smart-related-title svg { color: var(--am-accent) !important; }

/* ============================================================
   ۹) فوتر
   ============================================================ */
.site-footer,
footer.site-footer { background: var(--am-primary) !important; }
.site-footer a:hover { color: var(--am-accent) !important; }

/* ============================================================
   ۱۰) لینک‌های عمومی و اسکرول‌بار
   ============================================================ */
a { color: inherit; }
a.link, .prose a { color: var(--am-blue); }

::selection { background: rgba(var(--am-accent-rgb), 0.25); }

/* دکمه‌های موجود شدن / اطلاع (نارنجی می‌ماند چون خودش هشدار است) */
.stock-alert-box button { background: var(--am-accent) !important; }

/* اسپینر و لودینگ */
.spinner { border-top-color: var(--am-primary) !important; }

/* ============================================================
   ۱۱) موبایل
   ============================================================ */
.mob-panel__head { background: var(--am-primary) !important; }
.mob-acc__trigger.open { color: var(--am-accent) !important; }
.mob-simple-link:active { background: #eef1f6 !important; }

/* ============================================================
   ۱۲) تصحیح‌های ریز رنگ صورتی باقی‌مانده
   ============================================================ */
[class*="pink"] { }  /* اگر جایی کلاس pink مانده، دستی override می‌کنیم */
.text-pink-500, .text-pink-600 { color: var(--am-primary) !important; }
.bg-pink-500, .bg-pink-600 { background: var(--am-primary) !important; }
.bg-pink-50 { background: #eaf1f8 !important; }

/* ============================================================
   ۱۳) مگامنوی حرفه‌ای — سرعنوان + گرید منظم
   ============================================================ */
.cat-nav { position: relative; }
.cat-nav__list { position: static; }
.cat-nav__item { position: static; }

.cat-nav__dropdown--mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    display: none;
    padding: 0;
    background: #fff;
    box-shadow: 0 16px 40px rgba(20,40,63,.16);
    border-top: 3px solid var(--am-accent);
    border-radius: 0 0 12px 12px;
    z-index: 200;
    overflow: hidden;
    animation: megaFade .18s ease;
}
.cat-nav__item:hover .cat-nav__dropdown--mega { display: block; }

@keyframes megaFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* سرعنوان مگامنو */
.mega-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: linear-gradient(90deg, #f5f7fa, #eaf1f8);
    border-bottom: 1px solid #e5eaf0;
}
.mega-head__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--am-primary);
    position: relative;
    padding-right: 14px;
}
.mega-head__title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: var(--am-accent);
    border-radius: 2px;
}
.mega-head__count {
    font-size: 12px;
    color: #8a97a8;
    background: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #e5eaf0;
}

/* گرید آیتم‌ها */
.mega-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px 10px;
    padding: 18px 26px 24px;
    max-height: 380px;
    overflow-y: auto;
}
.mega-grid a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    font-size: 13.5px;
    color: #3d4a5c !important;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s, color .15s, transform .15s;
}
.mega-grid a::before {
    content: "";
    flex: 0 0 6px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background .15s, transform .15s;
}
.mega-grid a:hover {
    background: #eaf1f8 !important;
    color: var(--am-primary) !important;
    transform: translateX(-3px);
}
.mega-grid a:hover::before { background: var(--am-accent); transform: scale(1.4); }

/* اسکرول‌بار ظریف */
.mega-grid::-webkit-scrollbar { width: 8px; }
.mega-grid::-webkit-scrollbar-thumb { background: #d5dde6; border-radius: 4px; }
.mega-grid::-webkit-scrollbar-track { background: #f5f7fa; }

/* سرگروه بدون لینک */
.cat-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: default;
    color: #eaf0f7 !important;
    transition: color .15s;
}
.cat-nav__item--group:hover .cat-nav__trigger { color: #fff !important; }
.cat-nav__item:hover .cat-nav__trigger svg,
.cat-nav__item:hover > a svg { transform: rotate(180deg); }
.cat-nav__trigger svg, .cat-nav__item > a svg { transition: transform .2s; }

/* رسپانسیو */
@media (max-width: 1280px) { .mega-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .mega-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .cat-nav__dropdown--mega { position: static; box-shadow: none; animation: none; }
    .mega-head { padding: 10px 16px; }
    .mega-grid { grid-template-columns: repeat(2, 1fr); max-height: none; padding: 10px; }
}

/* ============================================================
   ۱۴) نوار منوی اصلی (سرگروه‌ها) — استایل کامل
   ============================================================ */
.cat-nav {
    background: var(--am-primary) !important;
    box-shadow: 0 2px 8px rgba(20,40,63,.15);
}
.cat-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.cat-nav__list {
    display: flex !important;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
}
.cat-nav__item {
    display: flex;
    align-items: center;
}
/* هر آیتم منوی اصلی */
.cat-nav__item > a,
.cat-nav__item > .cat-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 52px;                 /* ارتفاع مناسب */
    padding: 0 18px;              /* فاصله افقی */
    font-size: 14px;
    font-weight: 600;
    color: #dbe4f0 !important;
    white-space: nowrap;
    position: relative;
    transition: color .15s, background .15s;
}
/* جداکننده عمودی بین آیتم‌ها */
.cat-nav__item:not(:last-child) > a::after,
.cat-nav__item:not(:last-child) > .cat-nav__trigger::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 1px;
    background: rgba(255,255,255,.14);
}
/* هاور: پس‌زمینه روشن‌تر + نوار نارنجی زیر */
.cat-nav__item:hover > a,
.cat-nav__item:hover > .cat-nav__trigger {
    color: #fff !important;
    background: rgba(255,255,255,.08);
}
.cat-nav__item > a::before,
.cat-nav__item > .cat-nav__trigger::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--am-accent);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform .2s;
}
.cat-nav__item:hover > a::before,
.cat-nav__item:hover > .cat-nav__trigger::before {
    transform: scaleX(1);
}

/* رسپانسیو: اگر جا نشد اسکرول افقی */
@media (max-width: 1100px) {
    .cat-nav__list { overflow-x: auto; scrollbar-width: none; }
    .cat-nav__list::-webkit-scrollbar { display: none; }
    .cat-nav__item > a,
    .cat-nav__item > .cat-nav__trigger { height: 48px; padding: 0 14px; font-size: 13px; }
}


/* ============================================================
   ۱۵) رفع نوار خاکستری اضافه + تضمین مخفی بودن دراپ‌داون بسته
   ============================================================ */
/* دراپ‌داون وقتی باز نیست، مطلقاً هیچ فضایی نگیرد */
.cat-nav__dropdown,
.cat-nav__dropdown--mega {
    position: absolute !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: block !important;
    max-height: 0;
    overflow: hidden;
}
.cat-nav__item:hover .cat-nav__dropdown,
.cat-nav__item:hover .cat-nav__dropdown--mega {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    max-height: 460px;
    overflow: visible;
}
/* mega-head و mega-grid فقط داخل دراپ‌داون‌اند، پس با آن مخفی می‌شوند.
   ولی برای اطمینان، پس‌زمینه‌شان بیرون نزند: */
.cat-nav { overflow: visible; }
.cat-nav__inner { background: transparent !important; }
.cat-nav__list { background: transparent !important; min-height: 0 !important; }

/* هیچ عنصری زیر nav نباید نوار خاکستری بسازد */
.cat-nav + * { margin-top: 0 !important; }

/* ============================================================
   ۱۶) لوگو بزرگ‌تر + top-bar با تلفن
   ============================================================ */
/* ============================================================
   لوگو + هدر هوشمند (جمع‌شونده با اسکرول)
   ============================================================ */
/* هدر sticky */
.site-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 900;
    background: #fff;
    transition: box-shadow .25s;
}
.site-header.is-scrolled {
    box-shadow: 0 4px 18px rgba(20,40,63,.12);
}
/* اطمینان: overflow-x روی html نه body (تا sticky در موبایل نشکند) */
html { overflow-x: hidden; }
body { overflow-x: clip; overflow-y: visible; }

/* لوگو حالت اول: ۲۰٪ بزرگ‌تر از ۶۲ → ۷۴px */
.site-logo img {
    height: 74px !important;
    max-height: 74px !important;
    width: auto !important;
    transition: height .25s ease, max-height .25s ease;
}
/* بعد از اسکرول: ۳۰٪ کوچک‌تر از حالت اول → ۵۲px */
.site-header.is-scrolled .site-logo img {
    height: 52px !important;
    max-height: 52px !important;
}

/* top-bar (تلفن‌ها): بعد از اسکرول جمع می‌شود */
.top-bar {
    background: var(--am-primary) !important;
    overflow: hidden;
    max-height: 60px;
    transition: max-height .25s ease, padding .25s ease, opacity .2s ease;
}
.site-header.is-scrolled .top-bar {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
}

/* main-bar: فضای کافی برای لوگو بزرگ + وسط‌چین عمودی */
.main-bar {
    display: flex;
    align-items: center;
    min-height: 90px;           /* فضای کافی برای لوگوی 74px */
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    transition: min-height .25s ease, padding .25s ease;
}
.site-logo {
    display: flex;
    align-items: center;
    line-height: 0;             /* حذف فضای اضافه inline */
}
.site-logo img { display: block; }
.site-header.is-scrolled .main-bar {
    min-height: 66px;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

/* موبایل: هدر و منو بعد از اسکرول فیکس و در دسترس */
@media (max-width: 768px) {
    .site-logo img { height: 58px !important; max-height: 58px !important; }
    .site-header.is-scrolled .site-logo img { height: 44px !important; max-height: 44px !important; }
    /* منوی دسته‌بندی هم sticky بماند */
    .site-header.is-scrolled .cat-nav {
        position: sticky;
        top: 0;
    }
}

/* top-bar: منو راست، تلفن چپ */
.top-bar__inner {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 40px;
}
.top-bar__menus { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top-bar__contact { display: flex; align-items: center; gap: 16px; }
.top-contact-item {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: #eaf0f7 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    transition: color .15s;
}
.top-contact-item span { font-size: 18px !important; }
.top-contact-item svg { width: 20px !important; height: 20px !important; color: var(--am-accent); }
.top-contact-item:hover { color: var(--am-accent) !important; }

/* موبایل: تلفن‌ها حتما دیده شوند (منوها مخفی، تلفن‌ها وسط) */
@media (max-width: 768px) {
    .top-bar { display: block !important; }
    .top-bar__menus { display: none !important; }
    .top-bar__inner { justify-content: center; padding: 8px 12px; flex-wrap: wrap; gap: 14px; }
    .top-bar__contact { display: flex !important; gap: 18px; }
    .top-contact-item { font-size: 15px !important; }
    .top-contact-item span { font-size: 15px !important; }
}

/* ============================================================
   ۱۷) عکس‌های داخل محتوا — وسط‌چین (کلاس‌های واقعی)
   ============================================================ */
.product-content img,
.post-content img,
.bw-rich img,
.cat-intro img,
.cat-desc img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 20px auto !important;      /* وسط‌چین */
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(20,40,63,.1);
}
/* عکس داخل لینک هم وسط */
.product-content a,
.post-content a,
.bw-rich a {
    display: inline;
}
.product-content a:has(img),
.post-content a:has(img),
.bw-rich a:has(img) {
    display: block;
    text-align: center;
}
/* figure و کپشن */
.product-content figure,
.post-content figure,
.bw-rich figure { text-align: center; margin: 20px auto; }
.product-content figcaption,
.post-content figcaption,
.bw-rich figcaption { font-size: 13px; color: #8a97a8; margin-top: 6px; text-align: center; }

/* ============================================================
   ۱۸) جدول‌های داخل محتوا — استایل استاندارد و کامل
   ============================================================ */
.product-content table,
.post-content table,
.bw-rich table,
.cat-intro table {
    width: 100% !important;              /* عرض کامل */
    border-collapse: collapse !important;
    margin: 24px 0 !important;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(20,40,63,.08);
    border: 1px solid #e5eaf0;
    display: table !important;           /* جلوگیری از جمع‌شدگی */
}
/* سرستون */
.product-content table th,
.post-content table th,
.bw-rich table th,
.cat-intro table th {
    background: linear-gradient(135deg, #1e3a5f, #14283f) !important;
    color: #fff !important;
    font-weight: 700;
    padding: 14px 16px !important;
    text-align: right;
    border: none !important;
    font-size: 14px;
}
/* سلول‌ها */
.product-content table td,
.post-content table td,
.bw-rich table td,
.cat-intro table td {
    padding: 12px 16px !important;
    border: 1px solid #eaf1f8 !important;
    text-align: right;
    color: #3d4a5c;
    vertical-align: middle;
}
/* ردیف زوج/فرد */
.product-content table tr:nth-child(even) td,
.post-content table tr:nth-child(even) td,
.bw-rich table tr:nth-child(even) td,
.cat-intro table tr:nth-child(even) td {
    background: #f7f9fc;
}
/* هاور ردیف */
.product-content table tr:hover td,
.post-content table tr:hover td,
.bw-rich table tr:hover td,
.cat-intro table tr:hover td {
    background: #eaf1f8;
}
/* اگر جدول اولین ردیفش th نبود، ردیف اول را سرستون کن */
.product-content table tr:first-child td,
.post-content table tr:first-child td,
.bw-rich table tr:first-child td {
    background: linear-gradient(135deg, #1e3a5f, #14283f);
    color: #fff;
    font-weight: 700;
}
/* اسکرول افقی در موبایل */
@media (max-width: 640px) {
    .product-content table,
    .post-content table,
    .bw-rich table,
    .cat-intro table {
        display: block !important;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ============================================================
   ۱۹) دکمه «تماس بگیرید» برای محصولات ناموجود
   ============================================================ */
.pcard__footer--contact {
    display: flex;
    justify-content: center;
    width: 100%;
}
.pcard__contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 14px;
    background: linear-gradient(135deg, #1e3a5f, #14283f);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all .18s;
    box-shadow: 0 2px 8px rgba(30,58,95,.2);
}
.pcard__contact-btn:hover {
    background: linear-gradient(135deg, #f47b20, #d96812);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244,123,32,.3);
}
.pcard__contact-btn svg { color: #fff; }

/* دکمه تماس در صفحه تک محصول */
.product-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1e3a5f, #14283f);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    transition: all .18s;
    box-shadow: 0 4px 14px rgba(30,58,95,.25);
}
.product-contact-btn:hover {
    background: linear-gradient(135deg, #f47b20, #d96812);
    transform: translateY(-1px);
}
.product-contact-btn svg { color: #fff; }

/* ============================================================
   ۲۰) سه حالت وضعیت: موجود / تماس بگیرید / ناموجود
   ============================================================ */
/* badge تماس بگیرید (نارنجی - محصول موجود ولی تماس) */
.badge-contact {
    background: var(--am-accent) !important;
    color: #fff !important;
}
/* badge ناموجود (خاکستری) */
.badge-out {
    background: #9ca3af !important;
    color: #fff !important;
}
/* متن ناموجود در کارت */
.pcard__out-badge {
    font-size: 0.75rem;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}
/* badge ناموجود در صفحه محصول */
.product-unavail-badge {
    display: inline-block;
    padding: 8px 20px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}


/* ============================================================
   ۲۱) لینک‌های داخل متن محتوا — واضح و قابل کلیک
   ============================================================ */
.product-content a,
.post-content a,
.bw-rich a,
.cat-intro a {
    color: var(--am-link, #2d6cb5) !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(45,108,181,.4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: color .15s, text-decoration-color .15s, background .15s;
    padding: 0 2px;
    border-radius: 3px;
}
.product-content a:hover,
.post-content a:hover,
.bw-rich a:hover,
.cat-intro a:hover {
    color: var(--am-accent) !important;
    text-decoration-color: var(--am-accent);
    background: rgba(244,123,32,.08);
}
/* استثنا: عکس‌های لینک‌دار زیرخط نگیرند */
.product-content a:has(img),
.post-content a:has(img),
.bw-rich a:has(img) {
    text-decoration: none;
    font-weight: normal;
    background: none;
    padding: 0;
}

/* ============================================================
   ۲۲) کروسل حرفه‌ای محصولات مشابه
   ============================================================ */
.related-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.related-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 8px 4px 14px;
    flex: 1;
    scrollbar-width: none;
}
.related-track::-webkit-scrollbar { display: none; }
.related-track > .pcard {
    flex: 0 0 195px;
    max-width: 195px;
    scroll-snap-align: start;
}
.related-track .pcard { margin: 0; }

/* دکمه‌های ناوبری */
.related-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5eaf0;
    background: #fff;
    color: var(--am-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(20,40,63,.12);
    transition: all .18s;
    z-index: 2;
}
.related-nav:hover {
    background: var(--am-primary);
    color: #fff;
    border-color: var(--am-primary);
    transform: scale(1.08);
}
.related-nav:active { transform: scale(0.96); }

@media (max-width: 640px) {
    .related-track > .pcard { flex-basis: 155px; max-width: 155px; }
    .related-nav { width: 34px; height: 34px; }
}

/* ============================================================
   ۲۳) بهبود کارت محصول (بکگراند عکس‌ها سفید است)
   ============================================================ */
.pcard {
    background: #fff !important;
    border: 1px solid #e8edf3 !important;
    border-radius: 14px !important;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s, transform .2s;
    box-shadow: 0 1px 3px rgba(20,40,63,.04);
}
.pcard:hover {
    border-color: #c5d4e6 !important;
    box-shadow: 0 8px 24px rgba(20,40,63,.12) !important;
    transform: translateY(-3px);
}
/* ناحیه عکس: پس‌زمینه خیلی روشن تا عکس سفید محو نشود */
.pcard .pcard__img,
.pcard__img-wrap {
    background: #f8fafc !important;
    border-bottom: 1px solid #f0f3f7;
}
/* قیمت کارت پررنگ‌تر */
.pcard__price-main {
    color: var(--am-primary) !important;
    font-weight: 800;
}

/* ============================================================
   ۲۴) باکس تماس حرفه‌ای (محصولات contact) — تماس + واتساپ
   ============================================================ */
.contact-cta-box {
    background: linear-gradient(135deg, #f0f5fb, #e3ecf7);
    border: 1px solid #c5d4e6;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 0.875rem;
}
.contact-cta-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: #1e3a5f;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.75;
    margin-bottom: 1rem;
}
.contact-cta-head svg { color: var(--am-accent); flex-shrink: 0; margin-top: 3px; }
.contact-cta-actions {
    display: flex;
    gap: 0.75rem;
}
.contact-cta-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 0.75rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, background .18s;
}
.contact-cta-btn--call {
    background: linear-gradient(135deg, #1e3a5f, #14283f);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(30,58,95,.22);
}
.contact-cta-btn--call:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(30,58,95,.32); }
.contact-cta-btn--wa {
    background: linear-gradient(135deg, #25d366, #1da851);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37,211,102,.25);
}
.contact-cta-btn--wa:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(37,211,102,.38); }
.contact-cta-btn svg { color: #fff; flex-shrink: 0; }
.contact-cta-number {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e3a5f;
    letter-spacing: 1px;
    font-family: Tahoma, sans-serif;
    direction: ltr;
}
@media (max-width: 480px) {
    .contact-cta-actions { flex-direction: column; }
}

/* ============================================================
   ۲۵) نظم کارت محصول — عنوان ۲-۳ خطی نظم را به هم نزند
   ============================================================ */
.pcard {
    display: flex !important;
    flex-direction: column;
    height: 100%;
}
/* عنوان: ارتفاع ثابت برای ۲ خط */
.pcard__name {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;          /* دو خط ثابت */
    line-height: 1.4;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}
/* بخش پایینی کارت (قیمت/دکمه) همیشه ته کارت */
.pcard__footer,
.pcard__footer--contact {
    margin-top: auto;
}
/* گرید دسته/برند: کارت‌ها هم‌ارتفاع */
.products-grid,
.product-list-grid,
.category-products {
    align-items: stretch;
}
.products-grid > *,
.product-list-grid > * { display: flex; }

/* ============================================================
   ۲۶) گالری تصاویر محصول — مرتب و ریسپانسیو
   ============================================================ */
.gallery-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;          /* جلوگیری از اسکرول افقی صفحه */
}
/* عکس اصلی */
.gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}
/* ردیف thumbnailها — wrap می‌شوند، اسکرول صفحه نمی‌زنند */
.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;           /* مهم: به خط بعد می‌روند، نه اسکرول */
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}
.gallery-thumb {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    padding: 0;
    background: #fff;
    border: 1.5px solid #e5eaf0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    background: #fafbfc;
}
.gallery-thumb:hover { border-color: #c5d4e6; transform: translateY(-1px); }
.gallery-thumb.active {
    border-color: var(--am-accent);
    box-shadow: 0 0 0 2px rgba(244,123,32,.15);
}

/* موبایل: thumbnailها کوچک‌تر ولی همچنان مرتب و wrap */
@media (max-width: 640px) {
    .gallery-thumb { width: 54px; height: 54px; }
    .gallery-thumbs { gap: 6px; }
}

/* جلوگیری کلی از اسکرول افقی صفحه در موبایل */
@media (max-width: 768px) {
    html { overflow-x: hidden; max-width: 100%; }
    body { overflow-x: clip; max-width: 100%; }
    .gallery-wrap, .product-gallery, .product-info { max-width: 100%; overflow-x: hidden; }
}

/* ============================================================
   ۲۷) پاکسازی کامل رنگ صورتی باقی‌مانده → آبی ابزارمیهن
   ============================================================ */
/* دکمه‌های مرتب‌سازی و فیلتر فعال */
.sort-opt.active,
.sort-opt:hover,
.filter-chip,
.view-btn.active,
.chip.active,
.tab.active,
.badge-new {
    background: var(--am-primary) !important;
    color: #fff !important;
    border-color: var(--am-primary) !important;
}
.sort-opt.active { color: #fff !important; }

/* هر جا رنگ صورتی قالب پایه مانده */
[style*="#ec4899"], [style*="#EC4899"] { color: var(--am-primary) !important; }
[style*="background:#ec4899"], [style*="background: #ec4899"] { background: var(--am-primary) !important; }

/* کلاس‌های صورتی Tailwind */
.text-pink-400, .text-pink-500, .text-pink-600, .text-pink-700 { color: var(--am-primary) !important; }
.bg-pink-400, .bg-pink-500, .bg-pink-600, .bg-pink-700 { background: var(--am-primary) !important; }
.bg-pink-50, .bg-pink-100 { background: #eaf1f8 !important; }
.border-pink-400, .border-pink-500, .border-pink-600 { border-color: var(--am-primary) !important; }
.ring-pink-500, .ring-pink-400 { --tw-ring-color: var(--am-primary) !important; }
.from-pink-500, .to-pink-500, .from-pink-600, .to-pink-600 { --tw-gradient-from: var(--am-primary) !important; --tw-gradient-to: var(--am-primary) !important; }

/* هاور و فوکوس صورتی */
.hover\:bg-pink-600:hover, .hover\:bg-pink-700:hover { background: var(--am-primary-dark, #14283f) !important; }
.hover\:text-pink-600:hover { color: var(--am-accent) !important; }

/* رادیو/چک‌باکس فعال (که صورتی بود) */
input[type="radio"]:checked, input[type="checkbox"]:checked { accent-color: var(--am-primary) !important; }

/* لینک‌های فعال صورتی */
a.active, .nav-link.active, .page-item.active .page-link {
    background: var(--am-primary) !important;
    color: #fff !important;
    border-color: var(--am-primary) !important;
}

/* ============================================================
   ۲۸) انتخاب واریانت محصول
   ============================================================ */
.variant-box {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 0.875rem;
}
.variant-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
}
.variant-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.variant-opt {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1.5px solid #e5eaf0;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all .15s;
}
.variant-opt:hover { border-color: #c5d4e6; }
.variant-opt input[type="radio"] { accent-color: var(--am-primary); width: 18px; height: 18px; flex-shrink: 0; }
.variant-opt input:checked ~ .variant-opt-name { font-weight: 700; color: var(--am-primary); }
.variant-opt:has(input:checked) {
    border-color: var(--am-primary);
    background: #f0f5fb;
    box-shadow: 0 0 0 2px rgba(30,58,95,.08);
}
.variant-opt-name {
    flex: 1;
    font-size: 0.9rem;
    color: #374151;
}
.variant-opt-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    white-space: nowrap;
}
.variant-opt--out {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f9fafb;
}
.variant-opt-out-label {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 600;
}

/* تخفیف داخل گزینه واریانت */
.variant-opt-price { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.variant-opt-old {
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
}
.variant-opt-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
}
.variant-opt-now { font-weight: 800; color: #1e3a5f; }

/* ============================================================
   ۱۲) اصلاحات ۱۴۰۵/۰۵/۱۱
   ============================================================ */

/* --- ۱) دکمه جستجو ---------------------------------------
   app.css دکمه را بدون اندازه و با رنگ خاکستری ساخته بود و تم
   فقط پس زمینه نارنجی رویش گذاشته بود؛ نتیجه یک مربع نارنجی
   توپر بود که آیکون تویش دیده نمی شد. اینجا کامل بازتعریف می شود. */
   و فقط .blog-content را استثنا کرده بود. متن مقاله ها با کلاس
   post-content رندر می شود، توضیحات محصول و دسته با bw-rich —
   برای همین همه بولت ها ناپدید شده بودند. */
.post-content ul,
.bw-rich ul,
.cat-desc ul,
.cat-intro ul,
.am-hometext-content ul,
.product-desc ul,
.blog-content ul {
    list-style: disc outside !important;
    padding-right: 1.5rem;
    margin: 0 0 1rem;
}
.post-content ol,
.bw-rich ol,
.cat-desc ol,
.cat-intro ol,
.am-hometext-content ol,
.product-desc ol,
.blog-content ol {
    list-style: decimal outside !important;
    padding-right: 1.5rem;
    margin: 0 0 1rem;
}
.post-content ul ul,
.bw-rich ul ul,
.cat-desc ul ul,
.am-hometext-content ul ul { list-style: circle outside !important; margin-bottom: 0.35rem; }

.post-content li,
.bw-rich li,
.cat-desc li,
.cat-intro li,
.am-hometext-content li,
.product-desc li,
.blog-content li {
    display: list-item !important;
    margin-bottom: 0.45rem;
    line-height: 2;
}
.post-content li::marker,
.bw-rich li::marker,
.cat-desc li::marker,
.cat-intro li::marker,
.am-hometext-content li::marker,
.product-desc li::marker,
.blog-content li::marker { color: var(--am-accent, #f47b20); }

/* لیست های خود قالب (منو، فهرست مطالب، ...) باید بدون بولت بمانند */
.post-content .toc-list,
.bw-rich .toc-list { list-style: none !important; padding-right: 0; }

/* --- ۳) قیمت خط خورده در سبد خرید ------------------------ */
.cart-item__price-old {
    color: #9aa4b0;
    font-size: 0.8125rem;
    text-decoration: line-through;
    margin-left: 0.5rem;
}
.cart-item__price-off {
    display: inline-block;
    background: #e02b2b;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: 0.5rem;
}
.cart-item__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px; }

/* یادداشت «بدون ثبت نام» زیر دکمه سبد خرید */
.cart-guest-note {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #98a1ad;
    text-align: center;
    line-height: 1.9;
}
.cart-guest-note a { color: var(--am-primary, #1e3a5f); }

/* ============================================================
   ۱۳) راهنمای هزینه ارسال در تسویه حساب
   ============================================================ */
.ship-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.ship-help-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 1px solid #dfe4ea; border-radius: 999px;
    padding: 5px 12px; font-family: inherit; font-size: 12px; color: var(--am-primary, #1e3a5f);
    cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.ship-help-btn svg { width: 14px; height: 14px; }
.ship-help-btn:hover { border-color: var(--am-accent, #f47b20); background: #fff8f3; color: var(--am-accent, #f47b20); }

.ship-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ship-modal[hidden] { display: none; }
.ship-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 28, 43, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ship-modal__box {
    position: relative; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
    background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(10, 22, 40, .35);
    animation: shipIn .22s ease;
}
@keyframes shipIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ship-modal__box { animation: none; } }

.ship-modal__head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 15px 18px; background: var(--am-primary, #1e3a5f); color: #fff;
}
.ship-modal__head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ship-modal__x { background: none; border: none; color: rgba(255,255,255,.75); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ship-modal__x:hover { color: #fff; }

.ship-modal__body { padding: 16px 18px; overflow-y: auto; }
.ship-cards { display: flex; flex-direction: column; gap: 9px; margin-bottom: 15px; }
.ship-card { display: flex; align-items: flex-start; gap: 11px; background: #f7f9fc; border: 1px solid #eef1f5; border-radius: 12px; padding: 12px 14px; }
.ship-card__ico { flex: 0 0 auto; font-size: 20px; line-height: 1.4; }
.ship-card b { display: block; font-size: 13.5px; color: #1f2937; margin-bottom: 3px; }
.ship-card p { margin: 0; font-size: 12.5px; line-height: 1.95; color: #5b6572; }
.ship-amt { font-weight: 700; color: #1f2937; white-space: nowrap; }
.ship-free { color: #15803d; }

.ship-notes { margin: 0 0 14px; padding-right: 1.15rem; list-style: disc outside; }
.ship-notes li { font-size: 12.5px; line-height: 2; color: #5b6572; margin-bottom: 5px; }
.ship-notes li::marker { color: var(--am-accent, #f47b20); }

.ship-hl { background: #fff8f3; border: 1px solid #ffe0c7; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 2; color: #8a4a12; }

.ship-modal__foot { padding: 12px 18px; border-top: 1px solid #eef1f5; text-align: left; }
.ship-modal__ok {
    background: var(--am-primary, #1e3a5f); color: #fff; border: none; border-radius: 10px;
    padding: 9px 26px; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.ship-modal__ok:hover { background: #16304f; }

@media (max-width: 560px) {
    .ship-modal { padding: 0; align-items: flex-end; }
    .ship-modal__box { max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; }
}

/* ============================================================
   ۱۴) جستجو — طراحی تازه با پیشنهاد زنده
   ============================================================ */
/* z-index مهم است: .cat-nav در nav.css مقدار 500 دارد و بدون این،
   پنل پیشنهادها زیر منوی دسته بندی می رفت. هدر sticky خودش 1000 است. */
.am-search { position: relative; z-index: 900; flex: 1 1 auto; max-width: 620px; margin: 0 1.5rem; }
.am-search form {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid #e3e8ee; border-radius: 14px;
    padding: 0 8px 0 6px; height: 46px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.am-search form:focus-within { border-color: var(--am-accent, #f47b20); box-shadow: 0 0 0 4px rgba(244,123,32,.10); }
.am-search-ico { width: 18px; height: 18px; color: #9aa4b0; flex: 0 0 auto; margin-right: 6px; }
.am-search input {
    flex: 1 1 auto; min-width: 0; border: none; outline: none; background: none;
    font-family: inherit; font-size: 13.5px; color: #24303f; height: 100%;
}
.am-search input::placeholder { color: #a8b2be; }
.am-search-clear {
    display: none; border: none; background: #f1f4f8; color: #7b8694;
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    font-size: 17px; line-height: 1; flex: 0 0 auto;
}
.am-search.has-text .am-search-clear { display: block; }
.am-search-go {
    flex: 0 0 auto; border: none; cursor: pointer;
    background: var(--am-primary, #1e3a5f); color: #fff;
    border-radius: 10px; padding: 0 18px; height: 34px;
    font-family: inherit; font-size: 13px; font-weight: 700;
    transition: background .18s ease;
}
.am-search-go:hover { background: var(--am-accent, #f47b20); }

/* پنل پیشنهادها */
.am-search-panel {
    position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 5;
    background: #fff; border: 1px solid #e8ecf1; border-radius: 14px;
    box-shadow: 0 18px 44px rgba(16,29,45,.16); overflow: hidden; max-height: 74vh; overflow-y: auto;
}
.am-search-panel[hidden] { display: none; }
.am-sg-head {
    font-size: 11px; color: #98a1ad; padding: 9px 14px 5px; background: #fafbfc;
    border-bottom: 1px solid #f1f4f8;
}
.am-sg-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px;
    text-decoration: none; color: #24303f; border-bottom: 1px solid #f5f7f9;
}
.am-sg-item:last-child { border-bottom: none; }
.am-sg-item:hover, .am-sg-item.is-active { background: #f7f9fc; }
.am-sg-thumb {
    width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid #eef1f5; border-radius: 9px;
    background: #fafbfc; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.am-sg-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.am-sg-name { font-size: 13px; line-height: 1.7; flex: 1 1 auto; min-width: 0; }
.am-sg-name b { font-weight: 700; color: #16293f; }
.am-sg-price { font-size: 12.5px; font-weight: 700; color: #16293f; white-space: nowrap; }
.am-sg-price.off { color: #a8b2be; font-weight: 400; font-size: 11.5px; }
.am-sg-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f1f4f8; border-radius: 999px; padding: 5px 12px;
    font-size: 12.5px; color: #37424f; text-decoration: none; margin: 0 0 6px 6px;
}
.am-sg-chip:hover { background: var(--am-primary, #1e3a5f); color: #fff; }
.am-sg-chips { padding: 10px 14px; display: flex; flex-wrap: wrap; }
.am-sg-all {
    display: block; text-align: center; padding: 11px; font-size: 12.5px; font-weight: 700;
    color: var(--am-primary, #1e3a5f); background: #f7f9fc; text-decoration: none;
    border-top: 1px solid #eef1f5;
}
.am-sg-all:hover { color: var(--am-accent, #f47b20); }
.am-sg-empty { padding: 26px 14px; text-align: center; color: #a8b2be; font-size: 13px; }

/* ── جستجوی موبایل ──────────────────────────────────────────
   کل کامپوننت روی موبایل بازطراحی شد: میدان تمام عرض، بدون دکمه
   «جستجو» (اینتر کافی است)، دکمه لغو کنار میدان وقتی فوکوس دارد،
   و پنل پیشنهاد تمام عرض که تا پایین صفحه باز می شود.
   ------------------------------------------------------------ */
.am-search--m { margin: 0; max-width: none; z-index: 900; display: flex; align-items: center; gap: 8px; }
.am-search--m form {
    flex: 1 1 auto; min-width: 0;
    height: 46px; border-radius: 14px;
    background: #f6f8fb; border-color: #e7ecf3;
    padding: 0 10px 0 6px;
}
.am-search--m form:focus-within { background: #fff; }
.am-search--m input { font-size: 14px; }
.am-search--m .am-search-ico { width: 19px; height: 19px; margin-right: 4px; }
.am-search--m .am-search-clear { width: 24px; height: 24px; font-size: 18px; }

/* دکمه لغو — فقط وقتی کاربر داخل جستجوست */
.am-search-cancel {
    display: none; flex: 0 0 auto;
    background: none; border: none; padding: 4px 2px;
    font-family: inherit; font-size: 13px; font-weight: 700;
    color: var(--am-primary, #1e3a5f); cursor: pointer; white-space: nowrap;
}
.am-search--m.is-open .am-search-cancel { display: block; }

.am-search--m .am-search-panel {
    top: calc(100% + 10px);
    right: -0.75rem; left: -0.75rem;
    border-radius: 16px 16px 0 0;
    max-height: calc(100vh - 190px);
    box-shadow: 0 -2px 0 #eef1f5, 0 20px 50px rgba(16,29,45,.2);
}
.am-search--m .am-sg-item { padding: 11px 14px; }
.am-search--m .am-sg-thumb { width: 46px; height: 46px; }
.am-search--m .am-sg-name { font-size: 13.5px; }

/* وقتی جستجوی موبایل باز است، بقیه صفحه کمی محو شود */
.am-search-dim {
    position: fixed; inset: 0; z-index: 890;
    background: rgba(12,22,36,.32);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.am-search-dim.on { opacity: 1; pointer-events: auto; }

/* ============================================================
   ۱۵) کروسل محصولات مشابه — کارت های هم ارتفاع و مرتب
   ------------------------------------------------------------
   ایراد: کارت ها ارتفاع های متفاوت داشتند و قیمت/دکمه در هر کارت
   در ارتفاع دیگری می نشست. علتش دو چیز بود: کشیده نشدن آیتم های فلکس
   و شکستن قیمت به دو خط («۲۰,۷۰۰,۰۰۰ تومان»).
   ============================================================ */
.related-track { align-items: stretch !important; }

/* همان قاعده ای که ردیف های صفحه اصلی دارند و اینجا جا افتاده بود.
   ⚠ حتماً به .pcard محدود باشد نه به `> *`: کارت محصول یک بلوک <style>
   هم داخل همین ترک چاپ می کند و `display:flex` روی آن، متنِ CSS را
   وسط صفحه نمایش می داد. */
.related-track > .pcard {
    display: flex !important;
    align-self: stretch !important;
    height: 100% !important;
}
/* هر تگ غیرنمایشی که داخل ترک بیفتد پنهان بماند */
.related-track > style,
.related-track > script,
.am-rowsec-track > style,
.am-rowsec-track > script,
.am-deals-track > style,
.am-deals-track > script,
.cat-grid > style,
.cat-grid > script { display: none !important; }
.related-track .pcard {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* نام محصول همیشه دو خط جا بگیرد تا قیمت همه کارت ها هم تراز باشد */
.related-track .pcard__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.45em;
    line-height: 1.5;
}

/* قیمت نباید بشکند — همین باعث بلندتر شدن بعضی کارت ها می شد */
.related-track .pcard__price { margin-top: auto; }
.related-track .pcard__price-main,
.related-track .pcard__price-old,
.related-track .pcard__price-out {
    white-space: nowrap;
    display: block;
}
.related-track .pcard__price-main { font-size: 0.875rem; }

/* ردیف پایین کارت همیشه ته کارت */
.related-track .pcard__footer { margin-top: 0.5rem; }

/* روی صفحه های کوچک قیمت های بلند کمی کوچک تر شوند تا نشکنند */
@media (max-width: 640px) {
    .related-track .pcard__price-main { font-size: 0.8125rem; }
    .related-track .pcard__name { font-size: 0.78rem; min-height: 2.4em; }
}

/* ============================================================
   ۱۶) انتخاب روش پرداخت در تسویه حساب
   ============================================================ */
.paym { margin-top: 18px; border-top: 1px solid #eef1f5; padding-top: 14px; }
.paym-t { font-size: 12.5px; color: #98a1ad; margin-bottom: 9px; }
.paym-o {
    display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
    padding: 10px 12px; border: 1px solid #e3e8ee; border-radius: 12px; margin-bottom: 8px;
    transition: border-color .18s ease, background .18s ease;
}
.paym-o:hover { border-color: #cfd8e3; }
.paym-o input { margin-top: 4px; flex: 0 0 auto; }
/* :has پشتیبانی خوبی دارد ولی نسخه پشتیبان هم با کلاس is-on گذاشته شده */
.paym-o:has(input:checked), .paym-o.is-on { border-color: #f47b20; background: #fff8f3; }
.paym-b { display: block; min-width: 0; }
.paym-b b { display: block; font-size: 13.5px; color: #24303f; }
.paym-b small { display: block; font-size: 11.5px; color: #8b98a8; margin-top: 2px; line-height: 1.8; }
.paym-only {
    margin-top: 16px; background: #fff8f3; border: 1px solid #ffe0c7; border-radius: 12px;
    padding: 11px 13px; font-size: 12.5px; color: #8a4a12; line-height: 1.95;
}

/* ============================================================
   ۱۷) کد تخفیف در تسویه حساب
   ============================================================ */
.ck-coupon { display: flex; gap: 7px; margin: 0 0 8px; }
.ck-coupon input {
    flex: 1 1 auto; min-width: 0; border: 1px solid #e3e8ee; border-radius: 10px;
    padding: 9px 12px; font-family: inherit; font-size: 13px; outline: none;
    transition: border-color .18s ease;
}
.ck-coupon input:focus { border-color: #f47b20; }
.ck-coupon button {
    flex: 0 0 auto; border: 1px solid #dfe4ea; background: #f7f9fc; color: #37424f;
    border-radius: 10px; padding: 0 16px; font-family: inherit; font-size: 12.5px;
    font-weight: 700; cursor: pointer;
}
.ck-coupon button:hover { border-color: #1e3a5f; color: #1e3a5f; }
.ck-coupon button:disabled { opacity: .6; cursor: default; }
.ck-coupon-msg { font-size: 11.5px; min-height: 16px; margin-bottom: 6px; }
.ck-coupon-msg.ok { color: #15803d; }
.ck-coupon-msg.bad { color: #dc2626; }

/* ============================================================
   ۱۸) هشدار تغییر قیمت / موجودی در سبد خرید
   ============================================================ */
.cart-item--warn { border-color: #ffe0c7 !important; background: #fffdf7; }
.cart-warn {
    width: 100%; order: -1;
    background: #fff8f3; border: 1px solid #ffe0c7; border-radius: 10px;
    padding: 8px 12px; margin-bottom: 10px;
    font-size: 12px; line-height: 1.9; color: #8a4a12;
}
.cart-warn b { color: #16293f; }
.cart-warn--bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ============================================================
   ۱۹) کپچا — جعبه یکپارچه به جای برچسب و اینپوت جدا
   ============================================================ */
.cap {
    display: flex; align-items: stretch; gap: 0;
    border: 1px solid #e3e8ee; border-radius: 12px; overflow: hidden;
    background: #fbfcfd; transition: border-color .18s ease, box-shadow .18s ease;
}
.cap:focus-within { border-color: #f47b20; box-shadow: 0 0 0 4px rgba(244,123,32,.10); }

.cap-q {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: #f1f4f8; border-left: 1px solid #e3e8ee;
    flex: 0 0 auto; white-space: nowrap;
}
.cap-q svg { width: 18px; height: 18px; color: #16a34a; flex: 0 0 auto; }
.cap-t { font-size: 12px; color: #6b7a8d; }
.cap-sum {
    font-family: 'Courier New', monospace; font-size: 15px; font-weight: 700;
    color: #16293f; letter-spacing: 1px; direction: ltr;
    background: #fff; border: 1px solid #e3e8ee; border-radius: 7px; padding: 2px 10px;
    /* انتخاب متن سخت تر شود تا کپی کردن ساده نباشد */
    -webkit-user-select: none; user-select: none;
}
.cap-in {
    flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent;
    font-family: inherit; font-size: 14px; color: #24303f; padding: 10px 14px; text-align: center;
}
.cap-in::placeholder { color: #b3bdc9; }

@media (max-width: 480px) {
    .cap { flex-direction: column; }
    .cap-q { border-left: none; border-bottom: 1px solid #e3e8ee; justify-content: center; }
    .cap-in { text-align: center; padding: 12px; }
}

/* گزینه انتخابی محصول در سبد خرید */
.cart-item__variant {
    display: inline-block; margin-top: 4px;
    background: #eef4fb; color: #1e3a5f; border: 1px solid #cfe0f5;
    border-radius: 7px; padding: 2px 9px; font-size: 11.5px;
}
