/* Sitewide button controls driven by fdb_settings (body classes). */

:where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	--filmic-button-radius: 14px;
	--filmic-button-bg: #ff1e63;
	--filmic-button-text: #ffffff;
	--filmic-button-border: #ff1e63;
	--filmic-button-bg-hover: #ff2f7a;
	--filmic-button-text-hover: #ffffff;
	--filmic-button-border-hover: #ff2f7a;
	border-radius: var(--filmic-button-radius);
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff));
	background-color: transparent;
	color: var(--filmic-button-text);
	border-color: transparent;
}

:where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):hover {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-hover-start, #ff2f7a), var(--filmic-button-gradient-hover-end, #4aa0ff));
	background-color: transparent;
	color: var(--filmic-button-text-hover);
	border-color: transparent;
}

body.filmic-button-gradient-on :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff)) !important;
	background-color: transparent !important;
	color: var(--filmic-button-text, #ffffff) !important;
	border-color: transparent !important;
}

body.filmic-button-gradient-on :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):hover {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-hover-start, #ff2f7a), var(--filmic-button-gradient-hover-end, #4aa0ff)) !important;
	background-color: transparent !important;
	color: var(--filmic-button-text-hover, #ffffff) !important;
	border-color: transparent !important;
}

body.filmic-button-gradient-on .sharebar__btn,
body.filmic-button-gradient-on .ms-sidebar .ms-socicon a {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff)) !important;
	border-color: transparent !important;
}

body.filmic-button-gradient-on .single_add_to_cart_button,
body.filmic-button-gradient-on .woocommerce button.button,
body.filmic-button-gradient-on .woocommerce a.button,
body.filmic-button-gradient-on .wp-element-button {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff)) !important;
	background-color: transparent !important;
	color: var(--filmic-button-text, #ffffff) !important;
	border-color: transparent !important;
}

body.filmic-button-gradient-on .single_add_to_cart_button:hover,
body.filmic-button-gradient-on .woocommerce button.button:hover,
body.filmic-button-gradient-on .woocommerce a.button:hover,
body.filmic-button-gradient-on .wp-element-button:hover {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-hover-start, #ff2f7a), var(--filmic-button-gradient-hover-end, #4aa0ff)) !important;
	background-color: transparent !important;
	color: var(--filmic-button-text-hover, #ffffff) !important;
	border-color: transparent !important;
}

body.filmic-button-shape-pill :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	--filmic-button-radius: 999px;
}

body.filmic-button-shape-rounded :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	--filmic-button-radius: 14px;
}

body.filmic-button-shape-square :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	--filmic-button-radius: 8px;
}

body.filmic-button-shape-sharp :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	--filmic-button-radius: 0;
}

body.filmic-button-motion-none :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	transition: none !important;
	animation: none !important;
}

body.filmic-button-motion-none :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):is(:hover, :focus, :active) {
	transform: none !important;
}

body.filmic-button-motion-none :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
)::before,
body.filmic-button-motion-none :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
)::after {
	transition: none !important;
	animation: none !important;
}

body.filmic-button-motion-subtle :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	transition: filter .2s ease, box-shadow .2s ease;
}

body.filmic-button-motion-subtle :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):hover {
	filter: brightness(1.05);
}

body.filmic-button-motion-lift :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

body.filmic-button-motion-lift :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(2, 6, 23, .16);
}

body.filmic-button-motion-slide :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
) {
	position: relative;
	overflow: hidden;
	transition: filter .2s ease;
}

body.filmic-button-motion-slide :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
)::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 -130%;
	width: 120%;
	background: linear-gradient(100deg, transparent 15%, rgba(255,255,255,.34) 50%, transparent 85%);
	transition: left .35s ease;
}

body.filmic-button-motion-slide :where(
	.btn,
	.button,
	.wp-element-button,
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	a.button,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce #respond input#submit,
	.woocommerce .added_to_cart
):hover::after {
	left: 130%;
}

/* WooCommerce global visual consistency (cart/checkout/notices) */
.woocommerce-cart .cart_item .product-name a,
.woocommerce-checkout .woocommerce-checkout-review-order .product-name a {
	color: var(--color-contrast-higher, #111827) !important;
}

.woocommerce .woocommerce-message .button.wc-forward,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.woocommerce-checkout #place_order,
.woocommerce-checkout .woocommerce-form-coupon .button,
.woocommerce-checkout .woocommerce-checkout-review-order .button {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff)) !important;
	background-color: transparent !important;
	color: #ffffff !important;
	border-color: transparent !important;
}

.woocommerce .woocommerce-message .button.wc-forward:hover,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-checkout #place_order:hover,
.woocommerce-checkout .woocommerce-form-coupon .button:hover,
.woocommerce-checkout .woocommerce-checkout-review-order .button:hover {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-hover-start, #ff2f7a), var(--filmic-button-gradient-hover-end, #4aa0ff)) !important;
	background-color: transparent !important;
	color: #ffffff !important;
	border-color: transparent !important;
}

/* WooCommerce Blocks cart/checkout buttons */
.wc-block-components-button,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-components-totals-coupon__button,
.wc-block-components-checkout-return-to-cart-button {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-start, #ff1e63), var(--filmic-button-gradient-end, #2d8cff)) !important;
	background-color: transparent !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: var(--filmic-button-radius, 14px) !important;
	min-height: 48px !important;
	padding: 0 1.35rem !important;
	box-shadow: none !important;
}

.wc-block-components-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-components-totals-coupon__button:hover,
.wc-block-components-checkout-return-to-cart-button:hover {
	background-image: linear-gradient(var(--filmic-button-gradient-angle, 120deg), var(--filmic-button-gradient-hover-start, #ff2f7a), var(--filmic-button-gradient-hover-end, #4aa0ff)) !important;
	background-color: transparent !important;
	color: #ffffff !important;
	border: 0 !important;
}

.wc-block-components-button .wc-block-components-button__text,
.wc-block-cart__submit-button .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button .wc-block-components-button__text {
	color: #ffffff !important;
}

/* Add-to-cart lightbox */
.filmic-addcart-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}

.filmic-addcart-modal.is-open {
	display: flex;
}

.filmic-addcart-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, 0.52);
	backdrop-filter: blur(4px);
}

.filmic-addcart-modal__panel {
	position: relative;
	z-index: 2;
	width: min(92vw, 460px);
	background: #0f172a;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 16px;
	padding: 18px 18px 16px;
	color: #fff;
	box-shadow: 0 24px 50px rgba(2, 6, 23, 0.45);
}

.filmic-addcart-modal__close {
	position: absolute;
	right: 10px;
	top: 8px;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: rgba(255, 255, 255, 0.13);
}

.filmic-addcart-modal__title {
	margin: 0 32px 8px 0;
	font-size: 16px;
	font-weight: 700;
}

.filmic-addcart-modal__actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
}

/* Readability fixes for Woo cart/checkout text */
.woocommerce-cart table.shop_table th,
.woocommerce-cart .shop_table thead th,
.woocommerce-cart .shop_table .product-name,
.woocommerce-cart .shop_table .product-total,
.woocommerce-cart .cart-collaterals h2,
.woocommerce-cart .cart_totals h2 {
	color: #111827 !important;
}

.woocommerce-cart .cart_item .product-name a,
.woocommerce-cart .woocommerce-cart-form .cart_item .product-name a,
.woocommerce-cart .wc-block-cart-items .wc-block-cart-item__product .wc-block-components-product-name {
	color: #111827 !important;
}

/* Woo checkout/cart inputs should be light with dark text */
.woocommerce form .input-text,
.woocommerce form input[type="text"],
.woocommerce form input[type="email"],
.woocommerce form input[type="tel"],
.woocommerce form input[type="number"],
.woocommerce form textarea,
.woocommerce form select,
.wc-block-components-text-input input,
.wc-block-components-combobox-control input,
.wc-block-components-form .wc-block-components-text-input input,
.wc-block-components-form .wc-block-components-combobox-control input,
.wc-block-components-form .wc-block-components-textarea {
	background: #ffffff !important;
	color: #111827 !important;
	border: 1px solid #d1d5db !important;
}

.woocommerce form .input-text::placeholder,
.woocommerce form textarea::placeholder,
.wc-block-components-text-input input::placeholder,
.wc-block-components-combobox-control input::placeholder,
.wc-block-components-form .wc-block-components-textarea::placeholder {
	color: #6b7280 !important;
	opacity: 1 !important;
}
