/* ======================================================================
   صفحه محصول — نسخه جدید
   روی استایل‌های قبلی صفحه سوار می‌شود؛ رنگ‌ها از theme-tokens.css
   ====================================================================== */

.product-page { background: var(--az-bg, #FAF9F6); padding-bottom: 0 !important; }
.product-page > .container.product-main { padding-bottom: 8px; }
#comments-section { background: var(--az-bg, #FAF9F6); padding: 0; margin: 0; min-height: 0; }
.pd-reviews { margin: 0; padding: 8px 0 16px; border: 0; }
.pd-reviews__bar { display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid var(--az-border,#F1EDE5);border-radius:16px;padding:12px 16px; }
.pd-reviews__cta { display:flex;align-items:center;gap:14px;flex-wrap:wrap; }
.pd-reviews__empty { margin:0;font-size:13.5px;color:var(--az-muted,#5A6353); }


/* ---------------- مسیر راهنما ---------------- */
.pd-crumbs { padding: 16px 0 6px; }
.pd-crumbs ol {
    list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--az-muted, #5A6353);
}
.pd-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.pd-crumbs li + li::before { content: '›'; color: var(--az-subtle, #B4AC98); transform: scaleX(-1); display: inline-block; }
.pd-crumbs a { color: var(--az-muted, #5A6353); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.pd-crumbs a:hover { color: var(--az-primary, #3D5826); }
.pd-crumbs [aria-current] { color: var(--az-ink, #171E11); font-weight: 700; }

/* ---------------- چیدمان سه‌بخشی ---------------- */
.product-main { padding-top: 8px; }
.pd-top {
    display: grid; gap: 22px; align-items: start;
    grid-template-columns: minmax(0, 5fr) minmax(0, 5.2fr) minmax(300px, 3.6fr);
    margin-bottom: 28px;
}

/* گالری */
.pd-gallery { position: sticky; top: calc(var(--sh-h, 150px) * .55 + 16px); }
.pd-gallery .glass-card.gallery-card {
    margin: 0 !important; background: #fff !important; border: 1px solid var(--az-border, #F1EDE5) !important;
    border-radius: var(--az-radius-lg, 24px) !important; box-shadow: var(--az-shadow-sm) !important; padding: 16px !important;
}
.pd-gallery .gallery-stage { border-radius: 20px !important; background: var(--az-bg, #FAF9F6) !important; }
.pd-gallery .gallery-counter { background: rgb(23 30 17 / .72) !important; }
.pd-gallery .floating-badge { border-radius: 999px !important; }
.pd-gallery .badge-stock { background: var(--az-success, #12a150) !important; }
.pd-gallery .thumb-btn { border-radius: 14px !important; border-color: var(--az-border, #F1EDE5) !important; }
.pd-gallery .thumb-btn.active { border-color: var(--az-primary, #3D5826) !important; box-shadow: var(--az-ring) !important; }
.pd-gallery .gallery-action-btn {
    border-radius: 12px !important; border: 1px solid var(--az-border, #F1EDE5) !important; background: #fff !important;
    color: var(--az-text, #313B28) !important; font-weight: 700 !important;
}
.pd-gallery .gallery-action-btn:hover { border-color: var(--az-primary-200, #E9E0CA) !important; color: var(--az-primary, #3D5826) !important; }
.pd-gallery .gallery-nav-btn { background: #fff !important; color: var(--az-ink, #171E11) !important; box-shadow: var(--az-shadow-sm) !important; }

/* ---------------- ستون اطلاعات ---------------- */
.pd-info { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }

.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 800; text-decoration: none;
    background: #fff; color: var(--az-text, #313B28); border: 1px solid var(--az-border, #F1EDE5);
}
.pd-chip:hover { border-color: var(--az-primary-200, #E9E0CA); color: var(--az-primary, #3D5826); }
.pd-chip--brand { background: var(--az-primary-50, #F6F3EA); border-color: var(--az-primary-100, #E9E0CA); color: var(--az-primary, #3D5826); }
.pd-chip--hot { background: var(--az-accent-soft, #F7E7D6); border-color: transparent; color: var(--az-accent, #B46D22); }
.pd-chip--new { background: var(--az-success-soft, #e7f8ee); border-color: transparent; color: var(--az-success, #12a150); }

.pd-title {
    margin: 0; font-size: clamp(19px, 2vw, 25px); font-weight: 900; line-height: 1.85;
    color: var(--az-ink, #171E11) !important; letter-spacing: -.1px;
}

.pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--az-muted, #5A6353); }
.pd-meta__item { display: inline-flex; align-items: center; gap: 5px; }
.pd-meta__item b { color: var(--az-text, #313B28); }
.pd-meta__item.is-in { color: var(--az-success, #12a150); font-weight: 800; }
.pd-meta__item.is-out { color: var(--az-danger, #B87B39); font-weight: 800; }

.pd-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--az-muted, #5A6353); text-decoration: none; }
.pd-rating:hover { color: var(--az-primary, #3D5826); }
.pd-rating b { color: var(--az-ink, #171E11); }
/* ستاره‌ها با یک گرادیان — مقدار از --pd-rate (۰ تا ۵) */
.pd-stars {
    --pd-pct: calc(var(--pd-rate, 0) / 5 * 100%);
    display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 2px; direction: ltr;
    background: linear-gradient(90deg, #f59e0b var(--pd-pct), #E5E1D8 var(--pd-pct));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pd-stars::before { content: '★★★★★'; }

.pd-h { margin: 0 0 12px; font-size: 15px; font-weight: 900; color: var(--az-ink, #171E11) !important; }

.pd-specs, .pd-summary {
    background: #fff; border: 1px solid var(--az-border, #F1EDE5); border-radius: var(--az-radius, 18px); padding: 18px 20px;
}
.pd-specs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pd-specs li {
    display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px;
    background: var(--az-bg, #FAF9F6);
}
.pd-specs li span { font-size: 11.5px; color: var(--az-muted, #5A6353); }
.pd-specs li b { font-size: 13px; color: var(--az-ink, #171E11); line-height: 1.8; }
.pd-summary p { margin: 0; font-size: 13.5px; line-height: 2.2; color: var(--az-text, #313B28); }
.pd-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 800; color: var(--az-primary, #3D5826); text-decoration: none; }
.pd-link i { font-size: 11px; transition: transform .2s; }
.pd-link:hover i { transform: translateX(-3px); }

.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-action {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 12px;
    background: #fff; border: 1px solid var(--az-border, #F1EDE5); color: var(--az-text, #313B28);
    font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: .2s;
}
.pd-action:hover { border-color: var(--az-primary-200, #E9E0CA); color: var(--az-primary, #3D5826); }

/* ---------------- جعبه خرید ---------------- */
.pd-buy { position: sticky; top: calc(var(--sh-h, 150px) * .55 + 16px); }
.pd-buy__card {
    background: #fff; border: 1px solid var(--az-border, #F1EDE5); border-radius: var(--az-radius-lg, 24px);
    padding: 20px; box-shadow: var(--az-shadow); display: flex; flex-direction: column; gap: 14px;
    transition: box-shadow .3s;
}
.pd-buy.pd-flash .pd-buy__card { box-shadow: 0 0 0 4px rgb(var(--az-primary-rgb, 6 44 120) / .35), var(--az-shadow); }

.pd-price { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px dashed var(--az-border, #F1EDE5); }
.pd-price__label { font-size: 12px; color: var(--az-muted, #5A6353); font-weight: 700; }
.pd-price__old { display: flex; align-items: center; gap: 8px; }
.pd-price__old del { font-size: 13.5px; color: var(--az-subtle, #B4AC98); }
.pd-price__off {
    font-size: 12px; font-weight: 900; color: #fff; direction: ltr;
    background: var(--az-grad-accent, linear-gradient(135deg, #B46D22, #D98C39)); border-radius: 999px; padding: 2px 9px;
}
.pd-price__now { font-size: 28px; font-weight: 900; color: var(--az-ink, #171E11); line-height: 1.4; font-variant-numeric: tabular-nums; }
.pd-price__now small { font-size: 13px; font-weight: 700; color: var(--az-muted, #5A6353); }

.pd-note { font-size: 12.5px; color: var(--az-muted, #5A6353); text-align: center; }

.pd-perks { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--az-line, #F7F5EF); display: flex; flex-direction: column; gap: 12px; }
.pd-perks li { display: flex; align-items: flex-start; gap: 11px; }
.pd-perks i {
    flex: none; width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    background: var(--az-primary-50, #F6F3EA); color: var(--az-primary, #3D5826); font-size: 16px;
}
.pd-perks span { display: flex; flex-direction: column; gap: 1px; }
.pd-perks b { font-size: 13px; color: var(--az-ink, #171E11); }
.pd-perks em { font-style: normal; font-size: 11.5px; color: var(--az-muted, #5A6353); line-height: 1.9; }

/* ---------------- اجزای کامپوننت Livewire خرید (ap-*) ---------------- */
.ap { display: flex; flex-direction: column; gap: 12px; }
.ap-label { font-size: 12px; color: var(--az-muted, #5A6353); font-weight: 700; }

.ap-price { display: flex; flex-direction: column; gap: 4px; }
.ap-price .product-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.ap-price .product-price .text-accent, .ap-price .off_text {
    font-size: 24px !important; font-weight: 900 !important; color: var(--az-ink, #171E11) !important; margin: 0 !important;
}
.ap-price del { font-size: 13px; color: var(--az-subtle, #B4AC98) !important; }
.ap-price .darsad {
    font-size: 12px !important; font-weight: 900; color: #fff !important; direction: ltr;
    background: var(--az-grad-accent, linear-gradient(135deg, #B46D22, #D98C39)); border-radius: 999px; padding: 2px 9px;
}

.ap-note {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px;
    font-size: 13px; line-height: 2; font-weight: 700;
}
.ap-note i { font-size: 18px; margin-top: 3px; }
.ap-note--call { background: var(--az-warning-soft, #fff7e6); color: #92400e; }

.ap-stock-warn {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
    font-size: 12.5px; font-weight: 800; color: var(--az-danger, #B87B39);
    background: var(--az-danger-soft, #F8EBDC); border-radius: 999px; padding: 5px 12px;
}
.ap-stock-warn__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: hm-live 1.6s infinite; }

.ap-variant-info {
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px;
    background: var(--az-bg, #FAF9F6); font-size: 13.5px; font-weight: 700; color: var(--az-ink, #171E11);
}

.ap-acc { border: 1px solid var(--az-border, #F1EDE5); border-radius: 16px; padding: 14px; }
.ap-acc__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 900; color: var(--az-ink, #171E11); }
.ap-acc__head i { color: var(--az-primary, #3D5826); font-size: 18px; }
.ap-acc__head em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--az-muted, #5A6353); }
.ap-acc__list { display: flex; flex-direction: column; gap: 8px; }
.ap-acc__item { padding: 11px 12px; border-radius: 13px; border: 1px solid var(--az-border, #F1EDE5); background: #fff; transition: border-color .2s, background .2s; }
.ap-acc__item.is-selected { border-color: var(--az-primary, #3D5826); background: var(--az-primary-50, #F6F3EA); }
.ap-acc__label { display: flex; gap: 11px; align-items: flex-start; margin: 0; cursor: pointer; }
.ap-acc__check { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 18px; accent-color: var(--az-primary, #3D5826); }
.ap-acc__img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; flex: 0 0 46px; }
.ap-acc__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-acc__row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ap-acc__name { font-weight: 800; color: var(--az-ink, #171E11); font-size: 13.5px; }
.ap-acc__req { font-size: 10.5px; color: #92400e; background: var(--az-warning-soft, #fff7e6); border-radius: 999px; padding: 1px 8px; margin-inline-start: 4px; }
.ap-acc__price { font-weight: 900; color: var(--az-primary, #3D5826); font-size: 13px; white-space: nowrap; }
.ap-acc__desc { color: var(--az-muted, #5A6353); font-size: 12px; line-height: 1.9; white-space: pre-line; }
.ap-acc__low { color: var(--az-danger, #B87B39); font-size: 11.5px; font-weight: 700; }
.ap-acc__qty { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-inline-start: 29px; font-size: 12.5px; }
.ap-acc__qty input { width: 76px; height: 34px; border: 1px solid var(--az-border, #F1EDE5); border-radius: 10px; text-align: center; font-weight: 800; }
.ap-acc__qty em { font-style: normal; color: var(--az-muted, #5A6353); font-size: 11.5px; }
.ap-acc__total {
    margin-top: 10px; padding: 11px 13px; border-radius: 13px; background: var(--az-primary-50, #F6F3EA);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 13px;
}
.ap-acc__total b { color: var(--az-primary, #3D5826); font-weight: 900; }
.ap-acc__breakdown { width: 100%; display: flex; flex-direction: column; color: var(--az-muted, #5A6353); font-size: 12px; line-height: 2; }

.ap-incart {
    display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 13px;
    background: var(--az-success-soft, #e7f8ee); color: #0e6b37; font-size: 13px; line-height: 1.9;
}
.ap-incart i { font-size: 18px; }
.ap-incart a { color: #0e6b37; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }

.ap-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px;
    padding: 0 18px; border: 0; border-radius: 16px; cursor: pointer; text-decoration: none;
    font-family: inherit; font-size: 15px; font-weight: 900; transition: transform .2s, box-shadow .2s, filter .2s;
}
.ap-btn i { font-size: 18px; }
.ap-btn--primary {
    background: var(--az-grad, linear-gradient(135deg, #17220E, #3D5826 55%, #436226)); color: #fff;
    box-shadow: 0 18px 32px -18px rgb(var(--az-primary-rgb, 6 44 120) / .95);
}
.ap-btn--primary:hover { transform: translateY(-2px); color: #fff; filter: brightness(1.06); }
.ap-btn--primary[disabled] { opacity: .75; cursor: wait; transform: none; }
.ap-btn--call { background: var(--az-grad-accent, linear-gradient(135deg, #B46D22, #D98C39)); color: #fff; box-shadow: 0 16px 30px -18px rgb(var(--az-accent-rgb, 225 6 0) / .9); }
.ap-btn--call:hover { color: #fff; transform: translateY(-2px); }
.ap-btn--ghost { min-height: 46px; background: var(--az-bg, #FAF9F6); color: var(--az-ink, #171E11); font-size: 14px; }
.ap-btn--ghost:hover { background: var(--az-soft, #F9F6F0); color: var(--az-primary, #3D5826); }
.ap-btn--disabled { background: #F5F3EF; color: var(--az-subtle, #B4AC98); cursor: not-allowed; }
.ap-spin {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
    border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: ap-rot .7s linear infinite;
}
@keyframes ap-rot { to { transform: rotate(360deg); } }
.ap-success { padding: 11px; border-radius: 12px; text-align: center; font-size: 13.5px; font-weight: 700; background: var(--az-success-soft, #e7f8ee); color: #0e6b37; }

/* ---------------- بخش‌های پایین صفحه (هماهنگ با تم) ---------------- */
.content-stack .soft-card, .content-stack .section-card, .tabs-card, .podcast-card {
    background: #fff !important; border: 1px solid var(--az-border, #F1EDE5) !important;
    border-radius: var(--az-radius-lg, 24px) !important; box-shadow: var(--az-shadow-sm) !important;
}
.tabs-card .nav-tabs { border-bottom: 1px solid var(--az-line, #F7F5EF) !important; gap: 4px; }
.tabs-card .nav-tabs .nav-link {
    border: 0 !important; border-radius: 12px 12px 0 0 !important; color: var(--az-muted, #5A6353) !important;
    font-weight: 800 !important; position: relative;
}
.tabs-card .nav-tabs .nav-link.active { color: var(--az-primary, #3D5826) !important; background: transparent !important; }
.tabs-card .nav-tabs .nav-link.active::after {
    content: ''; position: absolute; inset-inline: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--az-primary, #3D5826);
}
.spec-table-modern { border-radius: 16px !important; overflow: hidden; border: 1px solid var(--az-border, #F1EDE5) !important; }
.spec-row-modern:nth-child(odd) { background: var(--az-bg, #FAF9F6) !important; }
.spec-row-modern .key { color: var(--az-muted, #5A6353) !important; }
.spec-row-modern .val { color: var(--az-ink, #171E11) !important; font-weight: 700; }
.section-title, .tabs-topline h3 { color: var(--az-ink, #171E11) !important; }

/* قالب قبلی سربرگ آبی و نوار چسبان قدیمی داشت؛ دیگر استفاده نمی‌شوند */
.hero-pro, .mobile-sticky-bar { display: none !important; }

/* ---------------- محصولات مرتبط و بازدیدهای اخیر ---------------- */
.pd-related { margin-top: 30px; }
.pd-related__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-related__head h2 { margin: 8px 0 0; font-size: clamp(18px, 2vw, 23px); font-weight: 900; color: var(--az-ink, #171E11) !important; }
.pd-related .pg-posts,
.pd-related .pg-posts--3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}
.pd-related .pg-post {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--az-border, #F1EDE5);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 28px -22px rgba(28, 35, 22, .35);
}
.pd-related .pg-post__media { display: block; aspect-ratio: 16 / 10; background: #F6F4EF; overflow: hidden; }
.pd-related .pg-post__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-related .pg-post__body { padding: 14px 16px 16px; }
.pd-related .pg-post__body h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.8; }
.pd-related .pg-post__body h3 a { color: var(--az-ink, #171E11); text-decoration: none; }
@media (max-width: 991.98px) {
    .pd-related .pg-posts,
    .pd-related .pg-posts--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .pd-related .pg-posts,
    .pd-related .pg-posts--3 { grid-template-columns: 1fr; }
}

#comment-modal .modal-content {
    font-family: "Yekan-Bakh", Tahoma, sans-serif;
    border-radius: 20px;
    border: 0;
    overflow: hidden;
}
#comment-modal .modal-header {
    background: #436226;
    color: #fff;
    border: 0;
}
#comment-modal .modal-header .nav-link { color: #fff; font-weight: 800; }
#comment-modal .btn-close { filter: invert(1); }
#comment-modal .form-control,
#comment-modal .form-select,
#comment-modal .btn {
    font-family: "Yekan-Bakh", Tahoma, sans-serif;
    border-radius: 12px;
}
#comment-modal .btn-primary { background: #436226; border-color: #436226; font-weight: 800; }
.pd-related .hm-slider__slide { flex-basis: calc((100% - 72px) / 5); }
@media (max-width: 1399.98px) { .pd-related .hm-slider__slide { flex-basis: calc((100% - 54px) / 4); } }
@media (max-width: 1199.98px) { .pd-related .hm-slider__slide { flex-basis: calc((100% - 36px) / 3); } }
@media (max-width: 991.98px)  { .pd-related .hm-slider__slide { flex-basis: calc((100% - 18px) / 2); } }
@media (max-width: 575.98px)  { .pd-related .hm-slider__slide { flex-basis: 72%; } }

.pd-recent__list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.pd-recent__item {
    flex: 0 0 260px; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px;
    background: #fff; border: 1px solid var(--az-border, #F1EDE5); text-decoration: none; color: inherit; transition: .2s;
}
.pd-recent__item:hover { border-color: var(--az-primary-200, #E9E0CA); box-shadow: var(--az-shadow-sm); color: inherit; }
.pd-recent__img { flex: none; width: 64px; height: 64px; border-radius: 13px; background: var(--az-bg, #FAF9F6); overflow: hidden; }
.pd-recent__img img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.pd-recent__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pd-recent__text b {
    font-size: 12.5px; font-weight: 800; color: var(--az-ink, #171E11); line-height: 1.9;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pd-recent__text em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--az-primary, #3D5826); }

/* ---------------- نوار خرید چسبان ---------------- */
.pd-sticky {
    position: fixed; inset-inline: 0; top: 0; bottom: auto; z-index: 1020;
    height: 68px; max-height: 68px; overflow: hidden;
    background: rgb(255 255 255 / .96); backdrop-filter: blur(12px) saturate(1.3);
    border-bottom: 1px solid var(--az-border, #F1EDE5); box-shadow: 0 14px 30px -24px rgb(23 30 17 / .45);
    transform: translateY(-110%); transition: transform .3s cubic-bezier(.4,0,.2,1); visibility: hidden;
}
.pd-sticky.is-visible { transform: none; visibility: visible; }
/* اصلاح ۵.۶ — این قانون قبلاً روی موبایل هم اجرا می‌شد و چون آنجا نوار خرید
   با bottom چیده شده، top:0 + bottom با هم نوار را از بالا تا پایین صفحه کِش
   می‌آوردند؛ یک پردهٔ سفید تمام‌صفحه که موقع اسکرول ظاهر می‌شد. */
@media (min-width: 992px) {
    .pd-sticky { display: none !important; visibility: hidden !important; height: 0 !important; max-height: 0 !important; overflow: hidden; }
}
.pd-sticky__inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.pd-sticky__product { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.pd-sticky__product img { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; background: var(--az-bg, #FAF9F6); padding: 3px; }
.pd-sticky__title { font-size: 13.5px; font-weight: 800; color: var(--az-ink, #171E11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-sticky__price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.5; }
.pd-sticky__price del { font-size: 11.5px; color: var(--az-subtle, #B4AC98); }
.pd-sticky__price b { font-size: 17px; font-weight: 900; color: var(--az-ink, #171E11); white-space: nowrap; }
.pd-sticky__price small { font-size: 11px; color: var(--az-muted, #5A6353); }
.pd-sticky__action .ap-btn { min-height: 44px; width: auto; padding: 0 20px; font-size: 14px; }
.pd-sticky .ap-btn.is-busy { opacity: .7; pointer-events: none; }

/* پیام کوتاه */
.pd-toast {
    position: fixed; left: 50%; bottom: 96px; z-index: 2000; transform: translate(-50%, 20px); opacity: 0;
    background: var(--az-ink, #171E11); color: #fff; padding: 11px 18px; border-radius: 14px;
    font-size: 13.5px; font-weight: 700; box-shadow: 0 20px 40px -20px rgb(0 0 0 / .6);
    transition: opacity .25s, transform .25s; pointer-events: none;
}
.pd-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- واکنش‌گرا ---------------- */
@media (max-width: 1199.98px) {
    .pd-top { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
    .pd-gallery { grid-column: 1; grid-row: 1; position: static; }
    .pd-info { grid-column: 1; grid-row: 2; }
    .pd-buy { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 991.98px) {
    .pd-top { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .pd-gallery, .pd-info, .pd-buy { grid-column: 1; grid-row: auto; position: static; }
    .pd-buy { order: 2; }
    .pd-info { order: 3; }
    .pd-gallery { order: 1; }

    /* موبایل: نوار خرید پایین صفحه، بالای نوار پیمایش موبایل */
    .pd-sticky {
        top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); inset-inline: 10px;
        border: 1px solid var(--az-border, #F1EDE5); border-radius: 18px;
        transform: translateY(160%);
    }
    .pd-sticky__inner { min-height: 60px; padding: 0 10px; gap: 10px; }
    .pd-sticky__product { display: none; }
    .pd-sticky__price { align-items: flex-start; flex: 1; }
    .pd-sticky__action .ap-btn { padding: 0 16px; }
}

@media (max-width: 575.98px) {
    .pd-specs ul { grid-template-columns: minmax(0, 1fr); }
    .pd-price__now { font-size: 24px; }
    .pd-recent__item { flex-basis: 230px; }
}

/* ستون محتوای پایین صفحه نباید با عرض اسلایدر محصولات مرتبط کش بیاید */
.content-stack { grid-template-columns: minmax(0, 1fr) !important; }
.content-stack > *, .pd-top > * { min-width: 0; }

/* تایپوگرافی توضیحات محصول (HTML واردشده از پنل مدیریت) */
.tabs-card .tab-content { font-size: 14.5px; line-height: 2.3; color: var(--az-text, #313B28); }
.tabs-card .tab-content h1 { font-size: clamp(19px, 2.2vw, 24px) !important; line-height: 1.8 !important; font-weight: 900 !important; color: var(--az-ink, #171E11) !important; margin: 0 0 14px !important; }
.tabs-card .tab-content h2 { font-size: clamp(17px, 1.9vw, 21px) !important; line-height: 1.8 !important; font-weight: 900 !important; color: var(--az-ink, #171E11) !important; margin: 26px 0 10px !important; }
.tabs-card .tab-content h3, .tabs-card .tab-content h4 { font-size: 16px !important; line-height: 1.9 !important; font-weight: 800 !important; color: var(--az-ink, #171E11) !important; margin: 20px 0 8px !important; }
.tabs-card .tab-content img { max-width: 100%; height: auto; border-radius: 16px; }
.tabs-card .tab-content table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--az-border, #F1EDE5); border-radius: 14px; overflow: hidden; }
.tabs-card .tab-content table td, .tabs-card .tab-content table th { padding: 10px 14px; border-bottom: 1px solid var(--az-line, #F7F5EF); }
.tabs-card .tab-content table tr:nth-child(odd) td { background: var(--az-bg, #FAF9F6); }
.tabs-card .tab-content ul li::marker { color: var(--az-primary, #3D5826); }

/* محصول دیجیتال */
.pd-digital { border: 1px dashed var(--az-primary-200, #E9E0CA); background: var(--az-primary-50, #F6F3EA); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.pd-digital__head { display: flex; align-items: center; gap: 10px; }
.pd-digital__head > i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--az-primary, #3D5826); font-size: 19px; }
.pd-digital__head b { display: block; color: var(--az-ink, #202A17); }
.pd-digital__head em { font-style: normal; font-size: 12.5px; color: var(--az-muted, #646C5D); }
.pd-digital__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.pd-digital__meta div { background: #fff; border-radius: 10px; padding: 7px 10px; }
.pd-digital__meta dt { font-size: 11px; color: var(--az-muted, #646C5D); font-weight: 600; }
.pd-digital__meta dd { margin: 0; font-size: 13px; font-weight: 800; color: var(--az-ink, #202A17); }
.pd-digital__count { display: block; margin-top: 10px; font-size: 12px; color: var(--az-muted, #646C5D); }

/* ======================================================================
   نسخه ۵.۴ — تقارن و نظم صفحه محصول
   ستون‌های بالای صفحه هم‌قد می‌شوند، گالری جمع‌وجور، و کارت‌های
   بخش «اطلاعات تکمیلی» هم‌اندازه می‌شوند.
   ====================================================================== */

/* --- گالری: قاب مربع، بدون فضای خالی اضافه --- */
.pd-gallery .gallery-shell { padding: 0 !important; gap: 12px !important; }
.pd-gallery .gallery-stage {
    min-height: 0 !important; aspect-ratio: 1 / 1; padding: 16px !important;
    background: var(--az-bg, #FAF9F6) !important; border-color: var(--az-border, #F1EDE5) !important;
    box-shadow: none !important;
}
.pd-gallery .gallery-stage::after { display: none !important; }
.pd-gallery .gallery-main-link {
    min-height: 0 !important; height: 100% !important; background: transparent !important; border-radius: 16px !important;
}
.pd-gallery .gallery-main-link::after { display: none !important; }
.pd-gallery .gallery-stage img { max-height: 100% !important; height: 100% !important; }
.pd-gallery .gallery-actions { margin-top: 0 !important; gap: 8px !important; }
.pd-gallery .gallery-action-btn {
    flex: 1 1 0; justify-content: center; height: 40px; padding: 0 12px !important; font-size: 12.5px !important;
}
.pd-gallery .gallery-thumbs-wrap { margin-top: 0 !important; }
.pd-gallery .gallery-thumbs-wrap[hidden] { display: none !important; }
.pd-gallery .thumbs-row { gap: 8px !important; }
.pd-gallery .thumb-btn {
    flex: 0 0 66px !important; width: 66px !important; height: 66px !important;
    border-radius: 14px !important; padding: 4px !important;
}

/* --- ستون میانی: فاصله‌های یکدست --- */
.pd-info { gap: 16px; }
.pd-info > .pd-specs, .pd-info > .pd-summary { margin: 0; }
.pd-specs ul { gap: 10px; }
.pd-specs li { min-height: 58px; justify-content: center; }

/* --- سه ستون بالا: ارتفاع‌ها نزدیک به هم --- */
.pd-top { align-items: start; gap: 20px; }
.pd-top > * { align-self: start; }

/* --- «اطلاعات تکمیلی»: دو کارت هم‌قد و هم‌عرض --- */
.product-info-redesign { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; align-items: stretch !important; }
.product-info-redesign > .info-panel {
    display: flex; flex-direction: column; height: 100%;
    border: 1px solid var(--az-border, #F1EDE5); border-radius: var(--az-radius, 18px); background: #fff;
}
.product-info-redesign .feature-highlight-grid { align-content: start; }
.feature-highlight { min-height: 96px !important; display: flex; align-items: center; }
.feature-highlight .top { width: 100%; }

@media (max-width: 991.98px) {
    .product-info-redesign { grid-template-columns: minmax(0, 1fr) !important; }
}

/* --- توضیحات محصول: ستون کناری همراه متن حرکت می‌کند تا فضای خالی نماند --- */
.desc-grid { gap: 20px; }
.desc-side { position: sticky; top: calc(var(--sh-h, 150px) * .55 + 16px); align-self: start; }

/* --- محصولات مشابه: کارت‌ها هم‌قد --- */
.pd-related .hm-slider__viewport { align-items: stretch; }
.pd-related .hm-slider__slide { display: flex; }
.pd-related .hm-slider__slide > * { width: 100%; height: 100%; }

@media (max-width: 991.98px) {
    .desc-side { position: static; }
}

/* محافظ: نوار خرید چسبان هرگز نباید بلندتر از یک نوار شود */
.pd-sticky { max-height: 96px; }
@media (max-width: 991.98px) { .pd-sticky { top: auto !important; max-height: 84px; } }

/* ======================================================================
   نسخه ۵.۶ — بخش توضیحات محصول: تایپوگرافی خوانا + فهرست مطالب
   ====================================================================== */
.desc-grid { grid-template-columns: minmax(0, 1fr) 290px; }
.desc-box { padding: 26px 28px; border-radius: 22px; background: #fff; border-color: var(--az-border, #F1EDE5); }

/* طول خط خواندنی: متن فارسی در عرض ۱۲۰۰ پیکسل خسته‌کننده می‌شود */
.desc-content { max-width: 78ch; margin-inline: auto; }
.desc-content > *:first-child { margin-top: 0; }
.desc-content p,
.desc-content li { font-size: 14.5px; line-height: 2.35; color: var(--az-text, #313B28); }
.desc-content p { margin: 0 0 16px; }

.desc-content h2, .desc-content h3, .desc-content h4 {
    color: var(--az-ink, #171E11) !important; font-weight: 900; line-height: 1.8; scroll-margin-top: 110px;
}
.desc-content h2 {
    font-size: 19px; margin: 34px 0 14px; padding-inline-start: 13px; position: relative;
}
.desc-content h2::before {
    content: ''; position: absolute; inset-inline-start: 0; top: .35em; bottom: .35em; width: 4px;
    border-radius: 999px; background: var(--az-grad, linear-gradient(180deg, #3D5826, #436226));
}
.desc-content h3 { font-size: 16px; margin: 26px 0 10px; }
.desc-content h4 { font-size: 14.5px; margin: 20px 0 8px; color: var(--az-muted, #5A6353) !important; }

.desc-content ul, .desc-content ol { margin: 0 0 18px; padding-inline-start: 20px; }
.desc-content li { margin-bottom: 7px; }
.desc-content ul { list-style: none; padding-inline-start: 4px; }
.desc-content ul > li { position: relative; padding-inline-start: 20px; }
.desc-content ul > li::before {
    content: ''; position: absolute; inset-inline-start: 0; top: .85em; width: 7px; height: 7px;
    border-radius: 50%; background: var(--az-primary, #3D5826); opacity: .55;
}
.desc-content img { max-width: 100%; height: auto; border-radius: 16px; margin: 18px 0; }
.desc-content table {
    width: 100%; border-collapse: separate; border-spacing: 0; margin: 20px 0;
    border: 1px solid var(--az-border, #F1EDE5); border-radius: 16px; overflow: hidden; font-size: 13.5px;
}
.desc-content th, .desc-content td { padding: 11px 14px; text-align: start; }
.desc-content th { background: var(--az-bg, #FAF9F6); font-weight: 900; color: var(--az-ink, #171E11); }
.desc-content tr:nth-child(even) td { background: #FDFDFB; }
.desc-content a { color: var(--az-primary, #3D5826); font-weight: 700; text-underline-offset: 4px; }
.desc-content blockquote {
    margin: 20px 0; padding: 14px 18px; border-radius: 14px;
    background: var(--az-primary-50, #F6F3EA); border-inline-start: 4px solid var(--az-primary, #3D5826);
}

/* فهرست مطالب */
.desc-toc {
    background: #fff; border: 1px solid var(--az-border, #F1EDE5); border-radius: 18px; padding: 16px 16px 12px;
    margin-bottom: 12px;
}
.desc-toc[hidden] { display: none; }
.desc-toc > b {
    display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 900;
    color: var(--az-ink, #171E11); margin-bottom: 10px;
}
.desc-toc > b i { color: var(--az-primary, #3D5826); }
.desc-toc ol { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; scrollbar-width: thin; }
.desc-toc li { position: relative; }
.desc-toc li a {
    display: block; padding: 6px 12px 6px 8px; border-radius: 9px; font-size: 12.5px; line-height: 1.9;
    color: var(--az-muted, #5A6353); text-decoration: none; transition: .18s;
    border-inline-start: 2px solid transparent;
}
.desc-toc li.is-sub a { padding-inline-start: 20px; font-size: 12px; }
.desc-toc li a:hover { background: var(--az-bg, #FAF9F6); color: var(--az-ink, #171E11); }
.desc-toc li.is-on a {
    background: var(--az-primary-50, #F6F3EA); color: var(--az-primary, #3D5826);
    font-weight: 800; border-inline-start-color: var(--az-primary, #3D5826);
}

/* سربرگ تب‌ها، مرتب‌تر */
.tabs-head-modern { padding: 20px 24px 0; }
.tabs-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tabs-topline h3 { font-size: clamp(17px, 1.8vw, 21px); font-weight: 900; margin: 0 0 4px; }
.tabs-topline p { font-size: 13px; color: var(--az-muted, #5A6353); margin: 0; }
.tabs-card .nav-tabs { margin-top: 16px; }
.tabs-card .nav-tabs .nav-link { padding: 11px 18px !important; font-size: 13.5px !important; }
.tabs-body { padding: 22px 24px 26px; }

@media (max-width: 991.98px) {
    .desc-grid { grid-template-columns: minmax(0, 1fr); }
    .desc-toc { order: -1; }
    .desc-box { padding: 18px 16px; }
    .desc-content { max-width: none; }
    .tabs-head-modern { padding: 16px 14px 0; }
    .tabs-body { padding: 16px 14px 20px; }
}

/* ======================================================================
   نسخه ۵.۷ — انتخاب تنوع محصول در صفحه فروشگاه
   ====================================================================== */
.ap-vgroup { display: flex; flex-direction: column; gap: 8px; }
.ap-vgroup + .ap-vgroup { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--az-line, #F7F5EF); }
.ap-vgroup__head { display: flex; align-items: baseline; gap: 8px; }
.ap-vgroup__name { font-size: 12.5px; font-weight: 900; color: var(--az-ink, #171E11); }
.ap-vgroup__picked { font-size: 12px; color: var(--az-muted, #5A6353); }

.ap-vgroup__opts { display: flex; flex-wrap: wrap; gap: 8px; }

.ap-vopt {
    position: relative; margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 12px; min-height: 40px;
    border: 1.5px solid var(--az-border, #F1EDE5); background: #fff;
    font-size: 13px; font-weight: 700; color: var(--az-text, #313B28);
    transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.ap-vopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.ap-vopt:hover { border-color: var(--az-primary-200, #E9E0CA); }
.ap-vopt.is-on {
    border-color: var(--az-primary, #3D5826); background: var(--az-primary-50, #F6F3EA);
    color: var(--az-primary, #3D5826); box-shadow: 0 0 0 3px rgb(61 88 38 / .10);
}
.ap-vopt.is-out {
    opacity: .5; cursor: not-allowed; text-decoration: line-through;
    background: repeating-linear-gradient(135deg, #fff, #fff 6px, #FBFAF7 6px, #FBFAF7 12px);
}
.ap-vopt__img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }

/* حالت رنگ: دایره‌های رنگی */
.ap-vgroup__opts.is-colors .ap-vopt { padding: 4px; min-height: 0; border-radius: 50%; }
.ap-vopt__dot {
    width: 30px; height: 30px; border-radius: 50%; display: block;
    box-shadow: inset 0 0 0 1px rgb(23 30 17 / .12);
}
.ap-vgroup__opts.is-colors .ap-vopt.is-on { box-shadow: 0 0 0 3px rgb(61 88 38 / .18); }
.ap-vopt__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* استایل قدیمی فرم‌آپشن دیگر استفاده نمی‌شود */
.ap-variants .form-option { display: none; }

/* قیمت کالای ناموجود: نشان داده می‌شود ولی کم‌رنگ، تا مشتری بداند
   محصول چقدر بوده و صفحه بدون قیمت نماند. */
.pd-price.is-out { opacity: .62; }
.pd-price.is-out .pd-price__now { color: var(--az-muted, #5A6353); }

/* نشان «خریدار تأییدشده» زیر نام نویسندهٔ دیدگاه */
.rv-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
.rv-verified i { font-size: 12px; }

/* لایتنباکس گالری باید پیش‌فرض مخفی باشد؛ وگرنه تصویر ۱۰۰۰×۱۰۰۰ شفاف
   یک صفحهٔ خالی با عنوان محصول و دکمه ضربدر می‌سازد. */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(33, 47, 21, .84);
    backdrop-filter: blur(10px);
}
.gallery-modal.show { display: flex; }
.gallery-modal-dialog {
    width: min(1100px, 100%);
    max-height: 92vh;
    border-radius: 24px;
    overflow: hidden;
    background: #233117;
    border: 1px solid rgba(255,255,255,.12);
}
.gallery-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: #fff;
    font-weight: 800;
}
.gallery-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
}
.gallery-modal-body {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.gallery-modal-image {
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
}
.gallery-modal-nav {
    position: absolute;
    inset: 50% 18px auto;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.gallery-modal-nav button {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
}
.gallery-modal-caption {
    padding: 14px 18px 18px;
    color: #EAE9E6;
    text-align: center;
}
body.gallery-modal-open { overflow: hidden; }
