/* Shared sort presentation; the enabled native select remains the underlying source of truth. */
html.bs-choice-open { overflow: hidden; }

body.bscg-gallery.bscg-card-cta-preview .bs-choice-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #b8bfb3;
  border-radius: 10px;
  background: #f7f4ed;
  color: #294a3c;
  box-shadow: none;
  font: 400 14px/1.4 BaristaGalleryHeebo, Heebo, Arial, sans-serif;
  text-align: start;
  cursor: pointer;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-chevron {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-inline: 3px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

body.bscg-gallery.bscg-card-cta-preview dialog.bs-choice-dialog {
  position: fixed;
  inset: auto;
  top: var(--bs-choice-top, 12px);
  left: var(--bs-choice-left, 12px);
  box-sizing: border-box;
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: min(520px, calc(100dvh - 24px));
  margin: 0;
  padding: 0;
  border: 1px solid #d8dbd2;
  border-radius: 10px;
  background: #f7f4ed;
  color: #294a3c;
  box-shadow: 0 8px 24px rgb(23 41 31 / 10%);
  font: 400 15px/1.5 BaristaGalleryHeebo, Heebo, Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: contain;
  color-scheme: light;
}

body.bscg-gallery.bscg-card-cta-preview dialog.bs-choice-dialog:not([open]) { display: none; }
body.bscg-gallery.bscg-card-cta-preview dialog.bs-choice-dialog[open] { display: flex; flex-direction: column; }
body.bscg-gallery.bscg-card-cta-preview dialog.bs-choice-dialog::backdrop { background: rgb(21 31 24 / 20%); }

body.bscg-gallery.bscg-card-cta-preview .bs-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #dedfd7;
  background: transparent;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-head h2 {
  margin: 0;
  padding: 0;
  color: #294a3c;
  font: 400 18px/1.4 BaristaGalleryHeebo, Heebo, Arial, sans-serif;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #294a3c;
  box-shadow: none;
  font: 400 26px/1 Arial, sans-serif;
  cursor: pointer;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-options {
  display: grid;
  gap: 3px;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #294a3c;
  box-shadow: none;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

body.bscg-gallery.bscg-card-cta-preview .bs-choice-option[aria-pressed="true"] { background: #e5e9dd; border-color: #b8bfb3; }
body.bscg-gallery.bscg-card-cta-preview .bs-choice-option:hover:not(:disabled) { background: #e5e9dd; }
body.bscg-gallery.bscg-card-cta-preview .bs-choice-option:disabled { opacity: .5; cursor: default; }
body.bscg-gallery.bscg-card-cta-preview .bs-choice-tick { flex: 0 0 18px; text-align: center; }

@layer bscg-gallery {
  body.bscg-gallery.bscg-card-cta-preview .bs-cat-order select.bs-choice-native[hidden] { display: none !important; }
  body.bscg-gallery.bscg-card-cta-preview:is(.bsf-manual,.bsf-automatic).bsf-ready #bsf-root .bsf-tools > .bsf-trigger,
  body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bscg-filters-ready .bs-cat-toolbar > .bs-cat-filter-toggle,
  body.bscg-gallery.bscg-card-cta-preview:is(.bsf-manual,.bsf-automatic).bsf-ready #bsf-root .bsf-order select.orderby,
  body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bscg-filters-ready .bs-cat-order select {
    border-radius: 10px !important;
    font-size: 14px !important;
  }
  body.bscg-gallery.bscg-card-cta-preview :is(.bs-choice-trigger, .bs-choice-dialog button):focus-visible {
    outline: 2px solid #294a3c !important;
    outline-offset: 2px !important;
  }
}

/* Keep non-machine catalog controls together at the reading-direction start edge. */
@layer bscg-gallery {
  @media (min-width: 768px) {
    body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bs-cat-toolbar {
      display: grid !important;
      direction: inherit;
      grid-template-columns: 180px 220px !important;
      justify-content: start !important;
      align-items: center !important;
      column-gap: 12px !important;
      row-gap: 0 !important;
    }
    body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bs-cat-toolbar > :is(.bs-cat-filter-toggle, .bs-cat-order) {
      box-sizing: border-box !important;
      width: 100% !important;
      min-width: 0 !important;
      justify-self: stretch !important;
    }
    body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bs-cat-toolbar .bs-cat-order .woocommerce-ordering {
      float: none !important;
      width: 100% !important;
      margin: 0 !important;
    }
    body.bscg-gallery.bscg-card-cta-preview:not(.bsf-manual,.bsf-automatic) .bs-cat-toolbar :is(.bs-cat-filter-toggle, .bs-choice-trigger) {
      min-height: 46px !important;
      border-radius: 10px !important;
    }
  }
}

@media (max-width: 639px) {
  body.bscg-gallery.bscg-card-cta-preview dialog.bs-choice-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 85vh;
    max-height: 85dvh;
    border-inline: 0;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: none;
  }
  body.bscg-gallery.bscg-card-cta-preview .bs-choice-head { padding: 10px 18px; }
  body.bscg-gallery.bscg-card-cta-preview .bs-choice-options { padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.bscg-gallery.bscg-card-cta-preview .bs-choice-option { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  body.bscg-gallery.bscg-card-cta-preview :is(.bs-choice-trigger, .bs-choice-dialog, .bs-choice-dialog *) {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
