/**
 * @file dvc-cart-checkout.css
 * @description Crisp mini-cart drawer overlay fix, vertical space optimization,
 *              15:00 cart timer banner, and distraction-free COD-only checkout styling.
 */

/* ── 1. Fix Washed-Out / Ghosted #popup-fly-cart Overlay ([CART-01]) ── */
#popup-fly-cart,
#popup-fly-cart.loading,
#popup-fly-cart .fly-cart-wrap,
#popup-fly-cart .fly-cart-wrap.loading,
#popup-fly-cart .fly-cart-content,
#popup-fly-cart .fly-cart-body,
#popup-fly-cart .fly-cart-footer {
	opacity: 1 !important;
	filter: none !important;
	background-color: #ffffff !important;
}

#popup-fly-cart.loading::before,
#popup-fly-cart.loading::after,
#popup-fly-cart .fly-cart-wrap::before,
#popup-fly-cart .fly-cart-wrap::after,
#popup-fly-cart .blockUI.blockOverlay {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
}

#popup-fly-cart .fly-cart-header {
	position: relative !important;
}

#popup-fly-cart[data-dvc-updating="1"] .fly-cart-header::after {
	content: "" !important;
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	height: 2.5px !important;
	background: linear-gradient(90deg, #e06a84, #fb7185, #e06a84) !important;
	background-size: 200% 100% !important;
	animation: dvcFlyCartProgress 0.9s linear infinite !important;
	pointer-events: none !important;
	z-index: 5 !important;
}

@keyframes dvcFlyCartProgress {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ── 2. Mini-Cart Space, Broken Countdown & Duplicate Notice Cleanup ── */
.popup-fly-cart .cart-countdown-timer,
.woocommerce-cart .cart-countdown-timer,
.popup-fly-cart .fly-cart-countdown,
.popup-fly-cart .dvc-voucher-strip,
.woocommerce-notices-wrapper .woocommerce-message ~ .woocommerce-message {
	display: none !important;
}

.popup-fly-cart .fly-cart-body {
	min-height: 155px !important;
}

/* Kill pseudo-element collision ("Vận chuyểnShipment") and restore label size */
.cart-shipping th.cart-totals-label::before,
.cart-shipping th::before {
	content: none !important;
	display: none !important;
}

.woocommerce-checkout .cart-shipping th.cart-totals-label,
.woocommerce-cart .cart-shipping th.cart-totals-label,
.cart-shipping th {
	font-size: 14px !important;
	font-weight: 500 !important;
	color: #333333 !important;
}

/* Clean 15:00 sessionStorage cart timer banner */
.dvc-cart-timer-banner {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	background: #fff5f7 !important;
	border: 1px solid #f5b8c6 !important;
	color: #be185d !important;
	border-radius: 8px !important;
	padding: 9px 14px !important;
	margin: 0 0 14px 0 !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
}

.dvc-cart-timer-banner.is-mini {
	padding: 5px 10px !important;
	margin: 0 !important;
	font-size: 12px !important;
	border-radius: 6px !important;
	justify-content: flex-start !important;
}

.dvc-cart-timer-banner .dvc-timer-clock {
	font-variant-numeric: tabular-nums !important;
	font-weight: 700 !important;
	color: #9d174d !important;
}

/* ── 3. Distraction-Free Checkout Header & COD-Only Layout ([UX-05]) ── */
body.woocommerce-checkout:not(.woocommerce-order-received) #page-header,
body.woocommerce-checkout:not(.woocommerce-order-received) .page-title-bar,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce-form-login-toggle,
body.woocommerce-checkout:not(.woocommerce-order-received) .dvc-floating-contact,
body.woocommerce-checkout:not(.woocommerce-order-received) #page-mobile-tabs,
body.woocommerce-checkout:not(.woocommerce-order-received) .page-mobile-tabs {
	display: none !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) #billing_first_name_field,
body.woocommerce-checkout:not(.woocommerce-order-received) #billing_phone_field,
body.woocommerce-checkout:not(.woocommerce-order-received) #billing_address_1_field {
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 100% !important;
	float: none !important;
	clear: both !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.dvc-cs-size-select {
	padding-right: 20px !important;
}

.dvc-checkout-distraction-free-header {
	width: 100% !important;
	background: #ffffff !important;
	border-bottom: 1px solid #eceef2 !important;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.dvc-df-header-inner {
	max-width: 1120px !important;
	margin: 0 auto !important;
	padding: 14px 20px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 12px 20px !important;
	flex-wrap: wrap !important;
}

.dvc-df-brand {
	text-decoration: none !important;
	display: inline-flex !important;
	align-items: center !important;
}

.dvc-df-brand-name {
	font-size: 18px !important;
	font-weight: 700 !important;
	letter-spacing: 0.4px !important;
	color: #111827 !important;
	text-transform: uppercase !important;
}

.dvc-df-trust {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	color: #374151 !important;
	background: #fff5f7 !important;
	border: 1px solid #f5b8c6 !important;
	border-radius: 999px !important;
	padding: 5px 12px !important;
}

.dvc-df-back-link {
	font-size: 13.5px !important;
	font-weight: 600 !important;
	color: #4b5563 !important;
	text-decoration: none !important;
	transition: color 0.2s ease !important;
}

.dvc-df-back-link:hover {
	color: #e06a84 !important;
}

/* COD-only enforcement: hide single radio circle and belt-and-suspenders hide BACS */
#payment ul.wc_payment_methods li.payment_method_cod > input[type="radio"],
#payment ul.wc_payment_methods li.payment_method_bacs {
	display: none !important;
}

/* Checkout typography, inputs & primary CTA */
body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout {
	max-width: 1120px !important;
	margin: 22px auto 44px auto !important;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) .form-row input.input-text,
body.woocommerce-checkout:not(.woocommerce-order-received) .form-row textarea {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
	font-size: 15px !important;
	border: 1px solid #d1d5db !important;
	border-radius: 8px !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) .form-row input.input-text:focus,
body.woocommerce-checkout:not(.woocommerce-order-received) .form-row textarea:focus {
	border-color: #e06a84 !important;
	box-shadow: 0 0 0 3px rgba(224, 106, 132, 0.18) !important;
	outline: none !important;
}

.woocommerce-checkout #place_order,
#place_order {
	width: 100% !important;
	height: 52px !important;
	min-height: 52px !important;
	line-height: 50px !important;
	background: #e06a84 !important;
	border: 1px solid #e06a84 !important;
	color: #ffffff !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	border-radius: 8px !important;
	box-shadow: 0 4px 14px rgba(224, 106, 132, 0.28) !important;
}

.woocommerce-checkout #place_order:hover,
#place_order:hover {
	background: #d4506e !important;
	border-color: #d4506e !important;
}

.dvc-phone-helper {
	display: block;
	margin-top: 5px;
	font-size: 12.5px;
	line-height: 1.35;
	font-weight: 500;
}

.dvc-phone-helper.is-error { color: #dc2626; }
.dvc-phone-helper.is-valid { color: #047857; }

@media (min-width: 992px) {
	body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout > .row {
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: flex-start !important;
		gap: 28px !important;
		margin: 0 !important;
	}

	body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout > .row > [class*="col-"]:first-child,
	body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout > .row > [class*="col-"]:last-child {
		padding: 24px !important;
		background: #ffffff !important;
		border: 1px solid #eceef2 !important;
		border-radius: 12px !important;
	}

	body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout > .row > [class*="col-"]:first-child {
		flex: 0 0 calc(55% - 14px) !important;
		max-width: calc(55% - 14px) !important;
		width: calc(55% - 14px) !important;
	}

	body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-checkout > .row > [class*="col-"]:last-child {
		flex: 0 0 calc(45% - 14px) !important;
		max-width: calc(45% - 14px) !important;
		width: calc(45% - 14px) !important;
	}
}

@media (max-width: 991.98px) {
	.dvc-df-header-inner { padding: 12px 16px !important; }

	.dvc-df-trust {
		order: 3;
		width: 100%;
		justify-content: center;
		font-size: 12px !important;
	}

	body.woocommerce-checkout:not(.woocommerce-order-received) .form-row input.input-text,
	body.woocommerce-checkout:not(.woocommerce-order-received) .form-row textarea,
	body.woocommerce-checkout:not(.woocommerce-order-received) .form-row select {
		font-size: 16px !important;
	}
}

/* ── Mini-Cart & Cart Quantity Stepper Fix ([ - | qty | + ]) ── */
#popup-fly-cart div.quantity,
.woocommerce-mini-cart div.quantity,
.cart_list.product_list_widget div.quantity {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 96px !important;
	min-width: 96px !important;
	height: 32px !important;
	min-height: 32px !important;
	background-color: #f7f7f8 !important;
	border: 1px solid #d4d7dc !important;
	border-radius: 6px !important;
	overflow: hidden !important;
	margin: 0 10px 0 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

#popup-fly-cart div.quantity input.qty,
.woocommerce-mini-cart div.quantity input.qty,
.cart_list.product_list_widget div.quantity input.qty {
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	height: 30px !important;
	min-height: 30px !important;
	line-height: 30px !important;
	padding: 0 28px !important;
	margin: 0 !important;
	border: none !important;
	background: transparent !important;
	color: #111827 !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	text-align: center !important;
	box-shadow: none !important;
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

#popup-fly-cart div.quantity button.decrease,
#popup-fly-cart div.quantity button.increase,
.woocommerce-mini-cart div.quantity button.decrease,
.woocommerce-mini-cart div.quantity button.increase,
.cart_list.product_list_widget div.quantity button.decrease,
.cart_list.product_list_widget div.quantity button.increase {
	position: absolute !important;
	top: 0 !important;
	bottom: 0 !important;
	width: 28px !important;
	min-width: 28px !important;
	max-width: 28px !important;
	height: 100% !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	color: #221f20 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 3 !important;
	box-shadow: none !important;
	border-top: none !important;
	border-bottom: none !important;
	border-radius: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
}

#popup-fly-cart div.quantity button.decrease,
.woocommerce-mini-cart div.quantity button.decrease,
.cart_list.product_list_widget div.quantity button.decrease {
	left: 0 !important;
	right: auto !important;
	border-left: none !important;
	border-right: 1px solid #e2e5ea !important;
}

#popup-fly-cart div.quantity button.increase,
.woocommerce-mini-cart div.quantity button.increase,
.cart_list.product_list_widget div.quantity button.increase {
	right: 0 !important;
	left: auto !important;
	border-right: none !important;
	border-left: 1px solid #e2e5ea !important;
}

#popup-fly-cart div.quantity button.decrease:hover,
#popup-fly-cart div.quantity button.increase:hover,
.woocommerce-mini-cart div.quantity button.decrease:hover,
.woocommerce-mini-cart div.quantity button.increase:hover {
	background-color: #eceef2 !important;
	color: #e06a84 !important;
}

/* Cart Page (/cart/) Quantity Stepper */
.woocommerce-cart-form div.quantity {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 108px !important;
	height: 38px !important;
	min-height: 38px !important;
	background-color: #f7f7f8 !important;
	border: 1px solid #d4d7dc !important;
	border-radius: 6px !important;
	overflow: hidden !important;
	padding: 0 !important;
}

.woocommerce-cart-form div.quantity input.qty {
	width: 100% !important;
	height: 36px !important;
	min-height: 36px !important;
	line-height: 36px !important;
	padding: 0 32px !important;
	margin: 0 !important;
	border: none !important;
	background: transparent !important;
	color: #111827 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	text-align: center !important;
}

.woocommerce-cart-form div.quantity button.decrease,
.woocommerce-cart-form div.quantity button.increase {
	position: absolute !important;
	top: 0 !important;
	bottom: 0 !important;
	width: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	height: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	color: #221f20 !important;
	font-size: 17px !important;
	font-weight: 600 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 0 !important;
	z-index: 3 !important;
}

.woocommerce-cart-form div.quantity button.decrease {
	left: 0 !important;
	right: auto !important;
	border-right: 1px solid #e2e5ea !important;
}

.woocommerce-cart-form div.quantity button.increase {
	right: 0 !important;
	left: auto !important;
	border-left: 1px solid #e2e5ea !important;
}

#dvc-minicart-cross-sells select.dvc-cs-size-select,
select.dvc-cs-size-select {
	padding: 0 22px 0 6px !important;
	background-position: right 6px center !important;
	background-size: 9px auto !important;
	max-width: 90px !important;
}
