/* ═══════════════════════════════════════════════════════════
   Cute selects — site-wide, theme-safe
   Uses only the theme variables (--cream, --parchment, --charcoal,
   --border-dark, --sage, --terra, --radius), so light, dark and every
   site theme follow automatically.

   1) Native selects:  .form-select / .select-sm / .cute-select get a
      small rounded look with a themed arrow (no JS needed).
   2) Custom dropdown: add class "cute-select" (or data-cute) to a
      <select> and assets/js/cute_select.js swaps it for the pill
      list below. The real <select> stays in the form, hidden.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Native selects ─────────────────────────────────────── */
/*
   Global native-select treatment. This intentionally catches plain selects
   too, so dropdowns stay visually consistent even when a page does not use
   one of the form helper classes. Multiple-selection boxes are left alone.
*/
select:not([multiple]),
select.form-select,
select.select-sm,
select.select-inline,
select.cute-select:not(.cs-ready),
select[data-cute]:not(.cs-ready) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 42px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.35;
  padding: .62rem 2.45rem .62rem .9rem;
  color: var(--charcoal);
  background-color: var(--cream, #fdfaf5);
  border: 1px solid color-mix(in srgb, var(--charcoal, #1e2420) 18%, transparent);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--charcoal, #1e2420) 5%, transparent);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition:
    border-color .16s ease,
    background-color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

select:not([multiple]):hover,
select.form-select:hover,
select.select-sm:hover,
select.select-inline:hover,
select.cute-select:not(.cs-ready):hover,
select[data-cute]:not(.cs-ready):hover {
  border-color: color-mix(in srgb, var(--sage, #6b7c5e) 72%, transparent);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--charcoal, #1e2420) 8%, transparent);
}

select:not([multiple]):focus,
select:not([multiple]):focus-visible,
select.form-select:focus,
select.form-select:focus-visible,
select.select-sm:focus,
select.select-sm:focus-visible,
select.select-inline:focus,
select.select-inline:focus-visible,
select.cute-select:not(.cs-ready):focus,
select.cute-select:not(.cs-ready):focus-visible,
select[data-cute]:not(.cs-ready):focus,
select[data-cute]:not(.cs-ready):focus-visible {
  outline: none;
  border-color: var(--sage, #6b7c5e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage, #6b7c5e) 18%, transparent),
              0 3px 10px color-mix(in srgb, var(--charcoal, #1e2420) 7%, transparent);
}

select:not([multiple]) option,
select.form-select option,
select.select-sm option,
select.select-inline option,
select.cute-select option,
select[data-cute] option {
  background: var(--cream, #fdfaf5);
  color: var(--charcoal);
}

select:not([multiple]):disabled,
select.form-select:disabled,
select.select-sm:disabled,
select.select-inline:disabled,
select.cute-select:disabled,
select[data-cute]:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
  background-color: var(--parchment, #f7f3ec);
}

select.select-sm {
  min-height: 34px;
  padding-top: .4rem;
  padding-bottom: .4rem;
  font-size: .8rem;
  border-radius: 8px;
}

select.select-inline {
  width: auto;
  min-width: 0;
}

/* ── 2. Custom dropdown (built by cute_select.js) ──────────── */
select.cs-ready { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; }
.cs { position: relative; display: inline-block; max-width: 100%; font-size: .8rem; }
.cs.cs-block { display: block; }
.cs-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font: inherit; line-height: 1.4; text-align: left;
  min-height: 42px; padding: .62rem .9rem; color: var(--charcoal);
  background: var(--cream, #fdfaf5); border: 1px solid color-mix(in srgb, var(--charcoal, #1e2420) 18%, transparent); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cs-btn:hover { border-color: color-mix(in srgb, var(--sage, #6b7c5e) 60%, transparent); }
.cs-btn:focus-visible { outline: none; border-color: var(--sage, #6b7c5e); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage, #6b7c5e) 25%, transparent); }
.cs-btn:disabled { opacity: .55; cursor: not-allowed; }
.cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* caret */
.cs-caret { flex: none; font-size: .7em; opacity: .7; transition: transform .15s; }
.cs-caret::before { content: '▾'; }
.cs.is-open /* caret */
.cs-caret { flex: none; font-size: .7em; opacity: .7; transition: transform .15s; }
.cs-caret::before { content: '▾'; }
.cs-list {
  position: absolute; z-index: 60; left: 0; width: max-content; min-width: 100%; max-width: min(92vw, 360px); margin-top: 4px;
  max-height: 240px; overflow-y: auto; padding: 4px;
  background: var(--cream, #fff); border: 1px solid var(--border-dark); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.cs.is-up .cs-list { bottom: 100%; margin: 0 0 4px; }
.cs-list[hidden] { display: none; }
.cs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: .48rem .7rem; border-radius: 7px; color: var(--charcoal); cursor: pointer; line-height: 1.35;
}
.cs-opt:hover, .cs-opt.is-active { background: color-mix(in srgb, var(--sage, #6b7c5e) 18%, transparent); }
.cs-opt[aria-selected="true"] { font-weight: 600; background: color-mix(in srgb, var(--sage, #6b7c5e) 28%, transparent); }
.cs-opt[aria-selected="true"]::before { content: '✓'; margin-right: 2px; color: var(--sage, #6b7c5e); }
.cs-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.cs-group { padding: .35rem .7rem .15rem; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #888); }
.cs-text { flex: 1; overflow-wrap: break-word; }
.cs-price { flex: none; font-size: .68rem; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--charcoal) 10%, transparent); white-space: nowrap; }
