/* pagebar.css — generic top icon/text toolbar with underline active tab */

/* Default focus color (can be overridden by inline body style) */
body {
  --focus-color: #1767a7;
}

/* Outer wrapper so it can be centered and padded nicely */
.pagebar-wrap {
  max-width: 1500px;
  margin: 14px auto 14px;
  padding: 0 12px;
}

/* The card itself */
.pagebar {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* Inner bar that holds the icon tabs */
.pagebar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Compact W3 buttons inside */
.pagebar .w3-button {
  padding: 8px 8px !important;
}

/* Tabs */
.pagebar .w3-button.pagebar-tab {
  position: relative;
  padding-top: 6px !important;
  padding-bottom: 16px !important;
}

/* Active tab uses focus color */
.pagebar .pagebar-tab.pagebar-tab-active {
  color: var(--focus-color) !important;
}

/* 3/4-width underline on active tab, also focus color */
.pagebar .pagebar-tab.pagebar-tab-active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: var(--focus-color);
  pointer-events: none;
}

/* Pagebar Font Awesome icons follow focus color (duotone) */
.pagebar .pagebar-tab i {
  --fa-primary-color: var(--focus-color);
  --fa-secondary-color: var(--focus-color);
}
.pagebar .pagebar-tabs .pagebar-tab.pagebar-nav-step i {
  --fa-primary-color: color-mix(in srgb, var(--focus-color, #1767a7) 76%, #000);
  --fa-secondary-color: color-mix(in srgb, var(--focus-color, #1767a7) 76%, #000);
  --fa-secondary-opacity: 1;
}
/* Fallback size if FA kit is blocked locally (keeps toolbar height stable) */
.pagebar .pagebar-tab i.fa-2xl {
  font-size: 2em;
  line-height: 1;
}

/* Duotone pagebar icons follow the focus color */
.pagebar-icon {
  --fa-primary-color: var(--pagebar-focus-color, #1767a7);
  --fa-secondary-color: var(--pagebar-focus-color, #1767a7);
}
.pagebar .pagebar-tab .pagebar-icon-combo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}
.pagebar .pagebar-tab .pagebar-icon-combo-dollar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-size: 0.62em;
  color: var(--focus-color, #1767a7);
  pointer-events: none;
}
.pagebar-separator {
  width: 1px;
  height: 32px;
  margin: 0 8px;
  background: color-mix(in srgb, var(--focus-color, #1767a7) 34%, rgba(15,23,42,.18));
  border-radius: 999px;
  flex: 0 0 auto;
}
body.theme-dark .pagebar-separator {
  background: color-mix(in srgb, var(--focus-color, #1767a7) 38%, rgba(255,255,255,.28));
}

/* Opt-in responsive pagebars follow the Scuba toolbar's compact wrapping. */
.pagebar-mobile-wrap .pagebar-tabs {
  width: 100%;
}

@media (max-width: 980px) {
  .pagebar-mobile-wrap .pagebar {
    padding: 6px 8px;
  }

  .pagebar-mobile-wrap .pagebar-tabs {
    flex-wrap: wrap;
    gap: 6px 2px;
    align-items: center;
  }

  .pagebar-mobile-wrap .pagebar-tab {
    flex: 0 0 auto;
  }

  .pagebar-mobile-wrap .pagebar-separator {
    display: none;
  }
}

@media (max-width: 640px) {
  .pagebar-wrap.pagebar-mobile-wrap {
    padding: 0 8px;
  }

  .pagebar-mobile-wrap .pagebar-tabs {
    justify-content: flex-start;
  }

  .inventory-pagebar .pagebar-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(42px, 54px));
  }

  .customer-pagebar .pagebar-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(42px, 54px));
  }

  .setup-pagebar .pagebar-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(42px, 54px));
  }

  .inventory-pagebar .pagebar-tabs::before,
  .inventory-pagebar .pagebar-tabs::after,
  .customer-pagebar .pagebar-tabs::before,
  .customer-pagebar .pagebar-tabs::after,
  .setup-pagebar .pagebar-tabs::before,
  .setup-pagebar .pagebar-tabs::after {
    content: none;
    display: none;
  }

  .pagebar-mobile-wrap .pagebar-tab {
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Fast hover tooltip for pagebar tabs */
.pagebar-tooltip {
  position: absolute;
  z-index: 9999;
  padding: 4px 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

.pagebar-tooltip.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pagebar-tooltip.action-tip {
  background: var(--focus-color, #1767a7);
  color: var(--focus-contrast, #fff);
}

/* Kill the default iOS/Android gray tap highlight in the pagebar */
.pagebar .w3-button {
  -webkit-tap-highlight-color: transparent;
}

/* Base: no default W3 background inside pagebar */
.pagebar .w3-button {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Kill the W3 hover/focus/active gray overlay for desktop too */
.pagebar .w3-button:hover,
.pagebar .w3-button:focus,
.pagebar .w3-button:active {
  background-color: transparent !important;
  box-shadow: none !important;
}


/* On touch devices, don't keep the W3 hover/focus background */
@media (hover: none) and (pointer: coarse) {
  .pagebar .w3-button,
  .pagebar .w3-button:hover,
  .pagebar .w3-button:focus,
  .pagebar .w3-button:active {
    background-color: transparent !important;
    box-shadow: none !important;
  }
}
