/* Shared customer popovers and listbox-style selects. */
:root {
  --customer-toolbar-control-height: 3.25rem;
}

.boonia-payment-method-brands {
  display: inline-flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.boonia-payment-method-brand {
  display: inline-flex;
  width: 4.5rem;
  height: 2.75rem;
  flex: 0 0 4.5rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(13, 31, 30, 0.08);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.35rem;
}

.boonia-payment-method-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.customer-toolbar-control {
  box-sizing: border-box;
  height: var(--customer-toolbar-control-height);
  min-height: var(--customer-toolbar-control-height);
}

.customer-search-shell {
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.customer-search-shell:hover {
  border-color: rgba(33, 134, 122, 0.2);
}

.customer-search-shell:focus-within {
  border-color: rgba(33, 134, 122, 0.35);
  box-shadow: 0 0 0 3px rgba(33, 134, 122, 0.14), 0 8px 16px rgba(16, 32, 31, 0.04);
}

.customer-search-input,
.customer-search-input:focus,
.customer-search-input:focus-visible {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

.customer-search-input::-webkit-search-decoration,
.customer-search-input::-webkit-search-cancel-button,
.customer-search-input::-webkit-search-results-button,
.customer-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.customer-search-clear[hidden] {
  display: none;
}

.customer-search-clear {
  border: 0;
  background: transparent;
  box-shadow: none;
}

[data-boonia-popover] {
  position: relative;
}

[data-boonia-popover-mode='inline'] {
  display: contents;
}

[data-boonia-popover-mode='inline'] > [data-boonia-popover-panel] {
  position: static;
  inset: auto;
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  margin-top: 0.75rem;
}

[data-boonia-popover-mode='inline'] > [data-boonia-popover-trigger] {
  min-width: 0;
}

[data-boonia-popover-mode='inline'] .boonia-popover__surface,
[data-boonia-popover-mode='inline'] .boonia-popover__body {
  overflow: visible;
}

[data-boonia-popover-panel][hidden],
[data-boonia-select-panel][hidden] {
  display: none !important;
}

[data-boonia-filter-count][hidden] {
  display: none !important;
}

.boonia-popover__panel {
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  max-width: calc(100vw - 2rem);
  z-index: 70;
}

.boonia-popover__panel.is-open-up {
  top: auto;
  bottom: calc(100% + 0.75rem);
}

.boonia-popover__surface {
  display: flex;
  min-height: 0;
  max-height: min(28rem, calc(100dvh - 2rem));
  flex-direction: column;
}

.boonia-popover__header,
.boonia-popover__footer {
  flex: none;
}

.boonia-popover__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.boonia-popover__close:focus-visible {
  outline: 3px solid rgba(33, 134, 122, 0.32);
  outline-offset: 2px;
}

.boonia-overlay-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.boonia-overlay-root > [data-boonia-popover-panel].is-overlay {
  position: fixed;
  inset: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(0rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  z-index: 1;
  width: auto;
  max-height: min(86dvh, 42rem);
  overflow: hidden;
  pointer-events: auto;
}

.boonia-popover__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(13, 31, 30, 0.36);
  pointer-events: auto;
}

.boonia-popover__backdrop[hidden] {
  display: none !important;
}

.boonia-popover-lock {
  overflow: hidden;
}

.boonia-popover__panel.is-overlay {
  position: fixed;
  inset: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(0rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  top: auto;
  z-index: 1;
  width: auto;
  max-width: none;
  max-height: min(86dvh, 42rem);
  overflow: hidden;
  pointer-events: auto;
}

.boonia-popover__panel.is-sheet .boonia-popover__surface {
  max-height: min(86dvh, 42rem);
  overflow: hidden;
  border-radius: 1.5rem;
}

.boonia-popover__panel.is-sheet .boonia-popover__body {
  overflow-y: auto;
}

.boonia-select {
  position: relative;
  min-width: 0;
}

.boonia-select[data-boonia-select-menu='inline'] {
  z-index: 20;
}

.boonia-select__label {
  display: block;
  margin-bottom: 0.35rem;
  color: #0d1f1e;
  font-size: 0.75rem;
  font-weight: 800;
}

.boonia-select__trigger {
  display: flex;
  width: 100%;
  min-height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(13, 31, 30, 0.1);
  border-radius: 1.4rem;
  background: #fff;
  padding: 0.75rem 1rem;
  color: #0d1f1e;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.boonia-select__trigger.customer-toolbar-control {
  height: var(--customer-toolbar-control-height);
  min-height: var(--customer-toolbar-control-height);
}

.boonia-select--chip {
  flex: 0 0 auto;
  min-width: max-content;
  width: auto;
}

.boonia-select--chip .boonia-select__trigger {
  min-height: 2.75rem;
  width: auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
}

.boonia-select__trigger:hover,
.boonia-select__trigger[aria-expanded='true'] {
  border-color: rgba(33, 134, 122, 0.45);
  background: #fff;
}

.boonia-select__trigger:focus-visible,
.boonia-popover__trigger:focus-visible {
  outline: 3px solid rgba(33, 134, 122, 0.32);
  outline-offset: 3px;
}

.boonia-select__trigger.customer-focus-shell:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(33, 134, 122, 0.14), 0 8px 16px rgba(16, 32, 31, 0.04);
}

.boonia-select__label-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boonia-select__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-start: 0;
  inset-inline-end: auto;
  width: 100%;
  z-index: 80;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  border: 1px solid rgba(13, 31, 30, 0.1);
  border-radius: 1rem;
  background: #fff;
  padding: 0.35rem;
  box-shadow: 0 18px 45px rgba(16, 32, 31, 0.16);
}

.boonia-select[data-boonia-select-menu='inline'] .boonia-select__panel {
  position: static;
  width: 100%;
  margin-top: 0.5rem;
}

.boonia-select__search {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(13, 31, 30, 0.1);
  padding: 0.35rem 0.5rem 0.65rem;
}

.boonia-select__search.customer-search-shell {
  border: 1px solid rgba(13, 31, 30, 0.1);
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.35rem 0.65rem;
}

.boonia-select__search-input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #0d1f1e;
  font-size: 0.875rem;
  font-weight: 600;
  outline: none;
}

.boonia-select__search-input::placeholder {
  color: #71808a;
}

.boonia-select__panel.is-viewport {
  position: fixed;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 90;
}

/* Keep local toolbar menus above the following results layer without changing
   their anchored coordinates or affecting the mobile selection sheets. */
@media (min-width: 640px) {
  [data-boonia-results-layer] {
    position: relative;
    z-index: 0;
  }

  [data-boonia-toolbar-layer][data-boonia-toolbar-open='true'] {
    position: relative;
    z-index: 1;
  }
}

.boonia-select__sheet-header {
  display: none;
}

.boonia-select__sheet-body {
  min-height: 0;
}

.boonia-select__sheet-close {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #71808a;
}

.boonia-select__sheet-close:focus-visible {
  outline: 3px solid rgba(33, 134, 122, 0.32);
  outline-offset: 2px;
}

.boonia-select__panel.is-open-up {
  top: auto;
}

.boonia-select__option {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  padding: 0.65rem 0.75rem;
  color: #0d1f1e;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
}

.boonia-select__option:hover,
.boonia-select__option:focus-visible,
.boonia-select__option[aria-selected='true'] {
  background: #edf7f6;
  color: #185f56;
}

.boonia-select__option:focus-visible {
  outline: 2px solid rgba(33, 134, 122, 0.35);
  outline-offset: -2px;
}

@media (max-width: 639px) {
  [data-boonia-popover-mode='inline'] {
    display: block;
  }

  [data-boonia-popover-mode='inline'] > [data-boonia-popover-panel] {
    grid-column: auto;
    margin-top: 0;
  }

  .boonia-popover__panel.is-sheet .boonia-popover__footer {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .boonia-popover__panel.is-sheet .boonia-select__panel {
    position: static;
    width: 100%;
    max-height: min(15rem, 42vh);
    margin-top: 0.5rem;
  }

  .boonia-select__panel.is-select-sheet {
    position: fixed;
    inset: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    z-index: 1;
    display: flex;
    width: auto;
    max-width: none;
    max-height: min(86dvh, 42rem);
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.5rem;
    pointer-events: auto;
  }

  .boonia-select__panel.is-select-sheet .boonia-select__sheet-header {
    display: flex;
    min-height: 3.5rem;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(13, 31, 30, 0.08);
    padding: 0.35rem 0.75rem 0.35rem 1rem;
    color: #0d1f1e;
    font-size: 1rem;
    font-weight: 800;
  }

  .boonia-select__panel.is-select-sheet .boonia-select__sheet-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.35rem;
  }

  .boonia-select__panel.is-select-sheet .boonia-select__search {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
  }

  .boonia-select[data-boonia-select-menu='inline'] .boonia-select__panel {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boonia-select__trigger {
    transition: none;
  }
}

.customer-pagination { display: flex; justify-content: center; margin-top: 1.25rem; }
.customer-pagination__mobile,
.customer-pagination__desktop { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.customer-pagination__mobile { display: none; }
.customer-pagination__control { display: inline-flex; min-width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; border: 1px solid rgba(16, 32, 31, 0.12); border-radius: 0.65rem; background: #fff; padding-inline: 0.65rem; color: #0d1f1e; font-size: 0.78rem; font-weight: 800; text-decoration: none; }
.customer-pagination__control--page { width: 2.25rem; padding-inline: 0; }
.customer-pagination__control.is-current { border-color: #21867a; background: #21867a; color: #fff; }
.customer-pagination__control.is-disabled { color: #cbd5e1; pointer-events: none; }
.customer-pagination__control:focus-visible { border-color: #21867a; outline: 0; box-shadow: 0 0 0 3px rgba(33, 134, 122, 0.13); }
.customer-pagination__ellipsis { color: #64748b; font-weight: 800; }

@media (max-width: 639px) {
  .customer-pagination__mobile { display: flex; width: 100%; justify-content: space-between; }
  .customer-pagination__desktop { display: none; }
}
