/* Scoped to the three existing directory views; other marketplace screens keep
   their layout. The final viewport foundation still owns safe areas/keyboards. */
.app-shell:has(>#publicSectionScreen.marketplace-directory:not([hidden])) {
 --directory-ink:#172d49;--directory-muted:#61748a;--directory-paper:#fff;
 --directory-soft:#f3f7fc;--directory-line:#e1e9f2;--directory-blue:#1263bf;
 background:var(--directory-paper);--section-safe-top:var(--zagros-safe-top,env(safe-area-inset-top,0px));
}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header {
 gap:8px!important;min-height:56px!important;height:56px!important;padding-block:4px!important;
 border-bottom:1px solid var(--directory-line);background:var(--directory-paper)!important;box-sizing:border-box;
}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>:is(.menu-button,.notification-button) {
 display:grid!important;place-items:center;flex:0 0 44px!important;min-width:44px!important;
 width:44px!important;height:44px!important;margin:0!important;font-size:20px!important;
 color:var(--directory-ink)!important;background:transparent!important;border-radius:10px;
}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>.notification-button {order:3;margin-inline-start:auto!important}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>.section-compact-back {flex:0 0 auto!important;width:auto!important;min-width:64px!important;padding-inline:6px!important;color:var(--directory-ink)!important}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>.section-compact-back::before {content:'\2190';font:22px/1 Arial,sans-serif}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>.section-compact-back::after {font-size:12px}
.app-shell.single-control-row:has(>.marketplace-directory:not([hidden]))>.top-header>.global-language-control {flex-shrink:1!important}
/* The generic Home/Buy Car search is not wired to directory results. These
   views retain their actual search and city controls together below the title. */
.app-shell:has(>#publicSectionScreen.marketplace-directory:not([hidden]))>.search-row,
.app-shell:has(>#publicSectionScreen.marketplace-directory:not([hidden]))>.top-header>.search-row {display:none!important}
#publicSectionScreen.marketplace-directory {min-height:0;padding:18px 0 24px;color:var(--directory-ink);background:var(--directory-paper);scroll-margin-top:64px}
#publicSectionScreen.marketplace-directory>.directory-heading {display:flex;align-items:flex-start;gap:10px;padding:0;margin:0 0 18px;min-height:0}
.marketplace-directory .directory-heading-icon {display:grid;place-items:center;flex:0 0 40px;height:40px;border-radius:12px;color:var(--directory-blue);background:var(--directory-soft);font-size:19px}
.marketplace-directory .directory-title-copy {min-width:0;flex:1}
#publicSectionScreen.marketplace-directory h1 {color:var(--directory-ink)!important;font-size:23px;line-height:1.3;font-weight:800;margin:0 0 5px}
.marketplace-directory .directory-subtitle {margin:0!important;color:var(--directory-muted)!important;font-size:13px;line-height:1.65}
.marketplace-directory .directory-toolbar {display:grid;grid-template-columns:minmax(0,1fr) minmax(108px,.65fr);gap:8px;align-items:center;margin:0 0 16px}
.marketplace-directory .directory-search {box-sizing:border-box;display:flex;align-items:center;gap:8px;min-width:0;height:46px;padding:0 12px;border:1px solid var(--directory-line);border-radius:12px;background:var(--directory-soft);color:var(--directory-muted)}
.marketplace-directory .directory-search>i {flex:none;font-size:15px}
#publicSectionScreen.marketplace-directory .directory-search input {min-width:0;width:100%;min-height:0;height:44px;padding:0;border:0;border-radius:0;outline:none!important;box-shadow:none;background:transparent!important;color:var(--directory-ink)!important;font:inherit;font-size:16px;line-height:1.4}
.marketplace-directory .directory-search:focus-within {outline:2px solid var(--directory-blue);outline-offset:1px}
#publicSectionScreen.marketplace-directory .directory-city {box-sizing:border-box;width:100%;min-width:0;height:46px;margin:0;padding:0 8px;border:1px solid var(--directory-line);border-radius:12px;background:var(--directory-paper);color:var(--directory-ink);font:inherit;font-size:16px}
.marketplace-directory :is(.parts-results-count,.directory-results-count) {margin:0 0 10px;color:var(--directory-muted)!important;font-size:12px;font-weight:600}
#publicSectionScreen.marketplace-directory :is(.parts-listing-grid,.parts-shop-grid,.section-public-cards) {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0}
#publicSectionScreen.marketplace-directory .promotion-groups {margin:0}
#publicSectionScreen.marketplace-directory .directory-empty {grid-column:1/-1;display:flex;flex-direction:column;align-items:center;gap:8px;padding:24px 16px;border:1px solid var(--directory-line);border-radius:16px;background:var(--directory-soft);text-align:center}
.marketplace-directory .directory-empty-icon {display:grid;place-items:center;width:46px;height:46px;margin-bottom:2px;border-radius:14px;background:var(--directory-paper);color:var(--directory-blue);font-size:22px;box-shadow:0 3px 12px #17385808}
#publicSectionScreen.marketplace-directory .directory-empty h2 {margin:0;color:var(--directory-ink)!important;font-size:17px;line-height:1.45}
#publicSectionScreen.marketplace-directory .directory-empty p {margin:0;max-width:32em;color:var(--directory-muted)!important;font-size:13px;line-height:1.6}
#publicSectionScreen.marketplace-directory .directory-action {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:auto;max-width:100%;margin:6px 0 0;padding:10px 16px;border:0;border-radius:11px;background:var(--directory-blue)!important;color:#fff!important;font:inherit;font-weight:700;font-size:13px;line-height:1.5;box-shadow:0 3px 8px #1263bf15;text-align:center;white-space:normal}
.marketplace-directory .directory-action>i {flex:none}
#publicSectionScreen.marketplace-directory .directory-owner {border:0;margin:16px 0 0;padding:0;display:flex;justify-content:center}
#publicSectionScreen.marketplace-directory .directory-owner[hidden] {display:none}
#publicSectionScreen.marketplace-directory :is(.parts-status,.directory-status) {padding:18px 14px;margin:0;border:1px solid var(--directory-line);border-radius:12px;background:var(--directory-soft);color:var(--directory-muted);font-size:14px;line-height:1.6}
#publicSectionScreen.marketplace-directory :is(.parts-listing-card,.parts-shop-card,.section-provider-card,.section-listing-card) {border:1px solid var(--directory-line);border-radius:14px;background:var(--directory-paper);box-shadow:0 3px 12px #17385808;min-width:0}
#publicSectionScreen.marketplace-directory :is(.parts-item-main,.section-listing-card-main) {display:grid!important;align-items:stretch;padding:0!important;gap:0;grid-template-columns:108px minmax(0,1fr);min-height:132px;min-width:0;text-align:start}
#publicSectionScreen.marketplace-directory :is(.parts-item-photo,.section-listing-card-media) {width:100%!important;height:100%;min-height:132px;margin:0!important;border-radius:0!important;background:var(--directory-soft);color:var(--directory-muted)}
#publicSectionScreen.marketplace-directory :is(.parts-item-copy,.section-listing-card-copy) {display:flex;flex-direction:column;align-items:stretch;padding:12px;gap:5px;align-self:stretch;justify-content:center;min-width:0}
#publicSectionScreen.marketplace-directory :is(.parts-item-copy>strong,.section-listing-card-copy>strong,.section-listing-card-copy h2) {font-size:15px;line-height:1.45;color:var(--directory-ink)!important;overflow-wrap:anywhere}
#publicSectionScreen.marketplace-directory :is(.parts-item-copy>small,.parts-item-copy>span,.section-listing-card-copy>small,.section-listing-card-copy>p) {font-size:12px;line-height:1.45;color:var(--directory-muted)!important;overflow-wrap:anywhere}
#publicSectionScreen.marketplace-directory :is(.parts-item-copy,.section-listing-card-copy)>.listing-promotion-badge+* {min-block-size:0;padding-right:0!important}
#publicSectionScreen.marketplace-directory :is(.parts-price,.section-listing-card-price,.parts-view-shop,.parts-view-listing,.section-listing-card-view) {color:var(--directory-blue)!important;font-size:13px;font-weight:700}
#publicSectionScreen.marketplace-directory .parts-item-copy>:is(.parts-view-shop,.parts-view-listing) {color:var(--directory-blue)!important}
#publicSectionScreen.marketplace-directory :is(.parts-favorite,.section-listing-card-favorite) {left:6px;top:6px;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important}
#publicSectionScreen.marketplace-directory :is(.parts-item-copy,.section-listing-card-copy):has(>.listing-promotion-badge) {padding-top:calc(var(--promotion-card-logo-height,40px) + 16px)}
.marketplace-directory :is(.directory-action,.parts-item-main,.section-listing-card-main):active {filter:brightness(.94)}
.marketplace-directory .directory-card-description {font-size:12px;line-height:1.5;color:var(--directory-muted)!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* Compact, in-flow ad: only eligible content is mounted by the shared service. */
.app-shell>.section-advertisements[data-directory-banner="true"] {position:relative!important;top:auto!important;translate:none!important;margin:12px 0 0;padding:0;background:transparent!important;z-index:1}
.section-advertisements[data-directory-banner="true"] .section-ad-frame {height:auto;min-height:0;max-height:none;aspect-ratio:2.8;border-radius:14px;background:var(--directory-soft)}
.section-advertisements[data-directory-banner="true"] .section-ad-copy {padding:28px 12px 10px}
.section-advertisements[data-directory-banner="true"] .section-ad-copy strong {font-size:15px}
.section-advertisements[data-directory-banner="true"] .section-ad-copy span {font-size:11px}
.section-advertisements[data-directory-banner="true"] .advertisement-label {padding:3px 7px!important;border-radius:5px;background:#10243bdb!important;color:#fff!important;font-size:10px!important;line-height:1.4;text-shadow:none!important}
/* The app intentionally keeps navigation LTR and isolates RTL copy. */
html:is([lang="ckb"],[lang="ar"],[lang="kmr"]) .marketplace-directory :is(.directory-title-copy,.directory-empty,.directory-search,.directory-city,.directory-action,.parts-item-copy,.section-listing-card-copy) {direction:rtl;text-align:right}
html:is([lang="ckb"],[lang="ar"],[lang="kmr"]) .marketplace-directory .directory-empty {text-align:center}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(>#publicSectionScreen.marketplace-directory:not([hidden])) {
 --directory-ink:var(--app-theme-directory-ink);--directory-muted:var(--app-theme-directory-muted);
 --directory-paper:var(--app-theme-directory-paper);--directory-soft:var(--app-theme-directory-soft);
 --directory-line:var(--app-theme-directory-line);--directory-blue:var(--app-theme-directory-blue);
 background:var(--directory-paper)!important
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory {background:var(--directory-paper)!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory :is(.directory-empty,.directory-search,.directory-status,.parts-status) {background:var(--directory-soft)!important;color:var(--directory-muted)!important;border-color:var(--directory-line)!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory .directory-city {background:var(--directory-paper)!important;color:var(--directory-ink)!important;border-color:var(--directory-line)!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory :is(.directory-search,.directory-city) {border-color:var(--app-theme-control-line,var(--directory-line))!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory .directory-action {background:var(--app-theme-directory-primary)!important;color:var(--app-theme-directory-primary-ink)!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory :is(.directory-heading-icon,.directory-empty-icon) {color:var(--app-theme-directory-accent)!important}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body #publicSectionScreen.marketplace-directory :is(.parts-price,.section-listing-card-price,.parts-view-shop,.parts-view-listing,.section-listing-card-view) {color:var(--app-theme-directory-accent)!important}
@media(max-width:350px) {
 #publicSectionScreen.marketplace-directory :is(.parts-item-main,.section-listing-card-main) {grid-template-columns:88px minmax(0,1fr)}
 .marketplace-directory .directory-toolbar {grid-template-columns:minmax(0,1fr) 110px;gap:6px}
 .marketplace-directory .directory-search {padding-inline:9px;gap:6px}
 #publicSectionScreen.marketplace-directory h1 {font-size:21px}
}
@media(prefers-reduced-motion:no-preference) {.marketplace-directory .directory-action {transition:background-color .15s,filter .15s}}
