/* Stock list: hub table, item pages and the stock block on brand profiles. Builds on site.css tokens. */

/* ---------- Hub ---------- */
.stk { padding-top: 0; }
.stk__tools { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 10px; }
.stk__sel select { width: 100%; height: 48px; padding-inline: 14px 36px; border: 1px solid var(--line); border-radius: 2px; background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; font: 400 15.5px var(--f-sans); color: var(--ink); -webkit-appearance: none; appearance: none; cursor: pointer; }
html[dir="rtl"] .stk__sel select { padding-inline: 14px 36px; background-position: 13px 55%, 18px 55%; }
.stk__sel select:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: transparent; }

.stk__head, .stk__row { display: grid; grid-template-columns: 44px minmax(0, 3.2fr) minmax(0, 4fr) minmax(0, 1.1fr) 112px; gap: 16px; align-items: center; }
.stk__head { margin-top: 14px; padding: 10px 0; border-bottom: 1px solid var(--ink); color: var(--muted); }
.stk__list { border-bottom: 1px solid var(--line); }
.stk__row { padding: 14px 0; border-top: 1px solid var(--line); transition: background .2s; }
.stk__row:first-child { border-top: 0; }
.stk__row[hidden] { display: none; }
.stk__row:hover { background: #fff; }
.stk__row.is-on { background: #fff; box-shadow: inset 3px 0 0 var(--signal); }
html[dir="rtl"] .stk__row.is-on { box-shadow: inset -3px 0 0 var(--signal); }

.stk__ck { position: relative; display: grid; place-items: center; }
.stk__ck input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.stk__ck label { display: block; width: 22px; height: 22px; border: 1.5px solid var(--ink-2); border-radius: 2px; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.stk__ck label::after { content: ""; display: block; width: 6px; height: 11px; margin: 2px auto 0; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.stk__ck input:checked + label { background: var(--navy); border-color: var(--navy); }
.stk__ck input:checked + label::after { opacity: 1; }
.stk__ck input:focus-visible + label { outline: 2px solid var(--signal); outline-offset: 2px; }

.stk__id { display: grid; gap: 2px; min-width: 0; }
.stk__mk { font: 500 12.5px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stk__md { font: 600 18px/1.25 var(--f-mono); color: var(--navy); overflow-wrap: anywhere; text-align: start; }
html[dir="rtl"] .stk__md { text-align: right; }
.stk__md:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.stk__ty { font-size: 15.5px; color: var(--ink-2); }
.stk__tag { display: inline-block; margin-inline-start: 6px; padding: 2px 8px; border: 1px solid var(--signal-ink); border-radius: 2px; font: 500 11.5px/1.5 var(--f-mono); font-style: normal; letter-spacing: .03em; color: var(--signal-ink); white-space: nowrap; vertical-align: 1px; }
.stk__av { font-size: 14px; color: var(--muted); white-space: nowrap; }
.stk__av b { font: 600 17px var(--f-mono); color: var(--ink); }
.stk__qt input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 2px; background: #fff; font: 500 16px var(--f-mono); color: var(--ink); text-align: center; }
.stk__qt input:disabled { background: transparent; color: var(--muted); border-style: dashed; opacity: .6; }
.stk__qt input:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: transparent; }

/* Request block under the table. */
.stk__form { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--ink); scroll-margin-top: calc(var(--hd) + 16px); }
.stk__sum .form__t { margin-top: 10px; }
.stk__picked { border-top: 1px solid var(--line); counter-reset: pk; }
.stk__picked li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); counter-increment: pk; }
.stk__picked li::before { content: counter(pk, decimal-leading-zero); font: 400 12px var(--f-mono); color: var(--muted); }
.stk__picked b { font: 600 15.5px/1.3 var(--f-mono); color: var(--navy); overflow-wrap: anywhere; }
.stk__picked small { display: block; font: 400 13.5px/1.4 var(--f-sans); color: var(--muted); }
.stk__picked span { font: 500 14px var(--f-mono); white-space: nowrap; }
.stk__picked button { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.stk__picked button:hover { color: var(--signal-ink); }
.stk__none { padding: 16px 0; color: var(--muted); border-top: 1px solid var(--line); }
.stk__none[hidden] { display: none; }
.stk__fine { margin-top: 18px; font-size: 14.5px; color: var(--muted); max-width: 46ch; }
.stk__fields { min-width: 0; }

/* Selection tray: follows the reader while the form is out of view. */
.stk__tray { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; align-items: center; gap: 20px; padding: 12px var(--gut) calc(12px + env(safe-area-inset-bottom)); background: var(--navy); color: var(--on-dark); box-shadow: 0 -12px 30px -18px rgba(6, 21, 41, .6); transform: translateY(110%); transition: transform .35s var(--ease); }
.stk__tray[hidden] { display: flex; visibility: hidden; }
.stk__tray.is-up { transform: none; visibility: visible; }
.stk__tray-n { font: 500 15px var(--f-sans); }
.stk__tray-n b { font: 600 18px var(--f-mono); color: #fff; }
.stk__tray .btn { background: var(--signal); border-color: var(--signal); }

/* ---------- Item page ---------- */
.sti__hd { padding-bottom: clamp(36px, 4vw, 56px); }
.sti__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 80px); align-items: center; margin-top: clamp(20px, 3vw, 36px); }
.sti__t { font-size: clamp(34px, 4.4vw, 64px); overflow-wrap: anywhere; }
.sti__t > span[dir="ltr"] { display: inline; margin: 0; font-size: inherit; font-weight: inherit; color: inherit; letter-spacing: -.02em; }
html[dir="rtl"] .sti__t > span[dir="ltr"] { display: block; text-align: right; }
.sti__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.sti__badge { padding: 6px 12px; border: 1px solid var(--line); border-radius: 2px; background: #fff; font: 500 13.5px/1.3 var(--f-sans); color: var(--ink-2); }
.sti__badge--ok { border-color: #2E7D4F; background: #EAF3EC; color: #1D4D31; }
.sti__badge--ok::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; background: #2E7D4F; vertical-align: 1px; }
.sti__badge--rare { border-color: var(--signal-ink); color: var(--signal-ink); }
.sti__plate { aspect-ratio: 5 / 4; }

.sti__body { padding-top: clamp(24px, 3vw, 40px); }
.sti__cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.sti__specs { margin-top: 14px; border-top: 1px solid var(--ink); }
.sti__specs > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sti__specs dt { font: 400 13px/1.5 var(--f-mono); letter-spacing: .03em; color: var(--muted); }
html:is([lang^="fa"], [lang^="ar"]) .sti__specs dt { font: 400 14.5px/1.6 var(--f-sans); letter-spacing: 0; }
.sti__specs dd { margin: 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
html[dir="rtl"] .sti__specs dd[dir="ltr"] { text-align: right; }
.sti__specs a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.sti__note { margin-top: clamp(36px, 4vw, 52px); padding: 20px 22px; background: #FBEDE7; border-inline-start: 3px solid var(--signal); }
.sti__note p:last-child { margin-top: 6px; color: var(--ink-2); }
.sti__brand { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: clamp(36px, 4vw, 52px); padding: 22px; border: 1px solid var(--line); background: #fff; }
.sti__brand-logo { display: grid; place-items: center; min-height: 80px; }
.sti__brand-logo img { max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.sti__brand-logo b { font: 600 22px/1 var(--f-cond); color: var(--ink-2); }
.sti__brand p:not(.lb) { margin-block: 6px 10px; color: var(--ink-2); }
.sti__brand .lnk { margin-inline-end: 22px; }

.sti__side { position: sticky; top: calc(var(--hd) + 24px); display: grid; gap: 18px; scroll-margin-top: calc(var(--hd) + 16px); }
.sti__form { padding: clamp(22px, 2.4vw, 32px); background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); }
.sti__fq { margin-block: 6px 18px; font: 600 20px/1.3 var(--f-mono); color: var(--navy); overflow-wrap: anywhere; }
html[dir="rtl"] .sti__fq span { display: block; text-align: right; }
.sti__form .form__row { grid-template-columns: minmax(0, 1fr); }
.sti__form .fld input, .sti__form .fld textarea { background: var(--paper); }
.sti__form .fld textarea { min-height: 96px; }
.sti__qty { display: grid; grid-template-columns: auto 110px 1fr; align-items: center; gap: 0 14px; }
.sti__qty > span { grid-column: 1 / -1; }
.sti__qty input { grid-column: 1 / 3; font-family: var(--f-mono); text-align: center; }
.sti__qty small { color: var(--muted); font-size: 14px; }
.sti__add { justify-self: start; }

/* ---------- Compact list (related items, brand profiles) ---------- */
.skl { border-top: 1px solid var(--ink); }
.skl a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) auto 24px; gap: 16px; align-items: baseline; padding: 15px 4px; border-bottom: 1px solid var(--line); transition: background .2s; }
.skl a:hover, .skl a:focus-visible { background: #fff; }
.skl__m { font: 600 16.5px/1.3 var(--f-mono); color: var(--navy); overflow-wrap: anywhere; text-align: start; }
html[dir="rtl"] .skl__m { text-align: right; }
.skl__t { color: var(--ink-2); font-size: 15.5px; }
.skl__q { font: 400 13px var(--f-mono); color: var(--muted); white-space: nowrap; }
.skl .lnk__ar { color: var(--signal-ink); }
html[dir="rtl"] .skl .lnk__ar { transform: scaleX(-1); }
.brp__stock { margin-top: clamp(44px, 5vw, 64px); }
.brp__stock .brp__h { margin-top: 0; }
.brp__stock > p { margin-block: 6px 4px; color: var(--ink-2); }
.brp__stock .skl { margin-top: 14px; }
.brp__stock > .lnk { display: inline-flex; margin-top: 16px; }

@media (max-width: 1024px) {
	.stk__head, .stk__row { grid-template-columns: 40px minmax(0, 3fr) minmax(0, 3fr) minmax(0, 1fr) 96px; gap: 12px; }
	.stk__form, .sti__cols { grid-template-columns: minmax(0, 1fr); }
	.sti__side { position: static; }
	.sti__grid { grid-template-columns: minmax(0, 1fr); }
	.sti__plate { max-width: 380px; }
}
@media (max-width: 782px) {
	.stk__tools { grid-template-columns: minmax(0, 1fr); }
	.stk__head { display: none; }
	.stk__row { grid-template-columns: 36px minmax(0, 1fr) 88px; grid-template-areas: "ck id qt" "ck ty av"; gap: 4px 12px; align-items: start; }
	.stk__ck { grid-area: ck; padding-top: 4px; }
	.stk__id { grid-area: id; }
	.stk__ty { grid-area: ty; font-size: 14.5px; }
	.stk__av { grid-area: av; text-align: center; }
	.stk__qt { grid-area: qt; }
	.stk__tray { justify-content: space-between; }
	.skl a { grid-template-columns: minmax(0, 1fr) auto; }
	.skl__t { grid-column: 1 / -1; grid-row: 2; }
	.skl .lnk__ar { display: none; }
	.sti__brand { grid-template-columns: minmax(0, 1fr); }
	.sti__brand-logo { justify-items: start; min-height: 0; }
	.sti__specs > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 400px) {
	.stk__md { font-size: 16px; }
	.stk__row { grid-template-columns: 32px minmax(0, 1fr) 76px; }
}
@media (prefers-reduced-motion: reduce) { .stk__tray { transition: none; } }
