/**
 * Scherrer Winery — Site-wide Button Consistency
 *
 * Canonical button style:
 *   - Font:           Halant, 500 weight, 16px, 1.2px tracking, UPPERCASE
 *   - Line-height:    24px
 *   - Text color:     #ffffff
 *   - Background:     #6e1132 (hover: #530d25)
 *   - Border radius:  3px
 *   - Padding:        12px 24px
 *
 * Selectors are prefixed with `body` to exceed WooCommerce's stylesheet
 * specificity (which uses .woocommerce + tag + .class compound selectors
 * with !important). Without the body prefix our !important loses to
 * WooCommerce's !important due to lower specificity.
 *
 * EXCEPTIONS:
 *   - Add to Cart on single product (green, intentional)
 *   - Password visibility eye toggles
 *   - Quantity +/- buttons
 *   - Cart icon toggle button
 *   - WP admin bar buttons
 *
 * WCAG 2.1 AA:
 *   - 1.4.3 Contrast: white on #6e1132 = 8.2:1, on #530d25 = 12.4:1
 *   - 1.4.11 Non-text Contrast: focus outline >= 3:1
 *   - 2.4.7 Focus Visible: outline on :focus-visible
 */

/* ---------- Universal button rule ---------- */
body button[type="submit"],
body button[type="button"],
body input[type="submit"],
body input[type="button"],
body input[type="reset"],
body a.button,
body .woocommerce a.button,
body .woocommerce button.button,
body .woocommerce-Button.button,
body .woocommerce input.button,
body .woocommerce #respond input#submit,
body .woocommerce-page a.button,
body .woocommerce-page button.button,
body .woocommerce-page input.button {
    background-color: #6e1132 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 12px 24px !important;
    font-family: "Halant", serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 24px !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: inline-block;
}

body button[type="submit"]:hover,
body button[type="button"]:hover,
body input[type="submit"]:hover,
body input[type="button"]:hover,
body input[type="reset"]:hover,
body a.button:hover,
body .woocommerce a.button:hover,
body .woocommerce button.button:hover,
body .woocommerce-Button.button:hover,
body .woocommerce input.button:hover,
body .woocommerce #respond input#submit:hover,
body .woocommerce-page a.button:hover,
body .woocommerce-page button.button:hover,
body .woocommerce-page input.button:hover {
    background-color: #530d25 !important;
    color: #ffffff !important;
}

body button[type="submit"]:focus-visible,
body button[type="button"]:focus-visible,
body input[type="submit"]:focus-visible,
body input[type="button"]:focus-visible,
body input[type="reset"]:focus-visible,
body a.button:focus-visible,
body .woocommerce a.button:focus-visible,
body .woocommerce button.button:focus-visible,
body .woocommerce-Button.button:focus-visible,
body .woocommerce input.button:focus-visible,
body .woocommerce #respond input#submit:focus-visible,
body .woocommerce-page a.button:focus-visible,
body .woocommerce-page button.button:focus-visible,
body .woocommerce-page input.button:focus-visible {
    background-color: #530d25 !important;
    color: #ffffff !important;
    outline: 2px solid #6e1132;
    outline-offset: 2px;
}

/* ---------- Exceptions ---------- */

/* Add to Cart on single product (intentionally green) */
body .single-product .single_add_to_cart_button {
    background-color: #276327 !important;
    color: #ffffff !important;
}

body .single-product .single_add_to_cart_button:hover,
body .single-product .single_add_to_cart_button:focus-visible {
    background-color: #1f4f1f !important;
    color: #ffffff !important;
}

/* WordPress admin bar — leave alone */
#wpadminbar button,
#wpadminbar input[type="submit"] {
    all: revert;
}

/* Password visibility toggles (eye icons) — leave alone */
.show-password-input,
button.show-password-input {
    all: revert;
    cursor: pointer;
}

/* Quantity +/- buttons on cart/product pages — leave alone */
.quantity .qty-plus,
.quantity .qty-minus,
.quantity button.plus,
.quantity button.minus,
input.qty {
    all: revert;
}

/* Elementor's cart icon toggle button — leave alone */
.elementor-menu-cart__toggle button,
.elementor-menu-cart__toggle .elementor-button {
    all: revert;
}
