/* فروشگاه v1.1.6 — دید سریع، مقایسه، لایت‌باکس، تفکیک قیمت، نوار چسبان، اسکلت بارگذاری. متغیرها از theme-palette (روشن/تیره). */
:root { --nhx-tabbar: 84px; }

/* ---- کارت: ابزار، نشان‌ها ---- */
.product-card { position: relative; }
.product-card .pc-tools {
  position: absolute; top: 3.35rem; left: .7rem; z-index: 9; display: flex; flex-direction: column; gap: .4rem;
  opacity: 1; transition: opacity .18s;
}
.pc-tools button {
  width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--border); cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--card) 90%, transparent); color: var(--muted); font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(15, 20, 40, .1); transition: transform .15s, color .15s, background .15s;
}
.pc-tools button:hover, .pc-tools button:focus-visible { color: var(--brand); transform: translateY(-1px); }
.pc-tools .pc-cmp.is-active { background: var(--brand); color: #fff; border-color: transparent; }
html[theme-color="dark"] .pc-tools .pc-cmp.is-active { color: #05211f; }
@media (hover: hover) and (min-width: 992px) {
  .product-card .pc-tools { opacity: 0; }
  .product-card:hover .pc-tools, .product-card:focus-within .pc-tools { opacity: 1; }
}
.product-card .pc-new, .product-card .pc-stock {
  position: absolute; z-index: 6; font-size: .68rem; font-weight: 800; padding: .18rem .55rem; border-radius: 999px; line-height: 1.5;
  pointer-events: none; max-width: calc(100% - 1rem); white-space: nowrap;
}
.product-card .pc-new { top: 2.55rem; right: .85rem; background: #0ea5e9; color: #fff; }
/* روی تصویر بماند، نه روی اسم محصول */
.product-card .product-thumb-frame { position: relative; }
.product-card .pc-stock { top: auto; bottom: .55rem; right: .55rem; left: auto; }
.pc-stock.is-low { background: rgba(255, 248, 235, .94); color: #b45309; border: 1px solid rgba(245, 158, 11, .4); box-shadow: 0 2px 8px rgba(15,20,40,.08); }
.pc-stock.is-out { background: rgba(255, 241, 242, .94); color: #b91c1c; border: 1px solid rgba(239, 68, 68, .4); box-shadow: 0 2px 8px rgba(15,20,40,.08); }
html[theme-color="dark"] .pc-stock.is-low { color: #fcd34d; background: rgba(30, 22, 8, .88); }
html[theme-color="dark"] .pc-stock.is-out { color: #fca5a5; background: rgba(40, 12, 12, .88); }
.product-card .product-thumbnail { position: relative; }

/* ---- فیلترهای فعال، تعداد نتایج ---- */
.shop-active { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .9rem; }
.shop-active .shop-count { font-size: .82rem; color: var(--muted); margin-inline-end: .4rem; }
.shop-active .shop-fchip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem; border-radius: 999px; font-size: .78rem; text-decoration: none;
  background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.shop-active .shop-fchip i { font-size: .65rem; opacity: .75; }
.shop-active .shop-fchip:hover { background: var(--brand); color: #fff; }
html[theme-color="dark"] .shop-active .shop-fchip:hover { color: #05211f; }
.shop-active .shop-fclear { font-size: .78rem; color: var(--muted); text-decoration: underline; margin-inline-start: .3rem; }

/* ---- اسکلت بارگذاری ---- */
.shop-skel { border-radius: 1.1rem; background: var(--card); border: 1px solid var(--border); padding: .8rem; overflow: hidden; }
.shop-skel i, .shop-skel b { display: block; border-radius: .6rem; background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 55%, var(--card)) 50%, var(--surface) 75%); background-size: 200% 100%; animation: nhx-shimmer 1.2s infinite linear; }
.shop-skel i { aspect-ratio: 1; margin-bottom: .7rem; }
.shop-skel b { height: .8rem; margin-bottom: .45rem; }
.shop-skel b:nth-child(2) { width: 70%; } .shop-skel b:nth-child(3) { width: 45%; }
@keyframes nhx-shimmer { to { background-position: -200% 0; } }
.shop-product-col { animation: nhx-in .28s ease both; }
@keyframes nhx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- حالت خالی بهتر ---- */
.shop-empty .shop-empty-tips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .75rem; }

/* ---- دید سریع ---- */
html.nhx-lock, html.nhx-lock body { overflow: hidden; }
.nhx-qv { position: fixed; inset: 0; z-index: 1700; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: opacity .2s; }
.nhx-qv[hidden] { display: none; }
.nhx-qv.in { opacity: 1; }
.nhx-qv-back { position: absolute; inset: 0; background: rgba(8, 15, 25, .55); backdrop-filter: blur(3px); }
.nhx-qv-dlg { position: relative; width: min(760px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; border-radius: 1.4rem; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); transform: translateY(14px) scale(.98); transition: transform .22s; }
.nhx-qv.in .nhx-qv-dlg { transform: none; }
.nhx-qv-x { position: absolute; top: .7rem; inset-inline-start: .7rem; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); cursor: pointer; }
.qv { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0; }
.qv-media { position: relative; background: var(--surface); display: grid; place-items: center; min-height: 280px; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; max-height: 460px; }
.qv-flag { position: absolute; top: .8rem; inset-inline-end: .8rem; padding: .15rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.qv-flag.is-low { background: #f59e0b; color: #fff; } .qv-flag.is-out { background: #ef4444; color: #fff; }
.qv-body { padding: 1.6rem 1.4rem; display: flex; flex-direction: column; gap: .7rem; }
.qv-title { font-size: 1.15rem; font-weight: 800; margin: 0; padding-inline-end: 2.4rem; }
.qv-meta { margin: 0; color: var(--muted); font-size: .85rem; }
.qv-desc { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.9; }
.qv-price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; } .qv-price strong { font-size: 1.5rem; color: var(--brand); } .qv-price small { color: var(--muted); }
.qv-variants { display: flex; flex-wrap: wrap; gap: .45rem; }
.qv-chip { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: .8rem; padding: .35rem .75rem; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: inherit; line-height: 1.5; }
.qv-chip strong { font-size: .82rem; } .qv-chip span { font-size: .7rem; color: var(--muted); }
.qv-chip.is-active { border-color: var(--brand); background: var(--brand-soft); } .qv-chip:disabled { opacity: .4; cursor: not-allowed; }
.qv-actions { display: flex; gap: .6rem; margin-top: auto; flex-wrap: wrap; }
.qv-btn { border-radius: .9rem; padding: .65rem 1.1rem; font-weight: 700; border: 0; }
.qv-btn--main { flex: 1; background: var(--brand); color: #fff; } html[theme-color="dark"] .qv-btn--main { color: #05211f; }
.qv-btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.qv-note { font-size: .82rem; color: var(--muted); margin: 0; }
.nhx-qv-skel { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 300px; } .nhx-qv-skel i { background: var(--surface); } .nhx-qv-skel div { padding: 1.6rem 1.4rem; } .nhx-qv-skel b { display: block; height: 1rem; border-radius: .5rem; background: var(--surface); margin-bottom: .8rem; }
.nhx-qv-err { padding: 2rem; text-align: center; }
@media (max-width: 640px) {
  .nhx-qv { align-items: flex-end; padding: 0; }
  .nhx-qv-dlg { width: 100%; border-radius: 1.4rem 1.4rem 0 0; max-height: 92dvh; }
  .qv, .nhx-qv-skel { grid-template-columns: 1fr; } .qv-media { min-height: 0; max-height: 230px; } .qv-media img { max-height: 230px; }
  .qv-body { padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
}

/* ---- نوار مقایسه ---- */
.nhx-cmpbar { position: fixed; inset-inline: 0; margin-inline: auto; bottom: 1.2rem; width: fit-content; max-width: calc(100vw - 1.5rem); z-index: 1250; display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem .55rem 1rem; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 14px 38px rgba(0, 0, 0, .25); }
.nhx-cmpbar[hidden] { display: none; }
.nhx-cmp-count { font-size: .84rem; font-weight: 700; }
.nhx-cmp-go { background: var(--brand); color: #fff; border-radius: 999px; padding: .35rem 1.1rem; font-weight: 800; font-size: .84rem; text-decoration: none; } html[theme-color="dark"] .nhx-cmp-go { color: #05211f; }
.nhx-cmp-go.is-disabled { opacity: .5; }
.nhx-cmp-clear { border: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; }
@media (max-width: 991.98px) { .nhx-cmpbar { bottom: calc(var(--nhx-tabbar) + env(safe-area-inset-bottom, 0px) + .3rem); } body.has-stickybuy .nhx-cmpbar { bottom: calc(var(--nhx-tabbar) + env(safe-area-inset-bottom, 0px) + 4.5rem); } }

/* ---- toast ---- */
#nhxToast { position: fixed; z-index: 2450; inset-inline: 0; bottom: calc(var(--nh-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 12px); display: flex; flex-direction: column; align-items: center; gap: .35rem; pointer-events: none; padding-inline: .75rem; }
.nhx-toast { pointer-events: auto; display: inline-flex; align-items: center; gap: .45rem; max-width: min(360px, calc(100vw - 1.5rem)); padding: .32rem .7rem .32rem .38rem; padding-inline: .38rem .7rem; border-radius: 999px; font-size: 13px; line-height: 1.5; font-weight: 500; color: var(--text, #1d2433); background: color-mix(in srgb, var(--card, #fff) 86%, transparent); border: 1px solid color-mix(in srgb, var(--border, #e5e7eb) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 6px 18px rgba(0, 0, 0, .10); opacity: 0; transform: translateY(10px); transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1); }
.nhx-toast.in { opacity: 1; transform: none; }
.nhx-toast__ic { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; background: var(--brand, #0d7377); }
.nhx-toast.is-success .nhx-toast__ic { background: #0f9d76; } .nhx-toast.is-danger .nhx-toast__ic { background: #e0485a; } .nhx-toast.is-warning .nhx-toast__ic { background: #d97706; } .nhx-toast.is-info .nhx-toast__ic { background: #64748b; }
.nhx-toast__thumb { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: rgba(0,0,0,.05); }
.nhx-toast__tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nhx-toast__a { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--brand, #0d7377); text-decoration: none; padding-inline-start: .45rem; border-inline-start: 1px solid color-mix(in srgb, var(--border, #e5e7eb) 90%, transparent); }
@media (min-width: 992px) { #nhxToast { bottom: 22px; } }
body.has-stickybuy #nhxToast { bottom: calc(var(--nh-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 78px); }

/* ---- صفحهٔ محصول ---- */
.pd-tools { display: flex; gap: .4rem; flex: none; }
.pd-share-btn { border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; }
.pd-admin-edit {
  display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .9rem; border-radius: 999px; text-decoration: none;
  background: rgba(var(--brand-rgb), .1); border: 1px dashed rgba(var(--brand-rgb), .45); color: var(--brand); font-size: .8rem; font-weight: 800;
  transition: background .15s ease, color .15s ease;
}
.pd-admin-edit:hover, .pd-admin-edit:focus-visible { background: var(--brand); color: #fff; border-style: solid; }
html[theme-color="dark"] .pd-admin-edit:hover, html[theme-color="dark"] .pd-admin-edit:focus-visible { color: #06201e; }
@media (max-width: 575.98px) { .pd-admin-edit span { display: none; } .pd-admin-edit { width: 40px; padding: 0; justify-content: center; } }
.pd-no-rating { color: var(--muted); font-size: .82rem; }
.pd-breakdown { margin: .2rem 0 1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--card); overflow: hidden; }
.pd-breakdown summary { cursor: pointer; padding: .7rem 1rem; font-weight: 800; font-size: .9rem; display: flex; align-items: center; gap: .5rem; list-style: none; }
.pd-breakdown summary::-webkit-details-marker { display: none; }
.pd-breakdown summary i { color: var(--brand); }
.pd-breakdown .pd-bd-hint { font-weight: 500; font-size: .72rem; color: var(--muted); margin-inline-start: auto; }
.pd-breakdown dl { margin: 0; padding: 0 1rem .6rem; }
.pd-breakdown dl > div { display: flex; justify-content: space-between; gap: .75rem; padding: .42rem 0; border-top: 1px dashed var(--border); font-size: .86rem; }
.pd-breakdown dt { color: var(--muted); font-weight: 500; } .pd-breakdown dd { margin: 0; font-weight: 700; text-align: left; }
.pd-breakdown small { color: var(--muted); font-weight: 500; }
.pd-breakdown .is-total { border-top: 1.5px solid var(--border); font-size: .95rem; } .pd-breakdown .is-total dd { color: var(--brand); }
.pd-info-tabs .pd-tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: .9rem; overflow-x: auto; }
.pd-tabs button { border: 0; background: transparent; color: var(--muted); padding: .55rem .9rem; font-weight: 700; font-family: inherit; border-bottom: 2.5px solid transparent; white-space: nowrap; cursor: pointer; }
.pd-tabs button.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.pd-tab-pane { display: none; font-size: .9rem; line-height: 2; color: var(--text); } .pd-tab-pane.is-active { display: block; }
.pd-gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--text); cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.18); z-index: 3; }
.pd-gnav--prev { right: .6rem; } .pd-gnav--next { left: .6rem; }
.pd-gallery-main { position: relative; }
.nhx-lb { position: fixed; inset: 0; z-index: 1900; background: rgba(5, 10, 18, .94); display: flex; align-items: center; justify-content: center; }
.nhx-lb-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.nhx-lb img { max-width: 94vw; max-height: 90dvh; object-fit: contain; transition: transform .12s; user-select: none; -webkit-user-drag: none; }
.nhx-lb-x { position: absolute; top: 1rem; inset-inline-start: 1rem; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.1rem; cursor: pointer; }
.pd-sticky { position: fixed; inset-inline: .6rem; bottom: calc(var(--nhx-tabbar) + env(safe-area-inset-bottom, 0px)); z-index: 1300; display: none; align-items: center; justify-content: space-between; gap: .7rem; padding: .55rem .7rem; border-radius: 1.1rem; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 12px 34px rgba(0, 0, 0, .22); }
@media (max-width: 991.98px) { .pd-sticky:not([hidden]) { display: flex; } }
.pd-sticky-price { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; } .pd-sticky-price span { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pd-sticky-price strong { font-size: 1rem; color: var(--brand); } .pd-sticky-price small { color: var(--muted); font-weight: 500; }
.pd-sticky-btn { flex: none; background: var(--brand); color: #fff; border-radius: .9rem; font-weight: 800; padding: .6rem 1rem; border: 0; } html[theme-color="dark"] .pd-sticky-btn { color: #05211f; }
body.has-stickybuy .nc-launcher { --nc-bottom: 172px; }

/* ---- مقایسه ---- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 1.1rem; background: var(--card); }
.cmp-table { width: 100%; min-width: 560px; border-collapse: collapse; color: var(--text); }
.cmp-table th, .cmp-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; font-size: .88rem; }
.cmp-table tbody th { text-align: right; color: var(--muted); font-weight: 700; width: 110px; background: var(--surface); }
.cmp-table thead th { position: relative; padding-top: 1.3rem; }
.cmp-prod { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; } .cmp-prod img { border-radius: .9rem; object-fit: cover; }
.cmp-remove { position: absolute; top: .4rem; inset-inline-start: .4rem; border: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; }
.cmp-price { font-weight: 800; color: var(--brand); } .cmp-ok { color: #16a34a; font-weight: 700; } .cmp-out { color: #dc2626; font-weight: 700; }

/* ---- «اخیراً دیده‌اید» ---- */
[data-recent-rail][hidden] { display: none; }

/* ---- ریشهٔ کاهش حرکت ---- */
@media (prefers-reduced-motion: reduce) { .shop-product-col, .shop-skel i, .shop-skel b, .nhx-qv, .nhx-qv-dlg, .nhx-toast { animation: none !important; transition: none !important; } }

/* ai18: لودر داخل دکمه */
.is-loading { position: relative; pointer-events: none; cursor: progress; }
.is-loading > * { opacity: .25; }
button.is-loading, a.is-loading, input.is-loading { color: transparent !important; }
.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.05em; height: 1.05em; min-width: 14px; min-height: 14px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.25) rgba(255,255,255,.25); animation: nl-spin .7s linear infinite; }
:is(.btn-light,.btn-outline-secondary,.btn-link,.pv2-copy,.nhx-wish,.shop-chip).is-loading::after { border-color: var(--brand,#0d7377) var(--brand,#0d7377) rgba(var(--brand-rgb,13,115,119),.2) rgba(var(--brand-rgb,13,115,119),.2); }
@keyframes nl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::after { animation-duration: 1.6s; } }
