.directory-main { padding: 0 0 72px; }
.directory-container { width: min(1320px, calc(100% - 32px)); margin: 0 auto; }
.directory-category-nav { min-width: 220px; justify-content: flex-start; gap: 12px; padding-left: 28px; background: #245f9d; font-size: 15px; }
.directory-category-nav span { font-size: 21px; }
.directory-breadcrumb { min-height: 66px; display: flex; align-items: center; gap: 10px; color: #758093; font-size: 13px; }
.directory-breadcrumb a:hover { color: var(--portal-blue); }
.directory-landing,.directory-listing { border-radius: 8px; background: #fff; box-shadow: var(--portal-shadow); }
.directory-page-heading { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 30px; border-bottom: 1px solid var(--portal-line); }
.directory-page-heading p { margin: 0 0 5px; color: var(--portal-blue); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.directory-page-heading h1 { margin: 0; font-size: 30px; }
.directory-page-heading span { color: var(--portal-muted); font-size: 10px; }
.directory-group { padding: 26px 30px 34px; }
.directory-group + .directory-group { border-top: 12px solid var(--portal-bg); }
.directory-group h2 { margin: 0; padding-bottom: 16px; border-bottom: 1px solid #d8e5f3; color: var(--portal-blue); font-size: 19px; }
.directory-group h2 span { margin-right: 9px; }
.directory-category-catalog { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 10px 18px; padding-top: 20px; }
.directory-category-tile { position: relative; overflow: hidden; min-width: 0; min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; color: #4d5869; transition: border-color 160ms ease,background 160ms ease,color 160ms ease,transform 160ms ease; }
.directory-category-tile:hover,.directory-category-tile:focus-visible { border-color: #b8d7f7; background: #f1f8ff; color: #1769b4; outline: none; transform: translateY(-2px); }
.directory-category-icon,.listing-category-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg,#4da1f3,#2368b7); color: #fff; box-shadow: 0 7px 18px rgba(42,104,166,.16); font-size: 19px; font-weight: 850; }
.directory-category-icon img,.listing-category-icon img { width: 100%; height: 100%; object-fit: cover; }
.directory-category-name { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.directory-category-count { display: block; margin-top: 4px; color: var(--portal-muted); font-size: 9px; }

.listing-panel { padding: 32px; }
.listing-sort-tabs { min-height: 54px; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--portal-line); scrollbar-width: none; }
.listing-sort-tabs::-webkit-scrollbar { display: none; }
.listing-sort { min-width: max-content; min-height: 52px; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 0 22px; border: 1px solid transparent; border-bottom-color: var(--portal-line); border-radius: 6px 6px 0 0; background: transparent; color: #4f5968; cursor: pointer; font-size: 13px; font-weight: 760; }
.listing-sort svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.listing-sort:hover,.listing-sort:focus-visible { background: #f3f7fb; color: #246eaf; outline: none; }
.listing-sort.is-active { border-color: #d7e2ed; border-bottom-color: #edf6ff; background: #edf6ff; color: #1769b4; }
.listing-category-area { border-bottom: 1px solid var(--portal-line); }
.listing-category-toggle { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; border: 0; background: transparent; color: #2f3c50; cursor: pointer; font-size: 14px; font-weight: 820; text-align: left; }
.listing-category-toggle:hover,.listing-category-toggle:focus-visible { color: var(--portal-blue); outline: none; }
.listing-category-toggle-state { margin-left: auto; color: var(--portal-blue); font-size: 11px; font-weight: 760; }
.listing-category-toggle-icon { color: var(--portal-blue); font-size: 17px; transition: transform 180ms ease; }
.listing-category-area:not(.is-collapsed) .listing-category-toggle-icon { transform: rotate(180deg); }
.listing-category-area.is-collapsed .listing-category-panel { display: none; }
.listing-category-area:not(.is-collapsed) > .listing-category-toggle { display: none; }
.listing-category-panel { display: grid; grid-template-columns: 96px minmax(0,1fr) 74px; align-items: start; gap: 16px; padding: 22px 0; background: #fff; }
.listing-category-label { margin: 8px 0 0; color: #2e3745; font-size: 14px; font-weight: 800; }
.listing-category-grid { max-height: 176px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); align-content: start; gap: 6px 10px; overflow-y: auto; overscroll-behavior: contain; padding: 0 7px 0 0; scrollbar-color: #c7d8e8 transparent; scrollbar-width: thin; }
.listing-category-button { min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 8px; overflow: hidden; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: #fff; color: #485362; cursor: pointer; text-align: left; transition: border-color 150ms ease,background 150ms ease,color 150ms ease; }
.listing-category-button:hover,.listing-category-button:focus-visible { border-color: #b7d4ef; background: #f4f9ff; color: #1769b4; outline: none; }
.listing-category-button.is-active { border-color: var(--portal-blue); background: #f3f8ff; color: #1769b4; box-shadow: inset 0 0 0 1px rgba(49,134,232,.16); }
.listing-category-button strong { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.listing-category-button small { display: none; }
.listing-category-button.is-all { background: #f7fbff; }
.listing-category-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg,#5aa8f2,#316fbd); color: #fff; font-size: 8px; font-weight: 850; }
.listing-category-button.is-all .listing-category-icon { font-size: 9px; }
.listing-category-close { min-width: 74px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 1px; padding: 0 10px; border: 0; border-radius: 6px; background: #eef2f6; color: #657181; cursor: pointer; font-size: 11px; font-weight: 760; }
.listing-category-close span:first-child { font-size: 18px; line-height: 1; }
.listing-category-close:hover,.listing-category-close:focus-visible { background: #e4effb; color: var(--portal-blue); outline: none; }
.listing-search-summary { display: inline-flex; align-items: center; min-height: 52px; padding: 0 14px; border-radius: 7px; background: #edf6ff; color: #1769b4; font-size: 12px; font-weight: 760; }
.listing-toolbar { display: grid; grid-template-columns: auto minmax(320px,1fr) auto auto; align-items: center; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--portal-line); }
.listing-types { display: flex; align-items: center; gap: 6px; }
.listing-types > span { margin-right: 8px; color: #313b49; font-size: 12px; font-weight: 800; }
.listing-type { min-height: 38px; padding: 0 13px; border: 1px solid #c8d8e8; border-radius: 5px; background: #fff; color: #526176; cursor: pointer; font-size: 11px; font-weight: 750; }
.listing-type:hover,.listing-type:focus-visible { border-color: var(--portal-blue); color: #1769b4; outline: none; }
.listing-type.is-active { border-color: var(--portal-blue); background: var(--portal-blue); color: #fff; }
.listing-type.is-active::after { content: "✓"; margin-left: 7px; font-size: 10px; }
.listing-search { width: 100%; max-width: 660px; display: flex; justify-self: center; min-width: 0; }
.listing-search input { min-width: 0; flex: 1; height: 44px; padding: 0 16px; border: 1px solid #d7e1ec; border-right: 0; border-radius: 6px 0 0 6px; outline: none; color: #283444; }
.listing-search input:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(49,134,232,.1); }
.listing-search button { min-width: 104px; border: 0; border-radius: 0 6px 6px 0; background: #326fae; color: #fff; cursor: pointer; font-weight: 780; }
.listing-search button:hover,.listing-search button:focus-visible { background: #245f9d; outline: none; }
.listing-view { display: inline-flex; justify-self: end; gap: 2px; padding: 4px; border: 1px solid #dce5ef; border-radius: 6px; background: #fff; box-shadow: 0 4px 14px rgba(34,74,117,.08); }
.listing-view button { width: 38px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: #fff; color: #a0a8b3; cursor: pointer; transition: background 150ms ease,color 150ms ease,transform 150ms ease; }
.listing-view button:hover,.listing-view button:focus-visible { background: #f0f7ff; color: #4d8fd3; outline: none; transform: translateY(-1px); }
.listing-view button.is-active { background: #e4f1ff; color: var(--portal-blue); }
.listing-view button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.directory-refresh-button { min-width: 102px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid var(--portal-blue); border-radius: 6px; background: var(--portal-blue); color: #fff; cursor: pointer; font-size: 11px; font-weight: 800; transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.directory-refresh-button:hover:not(:disabled),.directory-refresh-button:focus-visible { border-color: var(--portal-blue-dark); background: var(--portal-blue-dark); outline: none; }
.directory-refresh-button:disabled { cursor: wait; opacity: .72; }
.directory-refresh-icon { display: inline-block; font-size: 17px; line-height: 1; }
.directory-refresh-button.is-loading .directory-refresh-icon { animation: directory-refresh-spin 760ms linear infinite; }
@keyframes directory-refresh-spin { to { transform: rotate(360deg); } }
.listing-meta { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 0; }
.listing-meta strong { font-size: 15px; }
.listing-meta span { color: var(--portal-muted); font-size: 10px; }
.directory-selection-toolbar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--portal-line); border-radius: 6px; background: #faf7ff; }
.directory-selection-toolbar[hidden] { display: none; }
.directory-selection-controls { display: flex; align-items: center; gap: 14px; min-width: 0; }
.directory-select-all-label { display: inline-flex; align-items: center; gap: 8px; color: var(--portal-ink); cursor: pointer; font-size: 11px; font-weight: 760; white-space: nowrap; }
.directory-select-all-label input,.directory-product-select-control input { width: 16px; height: 16px; margin: 0; accent-color: var(--portal-blue); cursor: pointer; }
.directory-selection-count { color: var(--portal-muted); font-size: 10px; white-space: nowrap; }
.directory-copy-selected-button { min-width: 94px; min-height: 34px; padding: 0 12px; border: 1px solid var(--portal-blue); border-radius: 5px; background: var(--portal-blue); color: #fff; cursor: pointer; font-size: 10px; font-weight: 780; }
.directory-copy-selected-button:hover:not(:disabled),.directory-copy-selected-button:focus-visible:not(:disabled) { border-color: var(--portal-blue-dark); background: var(--portal-blue-dark); outline: none; }
.directory-copy-selected-button:disabled { cursor: not-allowed; opacity: .42; }

.directory-product-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.directory-product-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #dbe3eb; border-radius: 8px; background: #fff; transition: border-color 180ms ease,box-shadow 180ms ease,transform 180ms ease; }
.directory-product-card:hover,.directory-product-card:has(.directory-product-action:focus-visible) { border-color: var(--portal-blue); box-shadow: 0 12px 30px rgba(28,103,176,.14); transform: translateY(-2px); }
.directory-product-card.is-selected { border-color: var(--portal-blue); box-shadow: 0 0 0 2px rgba(109,40,217,.16); }
.directory-product-image { position: relative; aspect-ratio: 1/1; margin: 12px; overflow: hidden; border-radius: 7px; background: linear-gradient(145deg,#e9f4ff,#d8edff); }
.directory-product-image img { width: 100%; height: 100%; object-fit: cover; }
.directory-product-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#5aa9f3,#276fb9); font-size: 58px; font-weight: 900; }
.directory-product-ribbon { position: absolute; top: 12px; right: -36px; width: 126px; padding: 6px 0; background: var(--portal-blue); color: #fff; font-size: 9px; font-weight: 850; text-align: center; transform: rotate(45deg); }
.directory-product-select-control { position: absolute; top: 10px; left: 10px; z-index: 3; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(51,25,90,.2); border-radius: 5px; background: rgba(255,255,255,.94); box-shadow: 0 3px 9px rgba(51,25,90,.12); }
.directory-product-select-control.is-disabled { opacity: .52; cursor: not-allowed; }
.directory-product-select-control.is-disabled input { cursor: not-allowed; }
.directory-product-body { padding: 0 14px; }
.directory-product-title { min-height: 46px; margin: 0; color: #273247; font-size: 14px; line-height: 1.65; font-weight: 760; }
.directory-product-meta { display: none; margin: 13px 0 0; color: #7e8793; font-size: 11px; line-height: 1.7; }
.directory-product-meta div { display: flex; min-width: 0; }
.directory-product-meta dt { flex: 0 0 auto; }
.directory-product-meta dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-product-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.directory-product-badge { min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 5px; background: #e8f3ff; color: #1970bd; font-size: 9px; font-weight: 780; }
.directory-product-badge.stock { background: #edf6f3; color: #2d906d; }
.directory-product-price { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 14px 14px; padding-top: 12px; border-top: 1px dashed #dbe5ef; }
.directory-flash-label { min-height: 23px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid #ffb9b9; border-radius: 4px; background: #fff1f1; color: #df2525; font-size: 10px; font-weight: 850; line-height: 1; white-space: nowrap; }
.directory-product-price .directory-flash-price { color: #e1251b; font-size: 23px; font-weight: 900; }
.directory-product-actions { position: absolute; right: 0; bottom: 0; left: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; background: linear-gradient(180deg,rgba(255,255,255,0),#fff 26%); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity 180ms ease,transform 180ms ease; }
.directory-product-card:hover .directory-product-actions,.directory-product-card:has(.directory-product-action:focus-visible) .directory-product-actions { opacity: 1; transform: none; pointer-events: auto; }
.directory-product-action,.directory-product-action:link,.directory-product-action:visited { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 999px; appearance: none; background: #3186e8; color: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 820; line-height: 1; text-decoration: none; white-space: nowrap; box-shadow: 0 7px 16px rgba(49,134,232,.2); transition: filter 160ms ease,transform 160ms ease; }
.directory-product-action-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.directory-product-action:hover,.directory-product-action:focus-visible { filter: brightness(.94); transform: translateY(-1px); outline: none; }
.directory-product-action.detail,.directory-product-action.detail:visited { background: #67aaf0; color: #fff; box-shadow: 0 7px 16px rgba(76,151,226,.2); }

.directory-product-grid[data-view="list"] { grid-template-columns: 1fr; gap: 14px; }
.directory-product-grid[data-view="list"] .directory-product-card { min-height: 184px; display: grid; grid-template-columns: 178px minmax(0,1fr) 248px; grid-template-rows: 1fr 64px; align-items: stretch; }
.directory-product-grid[data-view="list"] .directory-product-card:hover { transform: none; }
.directory-product-grid[data-view="list"] .directory-product-image { grid-column: 1; grid-row: 1 / 3; width: 148px; height: 148px; aspect-ratio: 1/1; margin: 18px; }
.directory-product-grid[data-view="list"] .directory-product-body { grid-column: 2; grid-row: 1 / 3; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 22px 18px; }
.directory-product-grid[data-view="list"] .directory-product-title { min-height: 0; font-size: 18px; line-height: 1.45; }
.directory-product-grid[data-view="list"] .directory-product-meta { display: block; }
.directory-product-grid[data-view="list"] .directory-product-badges { margin-top: 10px; }
.directory-product-grid[data-view="list"] .directory-product-price { grid-column: 3; grid-row: 1; align-self: start; flex-direction: column; align-items: flex-end; gap: 5px; margin: 28px 28px 0; padding: 0; border: 0; }
.directory-product-grid[data-view="list"] .directory-product-price strong { font-size: 28px; }
.directory-product-grid[data-view="list"] .directory-product-actions { position: relative; right: auto; bottom: auto; left: auto; grid-column: 3; grid-row: 2; align-self: end; justify-self: end; display: flex; gap: 0; overflow: hidden; margin: 0 26px 24px 0; padding: 0; border-radius: 999px; background: none; opacity: 1; transform: none; pointer-events: auto; }
.directory-product-grid[data-view="list"] .directory-product-action { min-width: 108px; border-radius: 0; box-shadow: none; }
.directory-product-grid[data-view="list"] .directory-product-action:first-child { border-radius: 999px 0 0 999px; }
.directory-product-grid[data-view="list"] .directory-product-action:last-child { border-left: 1px solid rgba(255,255,255,.34); border-radius: 0 999px 999px 0; }

.directory-product-grid[data-view="large"] { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.directory-product-grid[data-view="large"] .directory-product-image { aspect-ratio: 4/3; }
.directory-product-grid[data-view="large"] .directory-product-title { min-height: 52px; font-size: 15px; }
.directory-product-grid[data-view="large"] .directory-product-price strong { font-size: 25px; }

.directory-product-grid[data-view="compact"] { grid-template-columns: 1fr; gap: 10px; }
.directory-product-grid[data-view="compact"] .directory-product-card { min-height: 112px; display: grid; grid-template-columns: 106px minmax(0,1fr) 140px 226px; align-items: center; }
.directory-product-grid[data-view="compact"] .directory-product-image { grid-column: 1; width: 82px; aspect-ratio: 1/1; margin: 12px; }
.directory-product-grid[data-view="compact"] .directory-product-ribbon { top: 8px; right: -42px; width: 118px; padding: 5px 0; font-size: 8px; }
.directory-product-grid[data-view="compact"] .directory-product-body { grid-column: 2; padding: 13px 12px; }
.directory-product-grid[data-view="compact"] .directory-product-title { min-height: 0; display: -webkit-box; overflow: hidden; font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.directory-product-grid[data-view="compact"] .directory-product-badges { margin-top: 7px; }
.directory-product-grid[data-view="compact"] .directory-product-price { grid-column: 3; flex-direction: column; align-items: flex-end; gap: 5px; margin: 0 14px; padding: 0; border: 0; }
.directory-product-grid[data-view="compact"] .directory-product-price strong { font-size: 21px; }
.directory-product-grid[data-view="compact"] .directory-product-actions { position: relative; right: auto; bottom: auto; left: auto; grid-column: 4; padding: 12px 14px; background: none; transform: translateX(8px); }
.directory-product-grid[data-view="compact"] .directory-product-action { min-height: 38px; padding: 0 9px; font-size: 11px; }
.directory-load-more { min-width: 180px; min-height: 44px; display: block; margin: 28px auto 0; padding: 0 22px; border: 1px solid #8dbceb; border-radius: 6px; background: #fff; color: #2474be; cursor: pointer; font-size: 12px; font-weight: 800; }
.directory-load-more:hover,.directory-load-more:focus-visible { background: #edf6ff; outline: none; }
.directory-load-more[hidden] { display: none; }

.product-detail-dialog { width: min(720px,calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 28px 90px rgba(20,47,77,.32); }
.product-detail-dialog::backdrop { background: rgba(14,30,50,.62); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #415067; cursor: pointer; font-size: 21px; }
.detail-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); }
.detail-image { min-height: 330px; background: #eaf4ff; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy { padding: 42px 34px 32px; }
.detail-copy h2 { margin: 0; font-size: 25px; line-height: 1.35; }
.detail-copy p { color: var(--portal-muted); font-size: 11px; line-height: 1.8; }
.detail-price-row { display: flex; align-items: center; gap: 10px; margin: 22px 0; }
.detail-price { display: block; margin: 0; color: #e1251b; font-size: 34px; font-weight: 900; }

@media(max-width:1100px) {
  .directory-category-catalog { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .listing-category-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .listing-toolbar { grid-template-columns: minmax(0,1fr) auto auto; }
  .listing-types { grid-column: 1 / 3; }
  .listing-search { grid-column: 1; max-width: none; }
  .listing-view { grid-column: 2; }
  .directory-refresh-button { grid-column: 3; }
  .directory-product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .directory-product-grid[data-view="large"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .directory-product-grid[data-view="list"] .directory-product-card { grid-template-columns: 154px minmax(0,1fr) 220px; }
  .directory-product-grid[data-view="list"] .directory-product-image { width: 126px; height: 126px; margin: 28px 14px; }
  .directory-product-grid[data-view="list"] .directory-product-action { min-width: 96px; }
  .directory-product-grid[data-view="compact"] .directory-product-card { grid-template-columns: 96px minmax(0,1fr) 125px 204px; }
}

@media(max-width:760px) {
  .directory-container { width: min(100% - 20px,1320px); }
  .portal-header-search { display: none; }
  .directory-category-catalog { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .directory-group { padding: 22px 16px; }
  .listing-panel { padding: 16px 14px; }
  .listing-sort { min-height: 48px; padding: 0 13px; font-size: 11px; }
  .listing-sort svg { width: 16px; height: 16px; }
  .listing-category-panel { grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; }
  .listing-category-label { grid-column: 1; margin: 8px 0 0; }
  .listing-category-close { grid-column: 2; }
  .listing-category-grid { grid-column: 1 / 3; grid-row: 2; max-height: 176px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding-right: 5px; }
  .listing-category-button { min-height: 38px; }
  .listing-toolbar { grid-template-columns: 1fr; gap: 14px; padding: 17px 0; }
  .listing-types,.listing-search,.listing-view,.directory-refresh-button { grid-column: 1; }
  .listing-types { flex-wrap: wrap; }
  .listing-types > span { width: 100%; margin: 0 0 2px; }
  .listing-search { width: 100%; }
  .listing-search input { height: 42px; font-size: 12px; }
  .listing-search button { min-width: 82px; font-size: 11px; }
  .listing-view { justify-self: start; }
  .listing-meta { min-height: 48px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; }
  .directory-selection-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .directory-selection-controls { justify-content: space-between; gap: 10px; }
  .directory-copy-selected-button { width: 100%; }
  .directory-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  .directory-product-grid[data-view="large"],.directory-product-grid[data-view="list"],.directory-product-grid[data-view="compact"] { grid-template-columns: 1fr; }
  .directory-product-grid[data-view="list"] .directory-product-card { min-height: 0; grid-template-columns: 108px minmax(0,1fr); grid-template-rows: auto auto auto; }
  .directory-product-grid[data-view="list"] .directory-product-image { grid-column: 1; grid-row: 1 / 3; width: 88px; height: 88px; margin: 14px 10px; }
  .directory-product-grid[data-view="list"] .directory-product-body { grid-column: 2; grid-row: 1; padding: 14px 10px 7px; }
  .directory-product-grid[data-view="list"] .directory-product-title { display: -webkit-box; overflow: hidden; font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .directory-product-grid[data-view="list"] .directory-product-meta { margin-top: 8px; font-size: 9px; line-height: 1.5; }
  .directory-product-grid[data-view="list"] .directory-product-meta div:nth-child(2) { display: none; }
  .directory-product-grid[data-view="list"] .directory-product-badges { display: none; }
  .directory-product-grid[data-view="list"] .directory-product-price { grid-column: 2; grid-row: 2; align-items: flex-start; margin: 0 10px 12px; }
  .directory-product-grid[data-view="list"] .directory-flash-label { min-height: 20px; padding: 0 6px; font-size: 9px; }
  .directory-product-grid[data-view="list"] .directory-product-price strong { font-size: 22px; }
  .directory-product-grid[data-view="list"] .directory-product-actions { grid-column: 1 / 3; grid-row: 3; align-self: stretch; justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; margin: 0 12px 12px; border-radius: 6px; }
  .directory-product-grid[data-view="list"] .directory-product-action { min-width: 0; min-height: 40px; padding: 0 7px; font-size: 10px; }
  .directory-product-grid[data-view="list"] .directory-product-action:first-child { border-radius: 6px 0 0 6px; }
  .directory-product-grid[data-view="list"] .directory-product-action:last-child { border-radius: 0 6px 6px 0; }
  .directory-product-grid[data-view="compact"] .directory-product-card { grid-template-columns: 82px minmax(0,1fr); grid-template-rows: auto auto auto; min-height: 0; }
  .directory-product-grid[data-view="compact"] .directory-product-image { grid-column: 1; grid-row: 1 / 3; width: 62px; margin: 10px; }
  .directory-product-grid[data-view="compact"] .directory-product-body { grid-column: 2; grid-row: 1; padding: 10px; }
  .directory-product-grid[data-view="compact"] .directory-product-price { grid-column: 2; grid-row: 2; align-items: flex-start; margin: 0 10px 10px; }
  .directory-product-grid[data-view="compact"] .directory-flash-label { min-height: 20px; padding: 0 6px; font-size: 9px; }
  .directory-product-grid[data-view="compact"] .directory-product-actions { grid-column: 1 / 3; grid-row: 3; display: grid; grid-template-columns: 1fr 1fr; padding: 0 10px 10px; opacity: 1; transform: none; pointer-events: auto; }
  .directory-product-grid[data-view="grid"] .directory-product-actions,.directory-product-grid[data-view="large"] .directory-product-actions { position: static; margin: 0 10px 10px; padding: 0; background: none; opacity: 1; transform: none; pointer-events: auto; }
  .directory-product-action { padding: 0 8px; font-size: 10px; }
  .directory-product-action-icon { width: 16px; height: 16px; flex-basis: 16px; }
  .detail-layout { grid-template-columns: 1fr; }
}

@media(hover:none),(pointer:coarse) {
  .directory-product-actions { position: static; margin: 0 12px 12px; padding: 0; background: none; opacity: 1; transform: none; pointer-events: auto; }
}

/* Keep the directory content on the same purple visual system as the portal chrome. */
.directory-category-nav { background: var(--portal-blue-dark); }
.directory-breadcrumb { color: var(--portal-muted); }
.directory-breadcrumb a:hover { color: var(--portal-blue-dark); }
.directory-group h2 { border-bottom-color: var(--portal-line); color: var(--portal-blue-dark); }
.directory-category-tile { color: var(--portal-ink); }
.directory-category-tile:hover,
.directory-category-tile:focus-visible {
  border-color: #d8c7f4;
  background: #faf7ff;
  color: var(--portal-blue-dark);
}
.directory-category-icon,
.listing-category-icon {
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
  box-shadow: 0 7px 18px rgba(91, 33, 182, .18);
}
.listing-sort:hover,
.listing-sort:focus-visible { background: #faf7ff; color: var(--portal-blue-dark); }
.listing-sort.is-active {
  border-color: #e2d6f3;
  border-bottom-color: #f5efff;
  background: #f5efff;
  color: var(--portal-blue-dark);
}
.listing-category-toggle { color: var(--portal-ink); }
.listing-category-panel { background: var(--portal-card); }
.listing-category-label { color: var(--portal-ink); }
.listing-category-grid { scrollbar-color: #c9b5e8 transparent; }
.listing-category-button { color: var(--portal-ink); }
.listing-category-button:hover,
.listing-category-button:focus-visible {
  border-color: #d8c7f4;
  background: #faf7ff;
  color: var(--portal-blue-dark);
}
.listing-category-button.is-active {
  border-color: var(--portal-blue);
  background: #f5efff;
  color: var(--portal-blue-dark);
  box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .16);
}
.listing-category-button.is-all { background: #faf7ff; }
.listing-category-close { background: #f1edf8; color: var(--portal-muted); }
.listing-category-close:hover,
.listing-category-close:focus-visible { background: #e9def8; color: var(--portal-blue-dark); }
.listing-search-summary { background: #f5efff; color: var(--portal-blue-dark); }
.listing-type { border-color: #d9cbed; color: var(--portal-muted); }
.listing-type:hover,
.listing-type:focus-visible { color: var(--portal-blue-dark); }
.listing-search input:focus { box-shadow: 0 0 0 3px rgba(109, 40, 217, .1); }
.listing-search button { background: var(--portal-blue); }
.listing-search button:hover,
.listing-search button:focus-visible { background: var(--portal-blue-dark); }
.listing-view { border-color: var(--portal-line); box-shadow: 0 4px 14px rgba(51, 25, 90, .08); }
.listing-view button:hover,
.listing-view button:focus-visible { background: #faf7ff; color: #8b5cf6; }
.listing-view button.is-active { background: #eee5fb; color: var(--portal-blue-dark); }
.directory-product-card { border-color: var(--portal-line); }
.directory-product-card:hover,
.directory-product-card:has(.directory-product-action:focus-visible) {
  border-color: var(--portal-blue);
  box-shadow: 0 12px 30px rgba(91, 33, 182, .14);
}
.directory-product-image { background: linear-gradient(145deg, #f3edff, #e7dafa); }
.directory-product-placeholder { background: linear-gradient(145deg, #8b5cf6, #5b21b6); }
.directory-product-title { color: var(--portal-ink); }
.directory-product-badge { background: #f0e8fc; color: var(--portal-blue-dark); }
.directory-product-badge.stock { background: #f0e8fc; color: #6d28d9; }
.directory-product-price { border-top-color: var(--portal-line); }
.directory-product-action,
.directory-product-action:link,
.directory-product-action:visited {
  background: var(--portal-blue);
  box-shadow: 0 7px 16px rgba(109, 40, 217, .2);
}
.directory-product-action.detail,
.directory-product-action.detail:visited {
  background: #8b5cf6;
  box-shadow: 0 7px 16px rgba(139, 92, 246, .2);
}
.directory-load-more { border-color: #c9b5e8; color: var(--portal-blue-dark); }
.directory-load-more:hover,
.directory-load-more:focus-visible { background: #faf7ff; }
.product-detail-dialog { box-shadow: 0 28px 90px rgba(51, 25, 90, .32); }
.product-detail-dialog::backdrop { background: rgba(36, 18, 61, .62); }
.dialog-close { color: var(--portal-ink); }
.detail-image { background: #f0e8fc; }
