/*
 * Low-specificity field and native choice-control contract.
 * Component styles may retain layout ownership while inheriting this visual base.
 */
:root {
  --storefront-field-background: var(--storefront-color-surface, #fff);
  --storefront-field-border: var(--storefront-color-field-border, #c7c7c7);
  --storefront-field-color: var(--storefront-color-ink, #232323);
  --storefront-field-focus: var(--storefront-color-focus, #232323);
  --storefront-field-error: var(--storefront-color-error, #e95144);
  --storefront-field-disabled: var(--storefront-color-muted-surface, #fafafa);
}

body.storefront-field-system
  :where(
    input.input-text,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ):where(:not(.qty):not(.wc-block-components-quantity-selector__input)) {
  box-sizing: border-box;
  min-height: var(--storefront-field-height, 44px);
  padding: var(--storefront-field-padding, 9px 12px);
  border: 1px solid var(--storefront-field-border);
  border-radius: var(--storefront-field-radius, 0);
  outline: 0;
  background: var(--storefront-field-background);
  box-shadow: none;
  color: var(--storefront-field-color);
  font: 400 13px/22px var(--storefront-font-ui, "Montserrat", Arial, sans-serif);
  transition: var(--storefront-field-transition, border-color 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease);
}

body.storefront-field-system textarea {
  height: auto;
  min-height: 120px;
  resize: vertical;
}

body.storefront-field-system
  :where(
    input.input-text,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ):where(:not(.qty):not(.wc-block-components-quantity-selector__input)):focus {
  border-color: var(--storefront-field-focus);
  outline: 0;
  box-shadow: 0 0 0 1px var(--storefront-field-focus);
}

body.storefront-field-system
  :where(
    input.input-text,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ):where(:disabled, [disabled], [readonly]) {
  background: var(--storefront-field-disabled);
  cursor: not-allowed;
  opacity: 1;
}

body.storefront-field-system
  :where(
    input.input-text,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ):where([aria-invalid="true"], .has-error),
body.storefront-field-system .woocommerce-invalid :where(input, select, textarea) {
  border-color: var(--storefront-field-error);
}

body.storefront-field-system :where(input, textarea)::placeholder {
  color: #6f6f6f;
  opacity: 1;
}

body.storefront-field-system :where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--storefront-color-control-primary, #6e0087);
}

body.storefront-field-system :where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 2px solid var(--storefront-color-focus, #232323);
  outline-offset: 2px;
}
