.warehouse-products-rail { display: none; }
.products-surface::before { display: none; }

.products-header__title { display: flex; align-items: center; gap: 13px; }
.products-header__title > span:last-child { min-width: 0; }
.products-header__icon { display: grid; flex: 0 0 auto; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: #fff; background: #465a78; }
.products-header__icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.products-category-tabs { display: flex; gap: 7px; overflow-x: auto; padding-block: 2px 5px; scrollbar-width: thin; }
.products-category-tabs a { flex: 0 0 auto; min-height: 38px; padding: 9px 14px; border-radius: 10px; color: #4f6078; background: #edf1f6; font-size: 0.75rem; font-weight: 750; }
.products-category-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.products-category-tabs a small { min-width: 18px; padding: 2px 5px; border-radius: 999px; color: #63738a; background: rgba(255,255,255,.72); font-size: .58rem; font-variant-numeric: tabular-nums; text-align: center; }
.products-category-tabs a.is-active small { color: #465a78; background: #fff; }
.products-category-tabs a:hover { color: #22344f; background: #e2e8f0; }
.products-category-tabs a.is-active { color: #fff; background: #465a78; box-shadow: 0 8px 18px rgba(43, 61, 87, 0.18); }
.products-control-bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.products-control-bar .products-search > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.products-control-bar .products-search__controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.products-control-bar .products-search__controls input,
.products-control-bar .products-search__controls button { min-height: 42px; }
.products-control-bar .products-tools { position: relative; margin: 0; }
.products-control-bar .products-tools > summary { display: flex; min-height: 42px; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid #cbd5e2; border-radius: 10px; color: #334967; background: #fff; cursor: pointer; font-size: 0.75rem; font-weight: 800; list-style: none; }
.products-control-bar .products-tools > summary::-webkit-details-marker { display: none; }
.products-control-bar .products-tools > summary svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.products-control-bar .products-tools[open] > summary { color: #fff; background: #465a78; }
.products-control-bar .products-filters__fields { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; display: grid; width: min(540px, calc(100vw - 40px)); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 14px; border: 1px solid #d4dce7; border-radius: 14px; background: #fff; box-shadow: 0 18px 42px rgba(34, 52, 79, 0.18); z-index: 20; }
.products-control-bar .products-filters__fields .dashboard-actions { display: flex; grid-column: 1 / -1; gap: 8px; }
.products-control-bar .products-filters__fields .dashboard-actions > * { min-height: 38px; }
.products-empty { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 170px; padding: 28px; border-radius: 15px; color: #334967; background: #eef3f8; }
.products-empty__icon { display: grid; width: 72px; height: 72px; place-items: center; border-radius: 16px; color: #526783; background: #fff; box-shadow: 0 10px 24px rgba(45, 64, 91, 0.1); }
.products-empty__icon svg { width: 46px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.products-empty h2 { margin: 0; color: #22344f; font-size: 1.05rem; letter-spacing: -0.02em; }
.products-empty p { margin: 5px 0 0; color: #607087; font-size: 0.78rem; }

.products-catalogue-layout { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) 184px; gap: 12px; }
.products-results { display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 9px; }
.products-results__toolbar { display: flex; min-height: 32px; align-items: center; justify-content: space-between; color: #53657d; font-size: .68rem; }
.products-view-switch { display: inline-flex; padding: 3px; border-radius: 9px; background: #edf1f6; }
.products-view-switch a { display: grid; width: 29px; height: 27px; place-items: center; border-radius: 7px; color: #66778e; }
.products-view-switch a:hover { color: #273b59; }
.products-view-switch a.is-active { color: #fff; background: #465a78; }
.products-view-switch svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.products-card-grid { display: grid; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 10px; overflow: auto; padding: 1px 4px 6px 1px; scrollbar-color: #a8b5c6 transparent; scrollbar-width: thin; }
.catalogue-card { min-width: 0; overflow: hidden; border: 1px solid #dce3ec; border-radius: 13px; background: #fff; transition: border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out; }
.catalogue-card:hover { border-color: #b7c4d5; box-shadow: 0 10px 22px rgba(43, 60, 85, .1); transform: translateY(-2px); }
.catalogue-card:focus-within { outline: 3px solid rgba(70, 90, 120, .24); outline-offset: 2px; }
.catalogue-card__image { position: relative; display: block; height: 118px; overflow: hidden; background: #e9eef4; }
.catalogue-card__image > img { width: 100%; height: 100%; object-fit: cover; }
.catalogue-card__image > span { display: grid; height: 100%; place-items: center; align-content: center; gap: 6px; color: #687990; font-size: .65rem; }
.catalogue-card__image > span svg { width: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stock-badge { display: inline-flex; min-height: 22px; align-items: center; width: max-content; padding: 4px 8px; border-radius: 999px; font-size: .58rem; font-style: normal; font-weight: 800; line-height: 1; white-space: nowrap; }
.catalogue-card__image .stock-badge { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; }
.stock-badge--available { color: #146c50; background: #dcf4e9; }
.stock-badge--low { color: #98500f; background: #fff0d7; }
.stock-badge--out { color: #a33d3d; background: #ffe4e2; }
.catalogue-card__inactive { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; padding: 4px 7px; border-radius: 999px; color: #fff; background: #52637a; font-size: .55rem; font-style: normal; font-weight: 800; }
.catalogue-card__body { padding: 10px 11px 11px; }
.catalogue-card__body h2 { margin: 0; overflow: hidden; color: #1f314c; font-size: .79rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.catalogue-card__body h2 a { color: inherit; }
.catalogue-card__sku { margin: 3px 0 8px; overflow: hidden; color: #6b7a90; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.catalogue-card__body dl { display: grid; gap: 4px; margin: 0; }
.catalogue-card__body dl div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 5px; font-size: .59rem; }
.catalogue-card__body dt { color: #728096; }
.catalogue-card__body dd { margin: 0; overflow: hidden; color: #364a67; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.catalogue-card__body footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #e6ebf1; }
.catalogue-card__body footer > span { color: #5a6a81; font-size: .58rem; }
.catalogue-card__body footer strong { color: #15805d; font-size: .76rem; font-variant-numeric: tabular-nums; }
.catalogue-card__body footer a { display: inline-flex; align-items: center; gap: 2px; color: #3d587c; font-size: .59rem; font-weight: 800; }
.catalogue-card__body footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.catalogue-card__body footer svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.products-catalogue-table { min-height: 0; overflow: auto; border: 1px solid #dce3ec; border-radius: 12px; }
.products-catalogue-table .stock-badge { min-height: 20px; }

.catalogue-summary { min-height: 0; overflow: auto; border: 1px solid #dce3ec; border-radius: 13px; background: #f8fafc; scrollbar-width: thin; }
.catalogue-summary section { padding: 12px; }
.catalogue-summary section + section { border-top: 1px solid #e1e7ef; }
.catalogue-summary h2 { display: flex; align-items: center; min-height: 20px; margin: 0 0 8px; color: #233650; font-size: .68rem; }
.catalogue-summary__rows { display: grid; gap: 0; margin: 0; }
.catalogue-summary__rows div { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 25px; color: #607087; font-size: .58rem; }
.catalogue-summary__rows div:first-child { min-height: 31px; margin-bottom: 4px; border-bottom: 1px solid #e2e8ef; color: #314763; font-weight: 800; }
.catalogue-summary__rows dd { margin: 0; color: #233650; font-weight: 850; font-variant-numeric: tabular-nums; }
.catalogue-summary__status { display: grid; gap: 2px; }
.catalogue-summary__status a { display: grid; min-height: 27px; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: #52647b; font-size: .58rem; }
.catalogue-summary__status a:hover span { color: #243853; text-decoration: underline; text-underline-offset: 3px; }
.catalogue-summary__status i { width: 7px; height: 7px; border-radius: 50%; }
.catalogue-summary__status i.is-available { background: #49b88f; }
.catalogue-summary__status i.is-low { background: #f1a844; }
.catalogue-summary__status i.is-out { background: #e26363; }
.catalogue-summary__status strong { color: #2b405d; font-variant-numeric: tabular-nums; }
.catalogue-summary__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.catalogue-summary__actions a { display: grid; min-height: 49px; place-items: center; align-content: center; gap: 3px; padding: 5px; border-radius: 9px; color: #fff; background: #465a78; font-size: .53rem; font-weight: 750; text-align: center; }
.catalogue-summary__actions a:hover { background: #354a69; }
.catalogue-summary__actions svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 821px) {
    body.role-warehouse_worker:has(.products-page--warehouse) { overflow: hidden; }
    body.role-warehouse_worker .products-page--warehouse { display: grid; width: 100%; height: 100vh; grid-template-columns: 148px minmax(0, 1fr); margin: 0; padding: 0; background: #eef2f7; }
    .warehouse-products-rail { display: flex; min-width: 0; flex-direction: column; gap: 7px; height: 100vh; padding: 12px 9px 10px; color: #dce5f0; background: #263b59; }
    .warehouse-products-rail svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .warehouse-products-rail__brand { display: grid; width: 68px; height: 68px; place-self: center; margin-bottom: 6px; overflow: hidden; border-radius: 13px; box-shadow: 0 10px 24px rgba(8, 18, 34, 0.24); }
    .warehouse-products-rail__brand img { width: 100%; height: 100%; object-fit: cover; }
    .warehouse-products-rail__dashboard,
    .warehouse-products-rail__stock { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 34px; padding: 7px 9px; border-radius: 9px; color: #e5ebf3; font-size: 0.66rem; font-weight: 750; }
    .warehouse-products-rail__dashboard { color: #263b59; background: #fff; }
    .warehouse-products-rail__dashboard svg,
    .warehouse-products-rail__stock svg { width: 16px; }
    .warehouse-products-rail__nav { display: grid; gap: 2px; }
    .warehouse-products-rail__nav > span { margin: 6px 8px 2px; color: #aebdce; font-size: 0.54rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
    .warehouse-products-rail__nav a { min-height: 31px; padding: 7px 9px 7px 27px; border-radius: 9px; color: #d6dfeb; font-size: 0.65rem; font-weight: 650; }
    .warehouse-products-rail__nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
    .warehouse-products-rail__nav a.is-active { color: #fff; background: #526783; }
    .warehouse-products-rail__stock { margin-top: 5px; }
    .warehouse-products-rail > small { margin-top: auto; padding: 8px; overflow: hidden; color: #b9c7d8; font-size: 0.6rem; text-overflow: ellipsis; white-space: nowrap; }
    body.role-warehouse_worker .products-surface { height: calc(100vh - 24px); margin: 12px; padding: 18px; overflow: hidden; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 14px 36px rgba(50, 69, 96, 0.09); box-sizing: border-box; }
    body.role-warehouse_worker .products-stack { display: flex; height: 100%; min-height: 0; flex-direction: column; gap: 10px; }
    body.role-warehouse_worker .products-header h1 { color: #17243a; font-size: clamp(1.35rem, 2.3vw, 1.9rem); letter-spacing: -0.03em; }
    body.role-warehouse_worker .products-header__count { margin-top: 3px; color: #66758b; font-size: 0.72rem; }
    body.role-warehouse_worker .products-header__actions > a { min-height: 40px; padding: 9px 13px; border-radius: 10px; font-size: 0.72rem; }
    body.role-warehouse_worker .products-table thead th { background: #465a78; }
}

@media (min-width: 1180px) {
    .products-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .products-catalogue-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 16px; }
    .catalogue-card__image { height: 148px; }
}

@media (max-width: 820px) {
    .products-category-tabs { margin-inline: -2px; }
    .products-control-bar { grid-template-columns: minmax(0, 1fr); }
    .products-control-bar .products-tools > summary { width: 100%; justify-content: center; }
    .products-control-bar .products-filters__fields { position: static; width: 100%; grid-template-columns: minmax(0, 1fr); margin-top: 8px; box-shadow: none; }
    .products-empty { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: 20px; }
    .products-empty > .button-link { display: none; }
    .products-catalogue-layout { grid-template-columns: minmax(0, 1fr); }
    .products-card-grid { grid-template-columns: minmax(0, 1fr); overflow: visible; }
    .catalogue-card__image { height: 190px; }
    .catalogue-summary { overflow: visible; }
}
