/**
 * EliteGlow QA fixes
 */

/* Mobile bottom nav — keep icons aligned on iOS (cart badge was shifting the bag up) */
.goal-footer-mobile > ul {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	width: 100%;
}

.goal-footer-mobile > ul > li {
	flex: 1 1 0;
	padding: 0 6px !important;
	vertical-align: top;
}

.goal-footer-mobile > ul > li > a {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 4px;
	min-height: 44px;
	line-height: 1 !important;
	text-decoration: none;
}

.goal-footer-mobile > ul > li > a > i,
.goal-footer-mobile .footer-nav-icon {
	display: flex !important;
	align-items: center;
	justify-content: center;
	position: relative;
	height: 22px;
	width: 28px;
	margin: 0 !important;
	line-height: 1 !important;
	flex: 0 0 22px;
}

.goal-footer-mobile .footer-mini-cart.mini-cart,
.goal-footer-mobile .mini-cart {
	margin-top: 0 !important;
	line-height: 1 !important;
	padding: 0 !important;
}

.goal-footer-mobile .mini-cart .count,
.goal-footer-mobile .footer-mini-cart .count {
	position: absolute !important;
	top: -7px !important;
	right: -9px !important;
	left: auto !important;
	bottom: auto !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px !important;
	line-height: 1 !important;
	z-index: 2;
	pointer-events: none;
}

.goal-footer-mobile > ul > li span.footer-nav-label,
.goal-footer-mobile > ul > li > a > span:not(.count):not(.footer-nav-icon) {
	display: block;
	font-size: 10px;
	line-height: 1;
	margin: 0;
}

/* 1. Mobile sticky add-to-cart bar */
@media (max-width: 768px) {
	.mc-bar {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		background: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 10px 12px;
		z-index: 900;
		border-top: 1px solid #eee;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
	}

	body.single-product {
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}

	.mc-left {
		display: flex;
		gap: 10px;
		align-items: center;
		max-width: 62%;
		min-width: 0;
	}

	.mc-left img {
		width: 45px;
		height: 45px;
		object-fit: cover;
		border-radius: 6px;
		flex-shrink: 0;
	}

	.mc-name {
		font-size: 12px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.mc-price {
		font-weight: 700;
		font-size: 14px;
	}

	.mc-btn {
		background: #111;
		color: #fff !important;
		padding: 10px 14px;
		border: none;
		border-radius: 4px;
		font-weight: 600;
		font-size: 13px;
		line-height: 1.2;
		flex-shrink: 0;
	}
}

/* 3. Checkout / cart: floating widgets vs payment controls */
body.woocommerce-checkout,
body.woocommerce-cart {
	padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

body.woocommerce-checkout .goal-footer-mobile,
body.woocommerce-cart .goal-footer-mobile {
	z-index: 120;
}

body.woocommerce-checkout #payment,
body.woocommerce-checkout .woocommerce-checkout-payment,
body.woocommerce-checkout .wc_payment_methods,
body.woocommerce-checkout .payment_methods {
	position: relative;
	z-index: 300;
}

/* Stripe hides wallet <li> via .hide() when canMakePayment fails — keep them visible */
body.woocommerce-checkout li.payment_method_stripe_googlepay,
body.woocommerce-checkout li.payment_method_stripe_applepay {
	display: list-item !important;
	visibility: visible !important;
}

body.woocommerce-checkout li.payment_method_stripe_googlepay .payment_box,
body.woocommerce-checkout li.payment_method_stripe_applepay .payment_box {
	overflow: visible !important;
}

body.woocommerce-checkout li.payment_method_stripe_googlepay input:checked ~ .payment_box,
body.woocommerce-checkout li.payment_method_stripe_applepay input:checked ~ .payment_box {
	display: block !important;
}

/* Stripe Google Pay / Apple Pay — express banner + wallet payment boxes */
body.woocommerce-checkout .wc-stripe-banner-checkout {
	display: block !important;
	visibility: visible !important;
	margin: 0 0 24px;
	width: 100%;
}

/* Hide Express Checkout when cart is empty / no amount */
body.woocommerce-checkout.eliteglow-cart-empty .wc-stripe-banner-checkout,
body.woocommerce-checkout.eliteglow-cart-empty .eliteglow-express-checkout-near-payment,
body.woocommerce-cart.eliteglow-cart-empty .wc-stripe-banner-checkout,
body.woocommerce-checkout .wc-stripe-banner-checkout.eliteglow-hide-empty-express,
body.woocommerce-cart .wc-stripe-banner-checkout.eliteglow-hide-empty-express,
body.woocommerce-checkout .eliteglow-express-checkout-near-payment.eliteglow-hide-empty-express {
	display: none !important;
}

body.woocommerce-checkout .wc-stripe-banner-checkout fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

body.woocommerce-checkout .wc-stripe-banner-checkout .banner-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	color: #222;
}

body.woocommerce-checkout .wc_stripe_checkout_banner_gateways {
	display: flex !important;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.woocommerce-checkout .wc_stripe_checkout_banner_gateways > li {
	flex: 1 1 100%;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.woocommerce-checkout .wc-stripe-banner-checkout .banner-divider {
	display: block;
	margin: 18px 0 0;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: #777;
}

body.woocommerce-checkout .banner_payment_method_stripe_googlepay,
body.woocommerce-checkout .banner_payment_method_stripe_applepay,
body.woocommerce-checkout .banner_payment_method_stripe_googlepay iframe,
body.woocommerce-checkout .banner_payment_method_stripe_applepay iframe,
body.woocommerce-checkout .banner_payment_method_stripe_googlepay .StripeElement,
body.woocommerce-checkout .banner_payment_method_stripe_applepay .StripeElement {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	min-height: 48px !important;
	max-width: 100% !important;
}

body.woocommerce-checkout .wc-stripe-banner-checkout:not(.active) .wc_stripe_checkout_banner_gateways > li:empty {
	min-height: 48px !important;
}

body.woocommerce-checkout .wc-stripe-banner-checkout:not(.active) .banner-divider {
	display: block !important;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .eliteglow-express-checkout-near-payment {
		display: none !important;
	}
}

body.woocommerce-checkout .payment_box .wc-stripe-upe-element,
body.woocommerce-checkout .payment_box.payment_method_stripe_link {
	display: block !important;
	visibility: visible !important;
	overflow: visible !important;
}

body.woocommerce-checkout #wc-stripe-googlepay-container:empty,
body.woocommerce-checkout #wc-stripe-applepay-container:empty {
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

body.woocommerce-checkout #wc-stripe_googlepay-checkout-button,
body.woocommerce-checkout #wc-stripe-googlepay-checkout-button,
body.woocommerce-checkout #wc-stripe_applepay-checkout-button,
body.woocommerce-checkout #wc-stripe-applepay-checkout-button {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	min-height: 48px !important;
	overflow: visible !important;
}

body.woocommerce-checkout #wc-stripe_googlepay-checkout-button:empty,
body.woocommerce-checkout #wc-stripe-googlepay-checkout-button:empty,
body.woocommerce-checkout #wc-stripe_applepay-checkout-button:empty,
body.woocommerce-checkout #wc-stripe-applepay-checkout-button:empty,
body.woocommerce-checkout .payment_method_stripe_googlepay .wc-stripe-googlepay-checkout-button:empty,
body.woocommerce-checkout .payment_method_stripe_applepay .wc-stripe-applepay-checkout-button:empty {
	display: block !important;
	visibility: visible !important;
	min-height: 48px !important;
	opacity: 1 !important;
}

body.woocommerce-checkout .wc-stripe-wallet-mount-placeholder {
	display: block !important;
	min-height: 48px !important;
	width: 100% !important;
}

body.woocommerce-checkout #wc-stripe_googlepay-checkout-button iframe,
body.woocommerce-checkout #wc-stripe-googlepay-checkout-button iframe,
body.woocommerce-checkout #wc-stripe_applepay-checkout-button iframe,
body.woocommerce-checkout #wc-stripe-applepay-checkout-button iframe,
body.woocommerce-checkout #wc-stripe_googlepay-checkout-button .StripeElement,
body.woocommerce-checkout #wc-stripe-googlepay-checkout-button .StripeElement,
body.woocommerce-checkout #wc-stripe_applepay-checkout-button .StripeElement,
body.woocommerce-checkout #wc-stripe-applepay-checkout-button .StripeElement {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	min-height: 48px !important;
	max-width: 100% !important;
}

body.woocommerce-checkout .payment_method_stripe_googlepay .payment_box,
body.woocommerce-checkout .payment_method_stripe_applepay .payment_box {
	padding: 8px 0 0 !important;
	min-height: 0;
	border: 0 !important;
	background: transparent !important;
}

body.woocommerce-checkout .payment_box .wc-stripe-upe-element iframe,
body.woocommerce-checkout .wc_stripe_checkout_banner_gateways iframe {
	min-height: 44px !important;
	max-width: 100% !important;
}

body.woocommerce-checkout .payment_methods .payment_box {
	overflow: visible !important;
}

body.woocommerce-checkout .payment_method_stripe_googlepay .wc-stripe-upe-element,
body.woocommerce-checkout .payment_method_stripe_applepay .wc-stripe-upe-element,
body.woocommerce-checkout .wc-custom-place-order-button,
body.woocommerce-checkout .wc-custom-place-order-button > div {
	display: block !important;
	width: 100% !important;
}

body.woocommerce-checkout .payment_method_stripe_googlepay .gpay-button-container,
body.woocommerce-checkout .payment_method_stripe_googlepay .gpay-card-info-container {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	min-height: 48px !important;
	max-width: 100% !important;
	opacity: 1 !important;
}

body.woocommerce-checkout .payment_method_stripe_applepay .apple-pay-button,
body.woocommerce-checkout .payment_method_stripe_applepay button.apple-pay-button,
body.woocommerce-checkout .payment_method_stripe_applepay button.banner-checkout,
body.woocommerce-checkout .payment_method_stripe_applepay .payment_box > button {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	min-height: 48px !important;
	max-width: 100% !important;
	opacity: 1 !important;
	margin: 0 !important;
}

body.woocommerce-checkout .payment_method_stripe_googlepay .wc-stripe-gateway-container,
body.woocommerce-checkout .payment_method_stripe_applepay .wc-stripe-gateway-container {
	display: block !important;
	visibility: visible !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

body.woocommerce-checkout.eliteglow-gpay-unavailable form.checkout #place_order,
body.woocommerce-checkout.eliteglow-wallet-unavailable form.checkout #place_order {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

body.woocommerce-checkout .eliteglow-wallet-unavailable-notice {
	margin: 0 0 12px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.45;
}

body.woocommerce-checkout .eliteglow-wallet-loading-notice,
body.woocommerce-checkout .eliteglow-wallet-timeout-notice,
body.woocommerce-checkout .eliteglow-applepay-device-notice {
	margin: 0 0 12px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.45;
}

@media (max-width: 767px) {
	body.woocommerce-checkout .payment_method_stripe_googlepay .payment_box,
	body.woocommerce-checkout .payment_method_stripe_applepay .payment_box {
		padding: 8px 0 0 !important;
	}

	body.woocommerce-checkout .payment_method_stripe_googlepay .gpay-button-container,
	body.woocommerce-checkout .payment_method_stripe_googlepay .gpay-button-container button,
	body.woocommerce-checkout .payment_method_stripe_applepay .apple-pay-button,
	body.woocommerce-checkout .payment_method_stripe_applepay button.apple-pay-button {
		width: 100% !important;
		min-height: 52px !important;
	}
}

/* Hide legacy wallet notices — Stripe plugin owns wallet UI */
body.woocommerce-checkout .eliteglow-wallet-timeout-notice,
body.woocommerce-checkout .eliteglow-applepay-device-notice,
body.woocommerce-checkout .eliteglow-express-pay-label {
	display: none !important;
}

body.woocommerce-checkout .eliteglow-wallet-loading-notice,
body.woocommerce-checkout .eliteglow-wallet-unavailable-notice {
	margin: 10px 0 0;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	border-radius: 4px;
}

body.woocommerce-checkout .eliteglow-wallet-loading-notice {
	color: #055160;
	background: #cff4fc;
	border: 1px solid #b6effb;
}

body.woocommerce-checkout .eliteglow-wallet-unavailable-notice {
	color: #664d03;
	background: #fff3cd;
	border: 1px solid #ffecb5;
}

body.woocommerce-checkout .eliteglow-express-checkout-near-payment {
	margin: 0 0 16px;
}

body.woocommerce-checkout .eliteglow-express-checkout-near-payment .wc-stripe-banner-checkout {
	margin: 0;
	padding: 12px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 8px;
}

@media (max-width: 767px) {
	body.woocommerce-checkout .wc-stripe-banner-checkout {
		margin-bottom: 16px;
		padding: 12px;
		background: #f8f9fa;
		border: 1px solid #e9ecef;
		border-radius: 8px;
	}

	body.woocommerce-checkout .wc-stripe-banner-checkout .banner-title {
		font-size: 14px;
		font-weight: 600;
	}
}

body.woocommerce-checkout .ht_ctc_style,
body.woocommerce-checkout .ht-ctc,
body.woocommerce-checkout .ht_ctc_chat_style,
body.woocommerce-checkout #ht-ctc-chat {
	display: none !important;
}

body.woocommerce-cart .ht_ctc_style,
body.woocommerce-cart .ht-ctc,
body.woocommerce-cart .ht_ctc_chat_style,
body.woocommerce-cart #ht-ctc-chat {
	z-index: 150 !important;
	bottom: 72px !important;
}

body.single-product .ht_ctc_style,
body.single-product .ht-ctc,
body.single-product .ht_ctc_chat_style,
body.single-product #ht-ctc-chat {
	z-index: 850 !important;
	bottom: 72px !important;
}

/* 8. Scroll-to-top vs WhatsApp — separate corners on mobile */
@media (max-width: 767px) {
	.add-fix-top {
		left: 12px !important;
		right: auto !important;
		bottom: 78px;
		z-index: 800;
	}

	.ht_ctc_style,
	.ht-ctc,
	.ht_ctc_chat_style,
	#ht-ctc-chat {
		bottom: 78px !important;
		right: 12px !important;
		z-index: 850 !important;
	}
}

/* 4. COD estimate on cart */
.eliteglow-cod-estimate {
	margin: 0;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	background: #fff8e6;
	border: 1px solid #f0dfa8;
	border-radius: 6px;
	color: #5c4a00;
}

/* 5. Terms checkbox — inline label on mobile, tame error box */
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required {
	margin-bottom: 1em;
	padding: 0;
	background: transparent;
	border: none;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required label.woocommerce-form__label-for-checkbox {
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start !important;
	gap: 10px;
	text-align: start;
	cursor: pointer;
	font-weight: 400;
	line-height: 1.4;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required .woocommerce-form__input-checkbox {
	flex-shrink: 0;
	margin: 2px 0 0 !important;
	width: auto !important;
	float: none !important;
	position: static !important;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required.woocommerce-invalid {
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required.woocommerce-invalid label.woocommerce-form__label-for-checkbox {
	outline: 2px solid #e2401c;
	outline-offset: 2px;
	border-radius: 4px;
	padding: 4px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text {
	flex: 1 1 auto;
	min-width: 0;
}

/* 6. Cart line pricing clarity */
.eliteglow-cart-price-label,
.eliteglow-cart-qty-label,
.eliteglow-cart-line-total-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #888;
	margin-bottom: 2px;
}

.eliteglow-cart-line-total-label {
	color: #222;
}

.woocommerce-cart-form .product-name .eliteglow-cart-line-total {
	display: block;
	margin-top: 8px;
	font-weight: 700;
	font-size: 15px;
}

@media (max-width: 768px) {
	.woocommerce-cart-form .shop_table_responsive tr.cart_item td.product-price::before {
		content: attr(data-title) ": ";
		font-weight: 600;
	}

	.woocommerce-cart-form .shop_table_responsive tr.cart_item td.product-subtotal::before {
		content: attr(data-title) ": ";
		font-weight: 600;
	}
}

/* 7. Add to cart loading state — readable contrast */
.woocommerce div.product form.cart .single_add_to_cart_button.loading,
.woocommerce div.product form.cart .single_add_to_cart_button.added,
.add-to-cart-bottom-wrapper .cart button.single_add_to_cart_button.loading {
	opacity: 1 !important;
	color: #fff !important;
	background-color: #111 !important;
	border-color: #111 !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button.loading::before {
	background: rgba(0, 0, 0, 0.15) !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button.loading::after {
	color: #fff !important;
}

/* View Cart on shop loops — keep link clickable above theme ::before overlays */
.add-cart a.added_to_cart,
.add-cart a.eliteglow-view-cart-link {
	position: relative;
	z-index: 2;
	pointer-events: auto;
	cursor: pointer;
}

.add-cart a.added_to_cart::before,
.add-cart a.eliteglow-view-cart-link::before {
	pointer-events: none;
}

/* Fallback when lazy-load JS fails — show product images instead of blank cards */
body.eliteglow-lazy-fallback.image-lazy-loading .image-wrapper img,
body.eliteglow-lazy-fallback.image-lazy-loading .product-image img,
body.eliteglow-lazy-fallback .unveil-image {
	opacity: 1 !important;
	visibility: visible !important;
}
