/*! Wattif Checkout Blocks Styling
   Scope: WooCommerce Cart/Checkout Blocks
   Requires: ordering tokens in the main theme CSS bundle
   Notes:
   - Verify selectors in DevTools; Woo Blocks can evolve. Adjust selectors if markup differs.
   - Keep specificity low; avoid !important unless absolutely required.
*/

/* Global surface + type */
body.woocommerce-checkout,
body.woocommerce-cart {
  background: var(--background);
  color: var(--foreground);
}

/* Main container rhythm */
body.woocommerce-checkout .wc-block-components-main,
body.woocommerce-cart .wc-block-components-main {
  margin: 2rem auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 1024px) {
  body.woocommerce-checkout .wc-block-components-main,
  body.woocommerce-cart .wc-block-components-main {
    max-width: 80rem; /* ≈ max-w-7xl */
  }
}

/* Card-like wrappers */
.wc-block-components-card,
.wc-block-components-panel,
.wc-block-components-totals-wrapper,
.wc-block-checkout__sidebar,
.wc-block-checkout__form {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.75rem; /* rounded-xl */
}

/* Titles */
.wc-block-components-title,
.wc-block-checkout__heading,
.wc-block-components-panel__title {
  color: var(--foreground);
}

/* Inputs: text, textarea, select */
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-text-input select,
.wc-block-components-select select,
.wc-block-components-country-input select,
.wc-block-components-state-input select {
  width: 100%;
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  border-radius: 0.5rem; /* rounded-lg */
  padding: 0.5rem 0.75rem; /* px-3 py-2 */
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

/* Input focus (ring) */
.wc-block-components-text-input input:focus,
.wc-block-components-text-input textarea:focus,
.wc-block-components-text-input select:focus,
.wc-block-components-select select:focus,
.wc-block-components-country-input select:focus,
.wc-block-components-state-input select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

/* Placeholder color */
.wc-block-components-text-input ::placeholder {
  color: var(--muted-foreground);
}

/* Labels & headings */
.wc-block-components-text-input label,
.wc-block-components-form .wc-block-components-checkout-step__heading {
  color: var(--foreground);
}

/* Errors & notices */
.wc-block-components-validation-error,
.wc-block-components-error,
.wc-block-notice.is-error {
  color: var(--destructive-foreground);
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  border-color: var(--destructive);
}

.wc-block-notice {
  border-radius: 0.5rem;
}
.wc-block-notice.is-info {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border-color: var(--accent);
  color: var(--accent-foreground);
}
.wc-block-notice.is-success {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.wc-block-notice.is-error {
  background: color-mix(in oklab, var(--destructive) 12%, transparent);
  border-color: var(--destructive);
  color: var(--destructive-foreground);
}

/* Checkbox / radio (where native accent-color is supported) */
.wc-block-components-checkbox .wc-block-components-checkbox__input,
.wc-block-components-radio-control__input {
  accent-color: var(--primary);
}

/* Primary buttons */
.wc-block-components-button,
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  border-radius: 0.75rem; /* rounded-xl */
  padding: 0.75rem 1rem;  /* py-3 px-4 */
  font-weight: 600;
  text-decoration: none;
}
.wc-block-components-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover {
  filter: brightness(0.95);
}

/* Secondary buttons */
.wc-block-components-button.is-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--secondary);
}

/* Order summary/totals alignment with card surface */
.wc-block-components-order-summary,
.wc-block-components-order-summary-item,
.wc-block-components-totals-wrapper {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}
.wc-block-components-order-summary .wc-block-components-order-summary-item__value,
.wc-block-components-totals-item .wc-block-components-totals-item__value {
  color: var(--foreground);
}

/* Gentle spacing helpers */
.wc-block-components-form,
.wc-block-components-panel__content,
.wc-block-components-fields {
  gap: 0.75rem;
}
.wc-block-components-form .wc-block-components-text-input {
  margin-bottom: 0.75rem;
}
