@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;700&display=swap");
:root{--ink:#1e293b;--muted:#64748b;--green:#2563eb;--line:#e2e8f0;--paper:#f8fafc;--warm:#f1f5f9;--orange:#d4a017}*{box-sizing:border-box}body{margin:0;color:var(--ink);font:14px 'Tajawal',Tahoma,Arial,sans-serif;background:var(--paper)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}a{color:inherit;text-decoration:none}aside{width:242px;background:#0f172a;color:#d8e8df;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:31px 19px;z-index:3}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:600;letter-spacing:-.5px;margin:0 9px 47px}.brandmark{font-family:Tahoma;font-size:34px;background:#cedcba;color:#214b38;width:43px;height:48px;display:grid;place-items:center;border-radius:13px}.brand small{display:block;font-size:8px;letter-spacing:2px;color:#8bac98;margin-top:7px}.nav-label{font-size:10px;letter-spacing:2px;color:#85a591;margin:0 17px 14px}nav{display:grid;gap:7px}nav button{border:0;color:#b9d0c3;background:none;padding:14px 17px;display:flex;gap:14px;align-items:center;text-align:left;border-radius:8px;font-size:18px}nav span{font-size:14px}nav button.active{background:#2563eb;color:#fff}nav b{margin-left:auto;font-size:10px;padding:3px 6px;border-radius:4px;background:#4d715c}nav button:hover{background:#1e3a8a}.sidebar-bottom{margin-top:auto;padding:18px 9px 0}.local-dot{font-size:11px;color:#b6ceb9}.local-dot:before{content:'';display:inline-block;width:6px;height:6px;border-radius:100%;background:#a6cc8c;margin-right:8px}.settings-link{color:#d3e3d7;border:0;background:none;padding:20px 0 15px;font-size:12px}.sidebar-note{font-size:10px;color:#83a68f}main{margin-left:242px;min-height:100vh}header{height:78px;border-bottom:1px solid var(--line);padding:0 40px;display:flex;align-items:center;justify-content:space-between;background:#fbfcf8}.crumb{font-size:12px;color:var(--muted)}.crumb span{margin:0 13px;color:#bdc8bd}.crumb strong{font-weight:500;color:var(--ink)}.header-right{display:flex;gap:16px;align-items:center}.mode-chip{background:#edf3e8;color:#3c6e46;border:1px solid #d8e3d0;border-radius:20px;padding:7px 13px;font-size:11px}.avatar{width:32px;height:32px;background:#e7e4d9;border-radius:50%;display:grid;place-items:center;font-size:11px}.icon-btn{background:none;border:0;font-size:22px;color:#577266}.practice-banner{padding:11px 40px;font-size:11px;color:#63775a;background:#edf1e5;border-bottom:1px solid #e1e8d7}.practice-banner.live{background:#e6f0f6;color:#345d78}#page{padding:35px 40px 20px;min-height:calc(100vh - 172px)}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px;gap:16px}.eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:10px;color:#839079;margin-bottom:9px}h1{font-size:32px;letter-spacing:-1.2px;font-weight:500;margin:0 0 8px}h2{font-size:23px;letter-spacing:-.5px;font-weight:500;margin:0 0 7px}h3{font-size:15px;font-weight:600;margin:0 0 12px}.subtitle{color:var(--muted);font-size:12px;margin:0;line-height:1.7}.primary,.secondary,.danger{border-radius:6px;padding:11px 17px;font-size:12px;border:1px solid var(--green)}.primary{color:#fff;background:var(--green)}.primary:hover{background:#1e513f}.secondary{background:white;color:var(--ink);border-color:var(--line)}.actions{display:flex;gap:9px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:0 0 30px}.stat{border:1px solid var(--line);background:#fcfdf9;border-radius:9px;padding:20px 20px 18px}.stat-label{font-size:11px;color:var(--muted);display:flex;justify-content:space-between}.stat-value{font-size:28px;font-weight:500;margin:13px 0 8px;letter-spacing:-1px}.stat-note{font-size:10px;color:#8a9485}.stat:first-child{background:#e9eee1;border-color:#dce4d1}.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:23px}.search{position:relative;flex:1;min-width:200px;max-width:420px}.search:before{content:'⌕';position:absolute;left:14px;top:8px;font-size:22px;color:#8c9a8b}.search input{width:100%;padding:12px 13px 12px 40px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{outline:2px solid #a8c7a1;outline-offset:1px}.filters{display:flex;gap:5px;margin-left:auto}.filter{font-size:11px;padding:10px 13px;border:1px solid transparent;background:none;color:#83907c;border-radius:6px}.filter.active{background:#fff;border-color:var(--line);color:var(--green)}.toolbar select{padding:10px 12px;background:#fff;border:1px solid var(--line);border-radius:6px;color:var(--ink);font-size:11px}.result-caption{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:11px;margin:0 0 16px}.grid,:where(#storeProducts){display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:19px}.product{overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;transition:transform .15s,box-shadow .15s;text-align:left;padding:0;color:var(--ink)}.product:hover{transform:translateY(-3px);box-shadow:0 8px 25px #214d3510}.product-media{height:235px;background:#ecece3;position:relative;overflow:hidden;display:grid;place-items:center}.product img{width:100%;height:100%;object-fit:contain;background:#efeee8}.placeholder{display:flex;flex-direction:column;gap:11px;align-items:center;color:#a8ae9b;font-size:11px}.placeholder .dress{font-size:52px;line-height:1}.product-badge{position:absolute;left:11px;top:11px;background:#fffffff0;border-radius:4px;padding:5px 8px;font-size:9px;letter-spacing:.4px}.product-badge.out{color:#a05d43}.product-info{padding:15px 15px 16px}.product-topline{font-size:10px;color:#89927e;margin-bottom:7px;display:flex;justify-content:space-between}.product-name{font-size:13px;margin:0 0 14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;min-height:20px}.product-price-row{display:flex;justify-content:space-between;align-items:center}.price{font-size:15px;font-weight:600}.price small{font-weight:400;color:var(--muted);font-size:9px;margin-left:4px}.stock{font-size:10px;color:#6c885f}.stock.zero{color:#ac6d50}.pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin:28px 0 15px;font-size:11px;color:var(--muted)}.pagination button{border:1px solid var(--line);border-radius:5px;padding:8px 15px;background:white;color:var(--ink)}footer{margin:15px 40px 0;padding:20px 0;border-top:1px solid var(--line);font-size:10px;color:#8b9884;display:flex;justify-content:space-between}.table-wrap{background:white;border:1px solid var(--line);border-radius:9px;overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}th{font-size:10px;font-weight:500;text-transform:uppercase;letter-spacing:.6px;background:#f0f3eb;color:#7b8b72;padding:14px 17px;white-space:nowrap}td{padding:15px 17px;border-top:1px solid #eef1e8;max-width:260px;overflow:hidden;text-overflow:ellipsis}tbody tr:hover{background:#fafbf6;cursor:pointer}.badge{display:inline-block;border-radius:5px;padding:5px 8px;font-size:10px;background:#edf1e7;color:#5a7850}.badge.delivered,.badge.paid{background:#e4f1e8;color:#34744f}.badge.cancelled,.badge.return,.badge.returned{background:#f5e7df;color:#a36b48}.badge.unpaid{background:#f7efdb;color:#9e813b}.empty{padding:65px 20px;text-align:center;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:14px;padding:0;width:min(800px,calc(100vw - 32px));max-height:90vh;color:var(--ink);box-shadow:0 30px 90px #173d3430}dialog::backdrop{background:#17382f75;backdrop-filter:blur(3px)}.modal-head{padding:25px 28px 19px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:20px}.close{border:0;background:none;font-size:26px;color:var(--muted);align-self:start}.modal-content{padding:23px 28px;overflow:auto;max-height:65vh}.modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:17px 28px;border-top:1px solid var(--line);background:#f9faf5}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px}label{font-size:11px;color:#6e8164;display:block}label input,label select,label textarea{display:block;margin-top:7px;width:100%;border:1px solid var(--line);border-radius:6px;padding:11px 12px;color:var(--ink);background:#fff}label textarea{min-height:78px;resize:vertical}.wide{grid-column:1/-1}.note{font-size:11px;line-height:1.7;color:var(--muted);background:#eff3e9;padding:13px 15px;border-radius:6px;margin:0 0 20px}.error{font-size:12px;color:#a14831;margin-top:12px;line-height:1.6}.detail-grid{display:grid;grid-template-columns:240px 1fr;gap:25px}.detail-image{width:240px;height:310px;object-fit:contain;background:#eeeee5;border-radius:8px}.check{display:flex;gap:10px;align-items:center}.check input{width:auto;margin:0}.separator{border:0;border-top:1px solid var(--line);margin:25px 0}.order-line{display:grid;grid-template-columns:1fr 75px 90px 30px;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);font-size:12px}.order-line input{width:75px;padding:8px;border:1px solid var(--line);border-radius:5px}.order-total{display:flex;justify-content:space-between;font-size:18px;padding:24px 0}.bar-row{display:grid;grid-template-columns:120px 1fr 50px;gap:15px;align-items:center;margin:18px 0;font-size:12px}.bar{height:9px;background:#eaf0e1;border-radius:8px;overflow:hidden}.bar-fill{height:100%;background:#6a906b;border-radius:8px}.two-col{display:grid;grid-template-columns:1.1fr 1fr;gap:23px}.panel{background:#fff;border:1px solid var(--line);padding:25px;border-radius:10px}.little{font-size:10px;color:var(--muted)}#toast{position:fixed;right:28px;bottom:25px;background:#234f3d;color:white;padding:14px 22px;border-radius:8px;box-shadow:0 8px 30px #173a3420;display:none;z-index:10;max-width:420px}.loading{padding:80px;text-align:center;color:var(--muted)}.split-note{display:flex;justify-content:space-between;align-items:center;gap:10px}.money{text-align:right;white-space:nowrap}@media(min-width:1600px){.grid,:where(#storeProducts){grid-template-columns:repeat(5,minmax(0,1fr))}.product-media{height:270px}}@media(max-width:1200px){.grid,:where(#storeProducts){grid-template-columns:repeat(3,minmax(0,1fr))}aside{width:210px}main{margin-left:210px}header{padding:0 25px}#page{padding:28px 25px}.stats{gap:10px}.stat{padding:17px 15px}.product-media{height:230px}.filters{margin-left:0}.two-col{grid-template-columns:1fr}}@media(max-width:800px){aside{width:72px;padding:24px 8px}.brand{margin:0 auto 35px;justify-content:center}.brand>div,.nav-label,nav span,nav b,.sidebar-bottom{display:none}nav button{justify-content:center;padding:15px 0}main{margin-left:72px}.grid,:where(#storeProducts){grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.stats{grid-template-columns:1fr 1fr}header{padding:0 18px;height:65px}.crumb{display:none}.header-right{width:100%;justify-content:flex-end}.practice-banner{padding:10px 18px}#page{padding:24px 17px}.page-heading{align-items:start}h1{font-size:28px}.actions{flex-direction:column}.product-media{height:220px}.filters{flex-wrap:wrap}.filter{padding:9px}.detail-grid{grid-template-columns:1fr}.detail-image{width:100%;height:230px}.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.modal-content{padding:20px}.modal-head,.modal-actions{padding:18px 20px}footer{margin:15px 17px}footer span{display:none}.product-price-row{align-items:start;gap:8px;flex-direction:column}.order-line{grid-template-columns:1fr 55px 75px 25px}.order-line input{width:55px}.product-info{padding:12px}.search{max-width:none}.toolbar select{max-width:180px}}

nav button{justify-content:center;text-align:center}nav span{display:flex;flex:1;flex-direction:column;align-items:center;text-align:center;line-height:1.15}nav span strong{font-size:15px;font-weight:700;direction:rtl}nav span small{font-size:11px;margin-top:3px;color:inherit}.bi-label{display:inline-flex;flex-direction:column;line-height:1.15}.bi-label .ar{font-size:1.08em;font-weight:700;direction:rtl}.bi-label .en{font-size:.88em;font-weight:500}.danger{background:#003b5c;color:#fff;border-color:#003b5c;font-weight:700;padding:5px 9px;font-size:10px;line-height:1.15;border-radius:5px;white-space:nowrap}.danger:hover{background:#002b45;border-color:#002b45}.danger .bi-label .en{font-weight:700}.customer-link{color:#2563eb;text-decoration:underline}

/* Public Marketplace */
.storefront [hidden]{display:none!important}
.storefront header{gap:16px;padding-inline:clamp(16px,5vw,48px)}
.storefront header img{display:block;border-radius:6px}
/* Match Inventory's usable width while centering the storefront without its sidebar. */
.storefront main{margin:0 auto;width:calc(100% - 242px);padding:24px 40px 56px;min-height:auto}
@media(max-width:1200px){.storefront main{width:calc(100% - 210px);padding-inline:25px}}
@media(max-width:800px){.storefront main{width:calc(100% - 72px);padding-inline:17px}}
.storefront #storeStatus{overflow-wrap:anywhere}
.storefront .store-product{min-width:0;overflow:hidden;cursor:default;display:flex;flex-direction:column}
.product-media > .product-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center;background:#efeee8}
.store-no-photo{color:#475569;text-align:center;padding:12px}
.store-instagram{position:absolute;inset:auto 10px 10px auto;background:#fff;color:#172554;border:1px solid #cbd5e1;border-radius:6px;padding:6px 10px;font-weight:700}
.store-instagram:hover{text-decoration:underline}
.store-product-info{display:flex;flex-direction:column;flex:1}
.store-product-info p{margin:0;overflow-wrap:anywhere}
.store-product-info > :not(h2) + *{margin-block-start:8px}
.store-description{white-space:pre-wrap;color:#475569;flex:1}
.store-price{font-weight:700}
.store-purchase{background:#15803d;color:#fff;border:1px solid #15803d;border-radius:7px;padding:10px 14px;font-weight:700}
.store-purchase:hover:not(:disabled){background:#166534}
.store-stock,.store-note{color:#475569}
.storefront dialog{padding:20px;width:min(540px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto}
.storefront #purchaseTotal{display:block;padding:8px 0;font-weight:700}
@media(max-width:540px){.storefront .form-grid{grid-template-columns:1fr}}

/* OnlineMarket typography and surfaces */
:root {
  --ink: #243447;
  --muted: #4b5d70;
  --line: #d6dee6;
  --paper: #f4f6f8;
  --table-heading: #e7edf3;
  --table-stripe: #f7f9fb;
  --selection: #dceaf7;
  --ui-font: Calibri, "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

body { font: 400 16px/1.5 var(--ui-font); }
h1 { font-size: 28px; }
h2, h3 { font-size: 20px; }
h1, h2, h3 { font-weight: 700; letter-spacing: normal; line-height: 1.3; }
/* Inventory, Marketplace listings, and the public purchase cards. */
.product-name,
.store-product-info > :is(h2, h3, .listing-title),
.product[data-listing] > .product-media + * > :first-child,
.grid > .product > .product-media + * > :is(strong, b, h2, h3, .listing-title):first-child {
  display: block;
  inline-size: 100%;
  margin: 0 0 14px;
  min-height: 20px;
  font: 700 16px/1.5 var(--ui-font);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.store-product-info,
.product[data-listing] > .product-media + div { padding: 15px 15px 16px; }
.product[data-listing] > .product-media + div[style] { padding: 15px 15px 16px !important; }
.product[data-listing] > .product-media + div > p { margin: 0; }
@media (max-width: 800px) {
  .store-product-info { padding: 12px; }
  .product[data-listing] > .product-media + div[style] { padding: 12px !important; }
}

header, dialog, .modal-actions { background: #fff; }
label, .subtitle, .order-line, table { font-size: 16px; }
label { color: var(--ink); }
button.primary, button.secondary, .toolbar select, .filter { font-size: 16px; }
.badge, .result-caption, .note, .error { font-size: 14px; }

th {
  text-align: center;
  vertical-align: middle;
  background: var(--table-heading);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
table tr > :not(:last-child) { border-inline-end: 1px solid #e7edf2; }
table tbody tr + tr > *,
table thead + tbody tr:first-child > * { border-top: 1px solid #e7edf2; }
tbody tr:nth-child(even) { background: var(--table-stripe); }
tbody tr:hover,
tbody tr:focus-within,
tbody tr[aria-selected="true"],
tbody tr[aria-current="true"] { background: var(--selection); }

aside { overflow-y: auto; }
nav button { min-height: 52px; padding: 8px 12px; }
nav span { line-height: 1.25; }
nav span strong { font-size: 18px; font-weight: 700; }
nav span small { font-size: 15px; font-weight: 400; }
.settings-link { font-size: 15px; }

@media (max-width: 800px) {
  body > aside { width: 108px; }
  body > aside + main { margin-left: 108px; }
  nav button { flex-direction: column; gap: 2px; padding: 6px 2px; }
  nav span strong { font-size: 16px; }
  nav span small { font-size: 13px; }
  .header-right { flex-wrap: wrap; }
  body > aside + main > header { height: auto; min-height: 65px; padding: 8px 12px; }
  #page { padding-inline: 12px; }
  h1 { font-size: 24px; }
}



/* Center the bilingual Marketplace heading on the management page and storefront. */
#page:has(#newListing, .product[data-listing]) > .page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  text-align: center;
}
#page:has(#newListing, .product[data-listing]) > .page-heading > .actions {
  justify-self: end;
  flex-wrap: wrap;
}
#page:has(#newListing, .product[data-listing]) > .page-heading h1,
.storefront h1 {
  text-align: center;
  line-height: 1.15;
}
#page:has(#newListing, .product[data-listing]) > .page-heading h1::before {
  content: "السوق الإلكتروني";
  display: block;
  direction: rtl;
  margin-bottom: 4px;
}
.storefront header:has(h1) { position: relative; }
@media (min-width: 801px) {
  .storefront header h1 {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
}
@media (max-width: 800px) {
  .storefront header:has(h1) {
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    min-height: 65px;
    padding-block: 10px;
  }
}

/* Public Marketplace product rail */
.storefront { background: #f3f3f9; }
.storefront main { width: 100%; padding: 22px clamp(12px, 3vw, 48px) 48px; }
.storefront #storeProducts {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: calc(100% / 6);
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
}
.storefront #storeProducts > .store-product {
  border: 1px solid #e7e7ef;
  border-radius: 0;
  padding: 16px;
  scroll-snap-align: start;
}
.storefront #storeProducts > .store-product:hover { transform: none; box-shadow: none; }
.storefront #storeProducts .product-media {
  height: auto;
  aspect-ratio: 1;
  background: #fff;
}
.storefront #storeProducts .product-media img { object-fit: contain; background: #fff; }
.storefront #storeProducts .store-product-info { padding: 15px 0 0; text-align: center; }
.storefront #storeProducts .store-product-info > :is(h2,h3,.listing-title) {
  font-weight: 400;
  margin-block-end: 10px;
}
.storefront #storeProducts .store-price { color: #1717cf; font-weight: 700; }
@media(max-width:1100px){.storefront #storeProducts{grid-auto-columns:25%}}
@media(max-width:760px){.storefront #storeProducts{grid-auto-columns:calc(100% / 3)}}
@media(max-width:520px){
  .storefront #storeProducts{grid-auto-columns:50%}
  .storefront #storeProducts > .store-product{padding:10px}
}

/* Public marketplace gallery */
@font-face {
  font-family: "IEM Gallery Aligarh";
  src: url("/marketplace-aligarh.otf?v=medium") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
html body.storefront {
  --gallery-blue: #17458a;
  --gallery-sage: #edf5ee;
  --gallery-blush: #ffffff;
  --gallery-details: #ffffff;
  --gallery-type: "IEM Gallery Aligarh", Calibri, Arial, sans-serif;
  background: var(--gallery-sage);
}
body.storefront main > h1,
body.storefront :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-price {
  color: var(--gallery-blue);
  font-family: var(--gallery-type);
  font-weight: 700;
}
body.storefront main > h1 { font-size: clamp(20px, 3.4vw, 31px); }
body.storefront :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-price { font-size: 11px; }
body.storefront main .store-product .store-product-info {
  background: var(--gallery-details);
  color: var(--gallery-blue);
  font: 500 11px/1.55 var(--gallery-type);
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-product-info > h2 {
  color: inherit;
  font: 700 12px/1.45 var(--gallery-type);
}
body.storefront .store-product-info :is(.public-company-link,.store-description,.store-stock) {
  color: var(--gallery-blue);
  font: 500 11px/1.55 var(--gallery-type);
}
body.storefront main .store-product .store-product-info .store-view-product {
  font-family: var(--gallery-type);
}
body.storefront main .store-product .product-media {
  isolation: isolate;
  background: #e4efe5;
}
body.storefront main .store-product .product-media .product-photo {
  position: absolute;
  inset: 7% 22%;
  width: 56%;
  height: 86%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
html[lang="ar"] body.storefront { --gallery-details: #ffffff; }
body.storefront main :is(#storeProducts,.home-results,.store-collection-products) .store-product .store-product-info .store-view-product {
  background: #dfefdf;
  border-color: #c7dfc9;
  color: #111;
  font: 700 11px/1.3 var(--gallery-type);
}
body.storefront main :is(#storeProducts,.home-results,.store-collection-products) .store-product .store-product-info .store-view-product:hover {
  background: #d1e7d3;
}

/* Keep Arabic text RTL while laying out gallery cards from the left. */
html[lang="ar"] body.storefront {
  font-family: var(--gallery-type);
}
html[lang="ar"] body.storefront main > h1 {
  font-family: var(--gallery-type);
  font-weight: 700;
  color: var(--gallery-blue);
}
html[lang="ar"] body.storefront :is(#storeProducts,.store-collection-products,.home-results .grid) {
  direction: ltr;
}
html[lang="ar"] body.storefront .store-product-info {
  direction: rtl;
}


/* Compact cards for the public marketplace, collections, and search results. */
body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid) {
  grid-template-columns: repeat(auto-fill, minmax(0, 250px));
  justify-content: center;
  gap: 10px;
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .product-media {
  height: auto;
  aspect-ratio: 250 / 194;
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-product-info {
  padding: 4px 4px 3px;
  gap: 2px;
  text-align: center;
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-product-info > * {
  margin: 0;
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-product-info > h2 {
  min-height: 0;
  font: 700 11px/1.3 var(--gallery-type);
}
body.storefront main .store-product .store-product-info :is(.public-company-link,.store-description,.store-stock) {
  font: 500 10px/1.3 var(--gallery-type);
}
body.storefront main .store-product .store-product-info .public-company-logo {
  height: 16px;
  max-width: 24px;
}
body.storefront main .store-product .store-description:empty {
  display: none;
}
body.storefront main .store-product .store-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-card-actions .store-view-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 20px;
  margin: 0;
  padding: 0 5px;
  font: 700 10px/1.2 var(--gallery-type);
}
@media (max-width: 550px) {
  body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid) {
    grid-template-columns: repeat(2, minmax(0, 250px));
    gap: 8px;
  }
  body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-card-actions .store-view-product {
    min-height: 26px;
  }
}
@media (max-width: 350px) {
  body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid) {
    grid-template-columns: minmax(0, 250px);
  }
}

/* Keep the public navigation and catalogue close together. */
html body.storefront .home-menu {
  align-items: center;
  gap: 4px;
  padding-block: 3px;
}
html body.storefront .home-menu :is(a,button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 22px;
  inline-size: auto;
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}
html body.storefront .home-menu :is(a,button):hover,
html body.storefront .home-menu [aria-current] {
  background: #ccdfd0;
}
html body.storefront .home-menu button:focus-visible {
  outline: 2px solid #36584b;
  outline-offset: 2px;
}
html body.storefront main {
  padding-block-start: 8px;
}
body.storefront #storeStatus:empty {
  display: none;
}
html body.storefront main .store-collection {
  margin-block-start: 0;
}
html body.storefront main .store-collection .product-back {
  margin-block-end: 5px;
  padding: 3px 7px;
  font-size: 12px;
}
html body.storefront main .store-collection > h2 {
  margin-block-end: 5px;
  font-size: 17px;
}
html body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid) {
  gap: 8px;
  justify-content: start;
}
html body.storefront main .store-product .store-instagram {
  inset: auto 5px 5px auto;
  padding: 2px 4px;
  border-radius: 4px;
  font: 700 9px/1.2 var(--gallery-type);
}

/* Gold actions in Inventory, Customers, Orders, and their entry forms. */
.staff-workspace {
  --action-gold-fill: #fff4d6;
  --action-gold-hover: #ffedbe;
  --action-gold-border: #d8c6a0;
  --action-gold-ink: #003b5c;
}

#page:is([data-compact-view="inventory"], [data-compact-view="customers"])
  :is(.page-heading, .toolbar, #results)
  :is(button, input[type="button"], input[type="submit"], a.btn, a.button, a[role="button"]):not(.inventory-card-preview),
#page[data-compact-view="orders"] .page-heading :is(#newOrder, #newExpense, #employeeExpenses),
#dialogBody:has(:is(#orderForm, #savedOrderForm, #receiptSettingsForm, #connectionForm, #listingForm, .listing-preview, #productForm, #exchangeRateForm, #clientForm, #customerForm, #expenseForm, #payrollClient, #addPayrollEmployee, #recordEmployeePayroll))
  :is(.modal-actions > button, .modal-content button:is(.primary, .secondary, .danger)) {
  background: var(--action-gold-fill);
  border: 1px solid var(--action-gold-border);
  color: var(--action-gold-ink);
  border-radius: 6px;
}

#page:is([data-compact-view="inventory"], [data-compact-view="customers"])
  :is(.page-heading, .toolbar, #results)
  :is(button, input[type="button"], input[type="submit"], a.btn, a.button, a[role="button"]):not(.inventory-card-preview):is(:hover, .active):not(:disabled),
#page[data-compact-view="orders"] .page-heading :is(#newOrder, #newExpense, #employeeExpenses):hover:not(:disabled),
#dialogBody:has(:is(#orderForm, #savedOrderForm, #receiptSettingsForm, #connectionForm, #listingForm, .listing-preview, #productForm, #exchangeRateForm, #clientForm, #customerForm, #expenseForm, #payrollClient, #addPayrollEmployee, #recordEmployeePayroll))
  :is(.modal-actions > button, .modal-content button:is(.primary, .secondary, .danger)):hover:not(:disabled) {
  background: var(--action-gold-hover);
}

#dialogBody:has(:is(#orderForm, #savedOrderForm, #receiptSettingsForm, #connectionForm, #listingForm, .listing-preview, #productForm, #exchangeRateForm, #clientForm, #customerForm, #expenseForm, #payrollClient, #addPayrollEmployee, #recordEmployeePayroll))
  :is(.modal-actions > button, .modal-content button:is(.primary, .secondary, .danger)) {
  box-sizing: border-box;
  inline-size: min(100%, 160px);
  min-block-size: 34px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.15;
  flex-shrink: 0;
}

#dialogBody:has(:is(#orderForm, #savedOrderForm, #receiptSettingsForm, #connectionForm, #listingForm, .listing-preview, #productForm, #exchangeRateForm, #clientForm, #customerForm, #expenseForm, #payrollClient, #addPayrollEmployee, #recordEmployeePayroll)) .modal-actions {
  flex-wrap: wrap;
}

#dialogBody:has(#orderForm) #entrySaveCustomer {
  align-self: end;
}

#dialogBody label:has(> input[name="DeliveryFee"]) .bi-label > .ar {
  font-weight: 400;
}

/* Language selector on workspace pages and forms. */
.staff-workspace .workspace-language {
  background: var(--action-gold-fill);
  border-color: var(--action-gold-border);
}
.staff-workspace .workspace-language > button {
  background: var(--action-gold-fill);
}
.staff-workspace .workspace-language > button[aria-pressed="true"] {
  background: #efdb9f;
  box-shadow: inset 0 0 0 1px var(--action-gold-border);
}

/* Customer filters follow the existing ivory and champagne controls. */
.customer-filter-panel {display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin:0 0 12px;padding:10px;border:0.5px solid #d8c6a0;border-radius:6px;background:#fffdf8}
.customer-filter-panel[hidden] {display:none}
.customer-filter-panel label {flex:1 1 180px;max-width:300px;margin:0}
.customer-filter-panel select {width:100%;margin-top:4px;padding:6px 9px;border:0.5px solid #d8c6a0;border-radius:5px;background:#fffdf8;font:inherit;min-height:32px}
.customer-filter-panel button {min-height:32px}
#customerFilterToggle[aria-expanded="true"] {border-color:#b99b60;background:#faf6ed}
@media(max-width:600px) {.customer-filter-panel label {max-width:none}}

/* Plain Open Market cards: normal text, white details, no floral decoration. */
body.storefront, body.storefront * { font-weight:400 !important; }
body.storefront main .store-product .store-product-info { background:transparent !important; }

/* Approved compact card layout: shared sage background and economical footer. */
html body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid) {
 grid-template-columns:repeat(auto-fill,minmax(0,210px));justify-content:center;gap:8px;align-items:start;
}
html body.storefront main .store-product {background:var(--gallery-sage);}
html body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .product-media {
 height:176px;aspect-ratio:auto;background:transparent;
}
html body.storefront main .store-product .product-media .product-photo {
 inset:4px 10%;width:80%;height:168px;object-fit:contain;
}
html body.storefront main .store-product .store-instagram {
 inset:auto 10% 5px auto;background:transparent;border:0;padding:1px 2px;
 color:#17458a;text-shadow:0 0 2px #fff,0 0 3px #fff;
}
html body.storefront main :is(#storeProducts,.store-collection-products,.home-results) .store-product .store-product-info {
 padding:2px 4px 4px;gap:2px;flex:0 0 auto;background:transparent;
}
html body.storefront main .store-product .store-product-info > * {margin:0;}
html body.storefront main .store-product .store-product-info > h2 {line-height:1.25;}
html body.storefront main .store-product .store-product-info .public-company-link {justify-content:center;gap:3px;line-height:1.25;}
html body.storefront main .store-product .store-card-footer {display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px 8px;}
html body.storefront main .store-product .store-card-footer > * {margin:0;}
html body.storefront main .store-product .store-card-footer .store-card-actions {gap:4px;margin:0;}
html body.storefront main .store-product .store-card-footer .store-view-product {
 min-height:20px;margin:0;padding:1px 5px;background:#dfefdf;border:1px solid #c2dac4;color:#003b5c;font-size:10px;line-height:1.2;
}
html body.storefront main .store-collection > h2 {margin-bottom:8px;}
@media(max-width:550px){html body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid){grid-template-columns:repeat(2,minmax(0,210px));}}
@media(max-width:350px){html body.storefront main :is(#storeProducts,.store-collection-products,.home-results .grid){grid-template-columns:minmax(0,210px);}}

/* Open Market brand, seller attribution, and gallery navigation. */
html body.storefront header .home-brand img {
  width: clamp(126px, 18vw, 226px);
  height: auto;
  max-height: 56px;
  object-fit: contain;
}
html body.storefront {
  --market-menu-font: 700 12px/16px var(--gallery-type);
}
html body.storefront .home-menu :is(a, button),
html body.storefront main .store-collection .product-back {
  font: var(--market-menu-font);
  font-weight: 700 !important;
}
html body.storefront main :is(#storeProducts, #storeCollectionProducts) {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: min(100%, 314px);
  direction: ltr;
  justify-content: safe center;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
}
html body.storefront main :is(#storeProducts, #storeCollectionProducts) > .store-product {
  scroll-snap-align: start;
}
html body.storefront main :is(#storeProducts, #storeCollectionProducts) .store-product .product-media {
  height: 260px;
}
html body.storefront main :is(#storeProducts, #storeCollectionProducts) .store-product .product-photo {
  inset-inline: 2%;
  width: 96%;
  height: 252px;
}
html body.storefront main .store-product .store-seller {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: 500 12px/1.25 var(--gallery-type);
  color: #31594e;
}
html body.storefront main .store-product .store-seller .public-company-link {
  font: inherit;
  gap: 5px;
}
html body.storefront main .store-product .store-seller .public-company-logo {
  box-sizing: border-box;
  width: 27px;
  height: 27px;
  padding: 3px;
  border: 1px solid #b5a067;
  border-radius: 50%;
  background: #163651;
}
html body.storefront main .gallery-controls {
  display: flex;
  justify-content: flex-start;
  gap: 7px;
  margin-block: 0 6px;
}
html body.storefront main :is(.gallery-controls[hidden], .gallery-controls:has(+ [hidden])),
html body.storefront:is(.home-search-active, [data-home-section="home"], [data-home-section="shops"], [data-home-section="sellers"]) main .gallery-controls:has(+ #storeProducts) {
  display: none;
}
html body.storefront main .store-collection:has(> #storeCollectionProducts) {
  position: relative;
}
html body.storefront main .store-collection:has(> #storeCollectionProducts) > .gallery-controls {
  position: absolute;
  top: 0;
  left: 0;
}
html body.storefront main .store-collection:has(> #storeCollectionProducts) > h2 {
  min-height: 21px;
}
html body.storefront main .store-collection:has(> #storeCollectionProducts) > .product-back,
html body.storefront main .store-collection:has(> #storeCollectionProducts) > h2 {
  margin-left: 103px;
}
html body.storefront main .gallery-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #a6bfb1;
  border-radius: 10px;
  background: #fff;
  color: #173d3e;
}
html body.storefront main .gallery-controls button:hover:not(:disabled) {
  background: #e1ebe5;
}
html body.storefront main .gallery-controls button:focus-visible {
  outline: 2px solid #36584b;
  outline-offset: -4px;
}
html body.storefront main .gallery-controls button span {
  width: 12px;
  height: 12px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: translateX(-2px) rotate(45deg);
}
html body.storefront main .gallery-controls button[data-gallery-direction="left"] span {
  transform: translateX(2px) rotate(-135deg);
}
