/**
 * Koszyk i zamówienie — przyciski spójne z CTA „Zarezerwuj wizytę” (.blue-button).
 *
 * @package geness
 */

body.woocommerce-cart,
body.woocommerce-checkout {
	--geness-cta-bg: #2f3284;
	--geness-cta-color: #fff;
	--geness-cta-radius: 32px;
	--geness-cta-height: 55px;
	--geness-cta-min-width: 230px;
	--geness-cta-font-size: 16px;
	--geness-cta-font-weight: 300;
	--geness-cta-secondary-color: #2f3285;
}

/* --- Wspólny reset WC na CTA --- */

body.woocommerce-cart .checkout-button,
body.woocommerce-cart button[name="update_cart"],
body.woocommerce-cart button[name="apply_coupon"],
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button[name="apply_coupon"],
body.woocommerce-cart .wc-block-components-totals-coupon__button,
body.woocommerce-checkout .wc-block-components-totals-coupon__button,
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button,
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-button,
body.woocommerce-cart .wp-block-button.wc-block-components-product-button .wp-block-button__link,
body.woocommerce-cart .wc-block-components-product-button .wc-block-components-button {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 0.35s cubic-bezier(0.25, 1, 0.45, 1),
		opacity 0.35s ease,
		background-color 0.25s ease,
		color 0.25s ease,
		border-color 0.25s ease;
}

/* --- Primary: przejdź do kasy / złóż zamówienie --- */

body.woocommerce-cart .wc-proceed-to-checkout {
	text-align: center;
	padding-top: 28px;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button#place_order,
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button,
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-button,
body.woocommerce-cart .wp-block-button.wc-block-components-product-button .wp-block-button__link,
body.woocommerce-cart .wc-block-components-product-button .wc-block-components-button,
body.woocommerce-cart .wc-block-cart__empty-cart-products .wp-block-button__link,
body.woocommerce-cart a.add_to_cart_button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: var(--geness-cta-min-width);
	min-height: var(--geness-cta-height);
	padding: 0 32px !important;
	border: 0 !important;
	border-radius: var(--geness-cta-radius) !important;
	background: var(--geness-cta-bg) !important;
	color: var(--geness-cta-color) !important;
	font-size: var(--geness-cta-font-size) !important;
	font-weight: var(--geness-cta-font-weight) !important;
	text-align: center;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout button#place_order:hover,
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button:hover,
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-button:hover,
body.woocommerce-cart .wp-block-button.wc-block-components-product-button .wp-block-button__link:hover,
body.woocommerce-cart .wc-block-components-product-button .wc-block-components-button:hover,
body.woocommerce-cart .wc-block-cart__empty-cart-products .wp-block-button__link:hover,
body.woocommerce-cart a.add_to_cart_button:hover {
	opacity: 0.9;
	transform: translateY(-4px);
	color: var(--geness-cta-color) !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:focus-visible,
body.woocommerce-checkout #place_order:focus-visible,
body.woocommerce-checkout button#place_order:focus-visible {
	outline: 2px solid var(--geness-cta-secondary-color);
	outline-offset: 3px;
}

/* --- Secondary: aktualizuj koszyk, kupon --- */

body.woocommerce-cart .actions button[name="update_cart"],
body.woocommerce-cart .coupon button[name="apply_coupon"],
body.woocommerce-checkout .checkout_coupon button[name="apply_coupon"],
body.woocommerce-checkout button[name="apply_coupon"],
body.woocommerce-cart .wc-block-components-totals-coupon__button,
body.woocommerce-cart .wc-block-components-totals-coupon .wc-block-components-button,
body.woocommerce-checkout .wc-block-components-totals-coupon__button,
body.woocommerce-checkout .wc-block-components-totals-coupon .wc-block-components-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 45px;
	padding: 0 24px !important;
	border: 1px solid var(--geness-cta-secondary-color) !important;
	border-radius: var(--geness-cta-radius) !important;
	background: #fff !important;
	color: var(--geness-cta-secondary-color) !important;
	font-size: 13px !important;
	font-weight: 400 !important;
}

body.woocommerce-cart .actions button[name="update_cart"]:hover,
body.woocommerce-cart .coupon button[name="apply_coupon"]:hover,
body.woocommerce-checkout .checkout_coupon button[name="apply_coupon"]:hover,
body.woocommerce-checkout button[name="apply_coupon"]:hover,
body.woocommerce-cart .wc-block-components-totals-coupon__button:hover,
body.woocommerce-cart .wc-block-components-totals-coupon .wc-block-components-button:hover,
body.woocommerce-checkout .wc-block-components-totals-coupon__button:hover,
body.woocommerce-checkout .wc-block-components-totals-coupon .wc-block-components-button:hover {
	opacity: 0.95;
	transform: translateY(-3px);
	background: #fff !important;
	color: #252066 !important;
	border-color: #252066 !important;
}

body.woocommerce-cart .actions button[name="update_cart"]:focus-visible,
body.woocommerce-cart .coupon button[name="apply_coupon"]:focus-visible,
body.woocommerce-checkout .checkout_coupon button[name="apply_coupon"]:focus-visible,
body.woocommerce-cart .wc-block-components-totals-coupon__button:focus-visible,
body.woocommerce-checkout .wc-block-components-totals-coupon__button:focus-visible {
	outline: 2px solid var(--geness-cta-secondary-color);
	outline-offset: 2px;
}

/* --- Blok koszyka: pole kuponu (bez czarnego obrysu) --- */

body.woocommerce-cart .wc-block-components-totals-coupon__form input[type="text"],
body.woocommerce-checkout .wc-block-components-totals-coupon__form input[type="text"] {
	border: 1px solid #e0e0ec !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: #231f20;
	font-size: 14px;
}

body.woocommerce-cart .wc-block-components-totals-coupon__form input[type="text"]:focus,
body.woocommerce-checkout .wc-block-components-totals-coupon__form input[type="text"]:focus {
	border-color: var(--geness-cta-secondary-color) !important;
	outline: none;
	box-shadow: none;
}

/* --- Blok koszyka: ilość (bez „bąbelka” z obramowaniem) --- */

body.woocommerce-cart .wc-block-components-quantity-selector,
body.woocommerce-checkout .wc-block-components-quantity-selector {
	width: auto;
	min-width: 100px;
	background: #fff;
	border-radius: 16px;
}

body.woocommerce-cart .wc-block-components-quantity-selector::after,
body.woocommerce-checkout .wc-block-components-quantity-selector::after {
	display: none !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector__button,
body.woocommerce-checkout .wc-block-components-quantity-selector__button {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--geness-cta-secondary-color) !important;
	border-radius: 0 !important;
	min-height: auto !important;
	padding: 0.35em 0.5em !important;
	transform: none !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector__button:hover,
body.woocommerce-checkout .wc-block-components-quantity-selector__button:hover {
	opacity: 0.75;
	transform: none !important;
	background: transparent !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector__input,
body.woocommerce-checkout .wc-block-components-quantity-selector__input {
	font-weight: 500;
	color: #231f20;
}

/* Link „Wróć do sklepu” — dyskretny, bez pigułki primary */

body.woocommerce-cart a.button.wc-backward,
body.woocommerce-checkout a.button.wc-backward {
	display: inline-flex;
	align-items: center;
	min-height: auto;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--geness-cta-secondary-color) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

body.woocommerce-cart a.button.wc-backward:hover,
body.woocommerce-checkout a.button.wc-backward:hover {
	transform: none;
	opacity: 1;
	color: #252066 !important;
}

/* Payment box: place order na pełną szerokość kolumny (max jak CTA) */

body.woocommerce-checkout #payment #place_order {
	width: 100%;
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
	display: flex !important;
}

body.woocommerce-checkout #payment .form-row.place-order {
	text-align: center;
}

@media (max-width: 680px) {
	body.woocommerce-cart,
	body.woocommerce-checkout {
		--geness-cta-height: 50px;
		--geness-cta-font-size: 15px;
		--geness-cta-min-width: 200px;
	}

	body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
	body.woocommerce-checkout #payment #place_order {
		width: 100%;
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce-cart .checkout-button,
	body.woocommerce-cart button[name="update_cart"],
	body.woocommerce-cart button[name="apply_coupon"],
	body.woocommerce-checkout #place_order,
	body.woocommerce-checkout button[name="apply_coupon"],
	body.woocommerce-cart .wc-block-components-totals-coupon__button,
	body.woocommerce-cart .wp-block-button.wc-block-components-product-button .wp-block-button__link {
		transition: none;
	}

	body.woocommerce-cart .checkout-button:hover,
	body.woocommerce-checkout #place_order:hover,
	body.woocommerce-cart .actions button[name="update_cart"]:hover,
	body.woocommerce-cart .wp-block-button.wc-block-components-product-button .wp-block-button__link:hover {
		transform: none;
	}
}
