/* Opt-in native controls: presentation only, with no separate form state. */
.broccoli-controls {
  --bc-control-surface:#fffef8;
  --bc-control-ink:#24452f;
  --bc-control-border:#aaada5;
  --bc-control-muted:#65705c;
  --bc-control-accent:#dcebad;
  --bc-control-error:#9b3e29;
  --bc-control-radius:6px;
  --bc-control-height:48px;
  --bc-control-padding:13px;
  --bc-control-font-size:16px;
  --bc-control-line-height:20px;
  --bc-control-ring:#55594f;
}

.broccoli-controls :where(input:not([type]),input[type=text],input[type=email],input[type=tel],input[type=number],input[type=search],input[type=url],input[type=password],input[type=date],input[type=time],input[type=datetime-local],textarea,select:not([data-pack-picker-native]):not(.select2-hidden-accessible)):where(:not(.qty):not([data-cart-key])),
.broccoli-controls .select2-container .select2-selection {
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:var(--bc-control-height);
  margin:0;
  padding:var(--bc-control-padding) 13px;
  border:1px solid var(--bc-control-border);
  border-radius:var(--bc-control-radius);
  background-color:var(--bc-control-surface);
  color:var(--bc-control-ink);
  font:inherit;
  font-size:var(--bc-control-font-size);
  line-height:var(--bc-control-line-height);
  box-shadow:none;
  transition:border-color .15s ease,background-color .15s ease;
}
.broccoli-controls textarea { min-height:108px; resize:vertical; }
.broccoli-controls :is(input,textarea)::placeholder { color:var(--bc-control-muted); opacity:1; }
.broccoli-controls :is(input,textarea,select):hover:not(:disabled):not([readonly]),
.broccoli-controls .select2-container:not(.select2-container--disabled) .select2-selection:hover { border-color:var(--bc-control-border); }
.broccoli-controls :is(input,textarea,select):focus,
.broccoli-controls .select2-container :is(.select2-selection,.select2-search__field):focus { outline:none; box-shadow:none; }
.broccoli-controls :is(input,textarea,select):focus-visible,
.broccoli-controls .select2-container :is(.select2-selection,.select2-search__field):focus-visible {
  outline:2px solid var(--bc-control-ring);
  outline-offset:2px;
  border-color:var(--bc-control-border);
  box-shadow:none;
}
.broccoli-controls :is(input,textarea,select):disabled,
.broccoli-controls .select2-container--disabled .select2-selection {
  background-color:#efeee5;
  color:var(--bc-control-muted);
  border-color:#b9beb0;
  box-shadow:none;
  cursor:not-allowed;
}
.broccoli-controls :is(input,textarea)[readonly] {
  background-color:#f2f3e9;
  border-style:dashed;
  box-shadow:none;
}
.broccoli-controls :is(input,textarea,select)[aria-invalid=true],
.broccoli-controls :is(.woocommerce-invalid,.is-invalid) :is(input,textarea,select,.select2-selection),
.broccoli-controls .select2-selection[aria-invalid=true] {
  border-color:var(--bc-control-error);
  box-shadow:none;
}
.broccoli-controls :is(.bc-field-error,.woocommerce-error) { color:var(--bc-control-error); }
.broccoli-controls .bc-field { margin:0 0 20px; }
.broccoli-controls .bc-field > label { display:block; margin-bottom:7px; color:var(--bc-control-ink); font-size:13px; font-weight:600; }
.broccoli-controls :is(.bc-field-hint,.bc-field-error) { display:block; margin:7px 0 0; font-size:12px; line-height:1.5; }
.broccoli-controls .bc-field-hint { color:var(--bc-control-muted); }

/* Native selection and keyboard behavior remain intact under the visual mark. */
.broccoli-controls input:is([type=radio],[type=checkbox]) {
  appearance:none;
  -webkit-appearance:none;
  display:inline-grid;
  place-content:center;
  box-sizing:border-box;
  flex:0 0 20px;
  width:20px;
  height:20px;
  min-height:20px;
  margin:0 8px 0 0;
  padding:0;
  border:1px solid var(--bc-control-border);
  border-radius:4px;
  background:var(--bc-control-surface);
  color:var(--bc-control-ink);
  vertical-align:middle;
  cursor:pointer;
  box-shadow:none;
  touch-action:manipulation;
}
.broccoli-controls input[type=radio] { border-radius:50%; }
.broccoli-controls input:is([type=radio],[type=checkbox])::before {
  content:'';
  display:block;
  width:9px;
  height:9px;
  opacity:0;
}
.broccoli-controls input[type=radio]::before { border-radius:50%; background:currentColor; }
.broccoli-controls input[type=checkbox]::before {
  width:9px;
  height:5px;
  border-left:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:translateY(-1px) rotate(-45deg);
}
.broccoli-controls input:is([type=radio],[type=checkbox]):checked,
.broccoli-controls input[type=checkbox]:indeterminate { border-color:var(--bc-control-border); background:var(--bc-control-accent); }
.broccoli-controls input:is([type=radio],[type=checkbox]):checked::before,
.broccoli-controls input[type=checkbox]:indeterminate::before { opacity:1; }
.broccoli-controls input[type=checkbox]:indeterminate::before { width:10px; height:0; border-left:0; transform:none; }
.broccoli-controls input:is([type=radio],[type=checkbox]):disabled { opacity:.55; cursor:not-allowed; }
.broccoli-controls input:is([type=radio],[type=checkbox])[aria-invalid=true],
.broccoli-controls :is(.woocommerce-invalid,.is-invalid) input:is([type=radio],[type=checkbox]) { border-color:var(--bc-control-error); box-shadow:none; }
.broccoli-controls .bc-choice { display:flex; align-items:center; min-height:44px; color:var(--bc-control-ink); cursor:pointer; }
.broccoli-controls .bc-choice:has(input:disabled) { color:var(--bc-control-muted); cursor:not-allowed; }

/* Single native selects share the same understated chevron as SelectWoo. */
.broccoli-controls select:not([multiple]):not([size]):not([data-pack-picker-native]):not(.select2-hidden-accessible) {
  appearance:none;
  -webkit-appearance:none;
  padding-right:36px;
  background-image:linear-gradient(45deg,transparent 50%,var(--bc-control-ink) 50%),linear-gradient(135deg,var(--bc-control-ink) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;
  background-size:5px 5px;
  background-repeat:no-repeat;
}
.broccoli-controls select:is([multiple],[size]) { min-height:108px; }
.broccoli-controls .select2-container { min-width:0; max-width:100%; }
.broccoli-controls .select2-container .select2-selection--single { height:auto; padding-right:36px; }
.broccoli-controls .select2-container .select2-selection__rendered { padding:0; color:inherit; line-height:var(--bc-control-line-height); }
.broccoli-controls .select2-container .select2-selection__placeholder { color:var(--bc-control-muted); }
.broccoli-controls .select2-container .select2-selection__arrow { top:0; right:11px; width:16px; height:100%; }
.broccoli-controls .select2-container .select2-selection__arrow b {
  top:50%; left:50%; width:7px; height:7px; margin:-5px 0 0 -4px;
  border:0; border-right:1.5px solid var(--bc-control-ink); border-bottom:1.5px solid var(--bc-control-ink); transform:rotate(45deg);
}
.broccoli-controls .select2-container--open .select2-selection__arrow b { margin-top:-2px; transform:rotate(225deg); }
.broccoli-controls .select2-container .select2-selection--multiple { padding:5px 9px; }
.broccoli-controls .select2-container .select2-selection__choice { margin:3px 5px 3px 0; padding:3px 8px; border:1px solid var(--bc-control-border); border-radius:4px; background:var(--bc-control-accent); color:var(--bc-control-ink); }
.broccoli-controls .select2-container .select2-selection__choice__remove { color:inherit; margin-right:6px; }
.broccoli-controls .select2-container .select2-search--inline .select2-search__field { min-height:30px; margin:2px 0; padding:2px; border:0; background:transparent; box-shadow:none; }
.broccoli-controls .select2-dropdown { overflow:hidden; border:1px solid var(--bc-control-border); border-radius:var(--bc-control-radius); background:var(--bc-control-surface); color:var(--bc-control-ink); box-shadow:0 8px 24px #243a241c; }
.broccoli-controls .select2-search--dropdown { padding:8px; }
.broccoli-controls .select2-search--dropdown .select2-search__field { min-height:var(--bc-control-height); }
.broccoli-controls .select2-results__option { min-height:44px; padding:11px 13px; font-size:15px; line-height:22px; }
.broccoli-controls .select2-results__option[aria-selected=true] { background:var(--bc-control-accent); color:var(--bc-control-ink); font-weight:600; }
.broccoli-controls .select2-results__option--highlighted[aria-selected] { background:var(--bc-control-ink); color:var(--bc-control-surface); }
.broccoli-controls .select2-results__option[aria-disabled=true] { color:var(--bc-control-muted); opacity:.6; }

/* Match the legacy theme's WooCommerce specificity only inside the opt-in scope. */
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea,select):where(:not(.qty):not([data-cart-key]):not([data-pack-picker-native]):not(.select2-hidden-accessible):not([type=checkbox]):not([type=radio]):not([type=hidden])) {
  width:100%;
  min-height:var(--bc-control-height);
  padding:var(--bc-control-padding) 13px;
  border:1px solid var(--bc-control-border);
  background-color:var(--bc-control-surface);
  color:var(--bc-control-ink);
  font-size:var(--bc-control-font-size);
  font-weight:400;
  line-height:var(--bc-control-line-height);
  box-shadow:none;
}
.broccoli-controls .woocommerce form .form-row select:where(:not([multiple]):not([size]):not([data-pack-picker-native]):not(.select2-hidden-accessible)) { padding-right:36px; }
.broccoli-controls .woocommerce form .form-row textarea { min-height:108px; }
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea)[readonly] { background-color:#f2f3e9; border-style:dashed; }
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea,select):disabled { background-color:#efeee5; color:var(--bc-control-muted); border-color:#b9beb0; }
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea,select):focus { border-color:var(--bc-control-border); box-shadow:none; outline:none; }
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea,select):focus-visible { outline:2px solid var(--bc-control-ring); outline-offset:-2px; }
.broccoli-controls .woocommerce form .form-row :is(input.input-text,textarea,select)[aria-invalid=true],
.broccoli-controls .woocommerce form .form-row:is(.woocommerce-invalid,.is-invalid) :is(input.input-text,textarea,select) { border-color:var(--bc-control-error); }
.broccoli-controls :is(form,.form-row) input:is([type=checkbox],[type=radio]) {
  display:inline-grid;
  place-content:center;
  box-sizing:border-box;
  width:20px;
  min-width:20px;
  max-width:20px;
  height:20px;
  min-height:20px;
  max-height:20px;
  padding:0;
  flex:0 0 20px;
}
.broccoli-controls .select2-container .select2-selection.select2-selection--single {
  height:var(--bc-control-height);
  min-height:var(--bc-control-height);
  padding:var(--bc-control-padding) 36px var(--bc-control-padding) 13px;
  border:1px solid var(--bc-control-border);
  font-weight:400;
  box-shadow:none;
}
.broccoli-controls .select2-container .select2-selection--single .select2-selection__rendered {
  padding:0;
  font-size:var(--bc-control-font-size);
  line-height:var(--bc-control-line-height);
}
.broccoli-controls .select2-container .select2-selection--single .select2-selection__arrow { height:100%; }
.broccoli-controls :is(input,textarea,select):where(:not([type=checkbox]):not([type=radio]):not(.qty):not([data-cart-key]):not([data-pack-picker-native])):focus-visible,
.broccoli-controls .select2-container :is(.select2-selection,.select2-search__field):focus-visible { outline-offset:-2px; }
.broccoli-controls .select2-container--disabled .select2-selection.select2-selection--single { background-color:#efeee5; color:var(--bc-control-muted); border-color:#b9beb0; }
.broccoli-controls .select2-container .select2-selection.select2-selection--single[aria-invalid=true],
.broccoli-controls :is(.woocommerce-invalid,.is-invalid) .select2-container .select2-selection.select2-selection--single { border-color:var(--bc-control-error); }

/* Address guidance stays in its native place under the control, so paired rows keep aligned labels. */
.broccoli-controls .woocommerce form .form-row .woocommerce-input-wrapper > .purchase-field-description { display:block; margin:6px 0 0; }

@media(max-width:767px) {
  .broccoli-controls { --bc-control-height:48px; --bc-control-padding:12px; --bc-control-font-size:16px; --bc-control-line-height:22px; }
  .broccoli-controls :is(input,textarea,select),
  .broccoli-controls .select2-container .select2-selection,
  .broccoli-controls .select2-results__option { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) {
  .broccoli-controls :is(input,textarea,select),
  .broccoli-controls .select2-container .select2-selection { transition:none; }
}
@media(forced-colors:active) {
  .broccoli-controls { --bc-control-surface:Canvas; --bc-control-ink:CanvasText; --bc-control-border:ButtonText; --bc-control-muted:GrayText; --bc-control-accent:Highlight; --bc-control-error:CanvasText; --bc-control-ring:Highlight; }
  .broccoli-controls input:is([type=radio],[type=checkbox]),
  .broccoli-controls select:not([multiple]):not([size]) { appearance:auto; -webkit-appearance:auto; background-image:none; }
  .broccoli-controls input:is([type=radio],[type=checkbox])::before { display:none; }
  .broccoli-controls :is(input,textarea,select)[aria-invalid=true],
  .broccoli-controls :is(.woocommerce-invalid,.is-invalid) :is(input,textarea,select,.select2-selection) { border-style:dashed; }
  .broccoli-controls .select2-results__option[aria-selected=true] { outline:1px solid Highlight; outline-offset:-2px; }
}
