.choice-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 12px;
  white-space: nowrap;
}

.choice-dropdown-control {
  position: relative;
  display: inline-grid;
  color: #351342;
}

.choice-dropdown-trigger {
  position: relative;
  min-inline-size: 72px;
  min-block-size: 34px;
  padding: 5px 19px;
  font: inherit;
  color: inherit;
  text-align: center;
  background: #fff9;
  border: 1px solid #35134233;
  border-radius: 25px;
  cursor: pointer;
}

.choice-dropdown-trigger [data-dropdown-value] {
  display: inline-block;
  transform: translateX(-20%);
}

[data-choice-dropdown="gallery-rows"] .choice-dropdown-trigger { min-inline-size: 94px; }

[data-choice-dropdown="blog-sort"] { color: var(--muted); }
[data-choice-dropdown="blog-sort"] .choice-dropdown-trigger { min-inline-size: 112px; }

.choice-dropdown-trigger:disabled {
  opacity: .6;
  cursor: default;
}

.choice-dropdown-trigger::after {
  content: '';
  position: absolute;
  inset-inline-end: 8px;
  inset-block-start: 50%;
  inline-size: 6px;
  block-size: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.choice-dropdown-options {
  position: absolute;
  z-index: 5;
  inset-block-start: calc(100% + 4px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  inline-size: max-content;
  min-inline-size: 50%;
  padding-block: 3px;
  overflow: hidden;
  border: 1px solid #35134233;
  border-radius: 12px;
  background: #fffaf5;
  box-shadow: 0 4px 14px #35134220;
}

.choice-dropdown-options button {
  display: block;
  inline-size: 100%;
  min-block-size: 28px;
  padding: 3px 5px;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.choice-dropdown-options button[aria-pressed="true"] {
  background: #35134212;
  font-weight: 600;
}

[data-choice-dropdown="gallery-speed"] .choice-dropdown-options { padding-block: 2px; }
[data-choice-dropdown="gallery-speed"] .choice-dropdown-options button { min-block-size: 25px; }
[data-choice-dropdown="gallery-rows"] .choice-dropdown-options button { padding-inline: 1px; }

.choice-dropdown-options button:hover,
.choice-dropdown-options button:focus-visible { background: #35134224; }
.choice-dropdown-options button:focus-visible { outline-offset: -2px; }

@media (max-width: 420px) {
  [data-choice-dropdown="blog-sort"] {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}
