/* ========== Base form controls ========== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  background: var(--wp--preset--color--background);
  color: var(--wp--preset--color--body);
  line-height: 1.4;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="number"] {
  max-width: 90px;
}

/* Focus state */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 25%, transparent);
}

/* Disabled state */
input[disabled],
select[disabled],
textarea[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* Placeholder */
::placeholder {
  color: var(--wp--preset--color--muted);
}

/* ========== Select (dropdown) ========== */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--wp--preset--color--muted) 50%),
    linear-gradient(135deg, var(--wp--preset--color--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%,
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
  padding-right: 2.25em;
}

/* ========== Checkboxes & radios ========== */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--wp--preset--color--primary);
}

/* ========== Buttons (match theme.json) ========== */
button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wp-element-button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 10px 18px;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease, box-shadow .15s ease;
}

button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
  background: var(--wp--preset--color--accent);
}

button:disabled,
input[type="submit"]:disabled,
.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled,
.wp-element-button:disabled,
.wp-block-button__link:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* ========== WooCommerce product form bits ========== */
.woocommerce div.product form.cart .variations select {
  max-width: 520px;
}

.woocommerce div.product form.cart .quantity input.qty {
  width: 80px;
  text-align: center;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--wp--preset--color--body);
  font-weight: 700;
}

/* Space things nicely */
.woocommerce div.product form.cart > * + * { margin-top: .75rem; }

/* Make the add to basket button full-ish width on narrow layouts */
@media (max-width: 640px) {
  .woocommerce div.product form.cart .button {
    width: 100%;
  }
}

/* ========== Woo notices ========== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 8px;
  border: 1px solid var(--wp--preset--color--border);
  background: color-mix(in srgb, var(--wp--preset--color--primary) 6%, #fff);
}
.woocommerce-error { background: color-mix(in srgb, #d0021b 6%, #fff); }
