/**
 * Bridges the GH BundleMall plugin SPA shell with Sneat theme tokens.
 */
body.ghbm-app-page {
  margin: 0 !important;
  padding: 0 !important;
  background: #f5f5f9 !important;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

body.ghbm-app-page #page,
body.ghbm-app-page .site,
body.ghbm-app-page .site-content,
body.ghbm-app-page #content,
body.ghbm-app-page #primary,
body.ghbm-app-page .site-main,
body.ghbm-app-page main,
body.ghbm-app-page .ghbm-app-root,
body.ghbm-app-page .hentry,
body.ghbm-app-page .entry-content,
body.ghbm-app-page .entry-header,
body.ghbm-app-page article,
body.ghbm-app-page .page-content,
body.pds-dashboard-page #page,
body.pds-dashboard-page .site,
body.pds-dashboard-page .site-content,
body.pds-dashboard-page #content,
body.pds-dashboard-page #primary,
body.pds-dashboard-page .site-main,
body.pds-dashboard-page main,
body.pds-dashboard-page .ghbm-app-root,
body.pds-dashboard-page .hentry,
body.pds-dashboard-page .entry-content,
body.pds-dashboard-page article,
body.pds-dashboard-page .page-content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.ghbm-app-page .entry-header,
body.ghbm-app-page .entry-title,
body.ghbm-app-page .ast-single-entry-header,
body.ghbm-app-page #masthead,
body.ghbm-app-page .site-header,
body.ghbm-app-page footer.site-footer,
body.ghbm-app-page .site-footer {
  display: none !important;
}

body.ghbm-app-page.pds-has-app-shell,
body.pds-dashboard-page.pds-has-app-shell {
  overflow: hidden !important;
}

.ghbm-app-root,
body.pds-dashboard-page .orders-sneat-page,
body.pds-dashboard-page .orders-page,
body.pds-dashboard-page .adm-om-page {
  width: 100% !important;
  max-width: none !important;
}

.pds-app-page-content--embedded .orders-sneat-page,
.pds-app-page-content--embedded .orders-page,
.pds-app-page-content--embedded .wallet-sneat-page,
.pds-app-page-content--embedded .ghbm-wallet-page {
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.pds-app-page-content--embedded .orders-table-card,
.pds-app-page-content--embedded .orders-form-list,
body.pds-dashboard-page .orders-sneat-page .orders-table-card,
body.pds-dashboard-page .orders-sneat-page .orders-form-list {
  overflow: visible !important;
}

body.pds-dashboard-page .orders-sneat-page .orders-action-menu.is-open {
  z-index: 120 !important;
}

.orders-page .orders-filter-card,
.orders-page .orders-mgmt-table,
.adm-om-page .orders-filter-card,
.adm-om-page .orders-mgmt-table {
  width: 100% !important;
  max-width: none !important;
}

.orders-page .orders-heading,
.adm-om-page .orders-heading {
  width: 100% !important;
}

/* Main shell layout: see ghbm-app-shell.css (do not reset .pds-app-main margin here). */
body.pds-dashboard-page #pdsAppView .pw-pricing-page,
body.pds-dashboard-page .pds-app-page-content--embedded .pw-pricing-page {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: clip;
}

body.pds-dashboard-page .container,
body.pds-dashboard-page .container-sm,
body.pds-dashboard-page .container-md,
body.pds-dashboard-page .container-lg,
body.pds-dashboard-page .container-xl,
body.pds-dashboard-page .container-xxl {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.ghbm-app-root {
  min-height: 0 !important;
}

/* Align plugin shell colors with Sneat + GH brand */
.pds-app-shell {
  --pds-primary: #0056b3;
  --pds-primary-dark: #003366;
  --pds-shell-bg: #f5f5f9;
  --pds-sidebar-active-bg: #0056b3;
  --pds-sidebar-active-text: #fff;
  --pds-sidebar-hover: rgba(0, 86, 179, 0.08);
}

/* Sidebar nav — use shell tokens (do not apply light-page link colors here) */
.pds-app-shell .pds-sidebar .pds-nav-link:hover,
.pds-app-shell .pds-sidebar .pds-nav-sublink:hover,
.pds-app-shell .pds-sidebar .pds-nav-group-toggle:hover {
  background: var(--pds-sidebar-hover, rgba(255, 255, 255, 0.08)) !important;
  color: #fff !important;
}

.pds-app-shell .pds-sidebar .pds-nav-link.is-active:not(.pds-nav-sublink) {
  background: var(--pds-sidebar-active-bg, #0056b3) !important;
  color: var(--pds-sidebar-active-text, #fff) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.pds-app-shell .pds-sidebar .pds-nav-sublink.is-active {
  position: relative;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.pds-app-shell .pds-sidebar .pds-nav-sublink.is-active::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--pds-brand-accent, #ff7e00);
}

.pds-app-shell .pds-sidebar .pds-nav-link.is-active i,
.pds-app-shell .pds-sidebar .pds-nav-sublink.is-active i {
  color: inherit !important;
}

html[data-theme="dark"] .pds-app-shell .pds-sidebar,
.pds-app-shell.pds-theme-dark .pds-sidebar {
  --pds-sidebar-hover: rgba(255, 255, 255, 0.08);
  --pds-sidebar-active-bg: #0056b3;
  --pds-sidebar-active-text: #fff;
}

html[data-theme="dark"] .pds-app-shell .pds-sidebar .pds-nav-sublink.is-active,
.pds-app-shell.pds-theme-dark .pds-sidebar .pds-nav-sublink.is-active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pds-app-shell .pds-sidebar .pds-nav-link.is-active:not(.pds-nav-sublink),
.pds-app-shell.pds-theme-dark .pds-sidebar .pds-nav-link.is-active:not(.pds-nav-sublink) {
  background: var(--pds-sidebar-active-bg, #0056b3) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pds-app-shell,
.pds-app-shell.pds-theme-dark {
  --pds-shell-bg: #111827;
  --pds-navbar-bg: #1f2937;
  --pds-sidebar-bg: #111827;
  --pds-sidebar-border: rgba(51, 65, 85, 0.75);
  --pds-sidebar-user-bg: rgba(31, 41, 55, 0.9);
  --pds-sidebar-wallet-bg: rgba(31, 41, 55, 0.95);
  --pds-sidebar-hover: rgba(255, 255, 255, 0.08);
  --pds-sidebar-active-bg: #0056b3;
  --pds-sidebar-active-text: #fff;
  --pds-title-color: #e2e8f0;
  --pds-border: rgba(255, 255, 255, 0.08);
  --pds-widget-bg: #1f2937;
  --pds-widget-border: #374151;
  --pds-widget-heading: #f1f5f9;
  --pds-widget-text: #94a3b8;
  color: #cbd5e1;
}

html[data-theme="dark"] .pds-app-shell .pds-navbar,
.pds-app-shell.pds-theme-dark .pds-navbar {
  background: var(--pds-navbar-bg) !important;
  border-bottom-color: var(--pds-border) !important;
}

html[data-theme="dark"] .pds-app-shell .pds-navbar-title,
html[data-theme="dark"] .pds-app-shell .pds-navbar-toggle,
html[data-theme="dark"] .pds-app-shell .pds-navbar-icon-btn,
.pds-app-shell.pds-theme-dark .pds-navbar-title,
.pds-app-shell.pds-theme-dark .pds-navbar-toggle,
.pds-app-shell.pds-theme-dark .pds-navbar-icon-btn {
  color: var(--pds-title-color) !important;
}

html[data-theme="dark"] .pds-app-shell .pds-app-main,
.pds-app-shell.pds-theme-dark .pds-app-main {
  background: var(--pds-shell-bg) !important;
}

html[data-theme="dark"] .pds-app-shell .pds-bottom-nav,
.pds-app-shell.pds-theme-dark .pds-bottom-nav {
  background: var(--pds-navbar-bg) !important;
  border-color: var(--pds-border) !important;
}

html[data-theme="dark"] body.ghbm-app-page,
html[data-theme="dark"] body.pds-dashboard-page,
body.pds-theme-dark-page.ghbm-app-page,
body.pds-theme-dark-page.pds-dashboard-page {
  background: #111827 !important;
}

html[data-theme="dark"] .pds-app-shell,
.pds-app-shell.pds-theme-dark {
  background: var(--pds-shell-bg) !important;
}

.pds-app-shell .pds-sidebar-wallet-topup,
.pds-app-shell .pds-btn-primary,
.pds-app-shell .btn-primary {
  background: #0056b3 !important;
  border-color: #0056b3 !important;
}

/* Sneat component pages rendered inside plugin views */
.pw-pricing-page {
  --pw-primary: #0056b3;
}

body.ghbm-auth-page {
  background: #f5f5f9 !important;
}

body.ghbm-auth-page #masthead,
body.ghbm-auth-page .site-header,
body.ghbm-auth-page footer.site-footer,
body.ghbm-auth-page .site-footer,
body.ghbm-auth-page .entry-header {
  display: none !important;
}

.ghbm-auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.ghbm-auth-root .pdcl-sneat-root {
  width: 100%;
  max-width: 100%;
}

.ghbm-auth-root .entry-content,
.ghbm-auth-root .page-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.gh-store-page,
body.pds-retail-page {
  background: #f8fafc !important;
}

html.gh-store-dark body.gh-store-page,
html.gh-store-dark body.pds-retail-page,
body.gh-store-page:has(.dataverse-widget-container.storefront-night),
body.pds-retail-page:has(.dataverse-widget-container.storefront-night) {
  background: #0b1220 !important;
}

html[data-theme="dark"] body.ghbm-auth-page {
  background: #111827 !important;
}

body.gh-store-page #masthead,
body.gh-store-page .site-header,
body.gh-store-page footer.site-footer,
body.gh-store-page .site-footer,
body.gh-store-page .entry-header,
body.pds-retail-page #masthead,
body.pds-retail-page .site-header,
body.pds-retail-page footer.site-footer,
body.pds-retail-page .site-footer,
body.pds-retail-page .entry-header {
  display: none !important;
}

body.gh-store-page .site-content,
body.gh-store-page .entry-content,
body.pds-retail-page .site-content,
body.pds-retail-page .entry-content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

.dataverse-widget-container {
  width: 100% !important;
  max-width: none !important;
}
