/* Final customer workspace density overrides.
   Keep this file loaded after premium.css so page spacing is easy to tune. */

html body.customer-commerce .shell {
  gap: 10px !important;
}

html body.customer-commerce #dashboardView {
  gap: 10px !important;
}

html body.customer-commerce #dashboardView > .topbar {
  grid-template-columns: minmax(320px, 0.8fr) minmax(620px, auto) !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 104px !important;
  margin: 0 !important;
  padding: 12px 22px !important;
}

html body.customer-commerce #dashboardView > .topbar > div:first-child {
  display: grid !important;
  grid-template-columns: auto minmax(0, auto) !important;
  grid-template-areas:
    "logo badge"
    "logo meta" !important;
  align-items: center !important;
  align-content: center !important;
  justify-content: start !important;
  column-gap: 16px !important;
  row-gap: 4px !important;
  min-width: 0 !important;
}

html body.customer-commerce #dashboardView > .topbar .brand-eyebrow {
  grid-area: badge !important;
  width: fit-content !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

html body.customer-commerce #dashboardView > .topbar .brand-logo {
  grid-area: logo !important;
  align-self: center !important;
  height: 44px !important;
  margin: 0 !important;
}

html body.customer-commerce #customerMeta {
  grid-area: meta !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

html body.customer-commerce .customer-topbar-actions {
  grid-template-columns: auto auto auto !important;
  grid-template-areas: "balance nav logout" !important;
  align-items: center !important;
  justify-content: end !important;
  gap: 10px !important;
}

html body.customer-commerce .customer-topbar-actions .mobile-refresh-actions {
  display: none !important;
}

html body.customer-commerce .balance-pill {
  grid-area: balance !important;
  box-sizing: border-box !important;
  min-width: 112px !important;
  width: 132px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 6px 16px !important;
  align-self: stretch !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
}

html body.customer-commerce .balance-pill span {
  font-size: 11px !important;
  line-height: 1 !important;
}

html body.customer-commerce .balance-pill strong {
  font-size: 22px !important;
  line-height: 1 !important;
}

html body.customer-commerce .customer-page-nav {
  grid-area: nav !important;
  box-sizing: border-box !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 3px !important;
  align-self: stretch !important;
  align-items: center !important;
}

html body.customer-commerce .customer-page-nav button {
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
}

html body.customer-commerce #logoutButton {
  grid-area: logout !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 18px !important;
  align-self: stretch !important;
}

html body.customer-commerce #dashboardView > .grid {
  gap: 10px !important;
  margin-top: 0 !important;
}

html body.customer-commerce .customer-page-panel {
  padding: 20px 24px !important;
}

html body.customer-commerce .customer-page-panel > .topbar {
  box-sizing: content-box !important;
  align-items: center !important;
  height: 24px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #ece7df !important;
  overflow: visible !important;
}

html body.customer-commerce .customer-page-panel > .topbar > div:first-child {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
}

html body.customer-commerce .customer-page-panel > .topbar h2 {
  margin: 0 !important;
  font-size: 24px !important;
  line-height: 1.1 !important;
}

html body.customer-commerce .customer-page-panel > .topbar .muted {
  display: inline !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

html body.customer-commerce [data-customer-page-panel="products"] > .topbar .muted {
  display: none !important;
}

html body.customer-commerce .customer-page-panel > .topbar + .toolbar,
html body.customer-commerce .customer-page-panel > .topbar + .cart-list,
html body.customer-commerce .customer-page-panel > .topbar + .order-list,
html body.customer-commerce .customer-page-panel > .topbar + .log-list {
  margin-top: 12px !important;
}

html body.customer-commerce .toolbar {
  margin-bottom: 10px !important;
}

html body.customer-commerce .filter-result-count {
  margin: 8px 0 12px !important;
}

html body.customer-commerce .cart-list,
html body.customer-commerce .order-list,
html body.customer-commerce .log-list {
  gap: 10px !important;
}

@media (max-width: 1280px) {
  html body.customer-commerce #dashboardView > .topbar {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  html body.customer-commerce .customer-topbar-actions {
    grid-template-columns: auto 1fr auto !important;
    justify-content: stretch !important;
  }
}

@media (max-width: 760px) {
  html body.customer-commerce #dashboardView > .topbar {
    padding: 12px !important;
  }

  html body.customer-commerce #dashboardView > .topbar > div:first-child {
    grid-template-columns: auto 1fr !important;
  }

  html body.customer-commerce .customer-topbar-actions {
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "balance logout"
      "nav nav" !important;
  }

  html body.customer-commerce .customer-page-panel {
    padding: 16px 14px !important;
  }

  html body.customer-commerce .customer-page-panel > .topbar h2 {
    font-size: 21px !important;
  }
}

/* Final page-title density: title metadata stays on the same line. */
html body.customer-commerce .customer-page-panel > div.topbar > div:first-child {
  display: inline-flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  gap: 10px !important;
  height: 24px !important;
}

html body.customer-commerce .customer-page-panel > div.topbar > div:first-child > h2 {
  display: inline !important;
  flex: 0 0 auto !important;
  font-size: 22px !important;
  line-height: 1.08 !important;
  height: 24px !important;
}

html body.customer-commerce .customer-page-panel > div.topbar > div:first-child > p.muted {
  display: inline !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

html body.customer-commerce [data-customer-page-panel="products"] > div.topbar > div:first-child > p.muted,
html body.customer-commerce #productCountText {
  display: none !important;
}

/* Product meta should read as plain text, not as a pill card. */
html body.customer-commerce .product-meta-line {
  display: block !important;
  width: auto !important;
  margin: 8px 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #0f766e !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

/* Product filter bar: denser single-row controls with visible sorting. */
html body.customer-commerce [data-customer-page-panel="products"] > .toolbar {
  display: grid !important;
  grid-template-columns: minmax(320px, 1fr) 170px 170px 170px 68px !important;
  gap: 8px !important;
  align-items: center !important;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
  padding: 7px 10px !important;
  min-height: 0 !important;
}

html body.customer-commerce [data-customer-page-panel="products"] > .toolbar:has(#productSortInput),
html body.customer-commerce [data-customer-page-panel="products"] > .toolbar:has(#productSortInput.hidden) {
  grid-template-columns: minmax(320px, 1fr) 170px 170px 170px 68px !important;
}

html body.customer-commerce #productSortInput,
html body.customer-commerce #productSortInput.hidden {
  display: block !important;
  visibility: visible !important;
}

html body.customer-commerce [data-customer-page-panel="products"] > .toolbar > input,
html body.customer-commerce [data-customer-page-panel="products"] > .toolbar > select,
html body.customer-commerce [data-customer-page-panel="products"] > .toolbar > button {
  box-sizing: border-box !important;
  height: 40px !important;
  min-height: 40px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

html body.customer-commerce [data-customer-page-panel="products"] > .toolbar > button {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

@media (max-width: 980px) {
  html body.customer-commerce [data-customer-page-panel="products"] > .toolbar {
    grid-template-columns: 1fr 1fr !important;
  }

  html body.customer-commerce [data-customer-page-panel="products"] > .toolbar > input {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 981px) {
  html body.customer-commerce #keywordInput {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  html body.customer-commerce #brandFilterInput {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
  }

  html body.customer-commerce #categoryFilterInput {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
  }

  html body.customer-commerce #productSortInput {
    grid-column: 4 / 5 !important;
    grid-row: 1 !important;
  }

  html body.customer-commerce #clearCatalogFiltersButton {
    grid-column: 5 / 6 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-width: 0 !important;
  }
}
