/* HWP Coupon Modal 1.0.0: Houston Wallpapering brand (navy #224079, cream, Cormorant + Poppins, square corners) */

/* Native WooCommerce coupon UI is hidden ONLY once the script confirmed it can drive it. */
body.hwpcm-ready .woocommerce-form-coupon-toggle,
body.hwpcm-ready form.checkout_coupon,
body.hwpcm-ready .hwpcm-native-box {
	display: none !important;
}

/* ---------- Trigger ---------- */
.hwpcm-trigger-wrap {
	margin: 0 0 20px;
}
.hwpcm-trigger-wrap.hwpcm-at-checkout {
	display: flex;
	justify-content: center;
}
.hwpcm-trigger-wrap.hwpcm-at-cart {
	display: inline-block;
	margin: 0 10px 10px 0;
	vertical-align: middle;
}
.hwpcm-trigger {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 10px 20px;
	background: #f5f1e8;
	border: 1px dashed #224079;
	border-radius: 0;
	color: #224079;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .2s ease, border-color .2s ease;
}
.hwpcm-trigger:hover,
.hwpcm-trigger:focus-visible {
	background: #ece5d5;
	border-style: solid;
	color: #224079;
}
.hwpcm-trigger:focus-visible {
	outline: 2px solid #224079;
	outline-offset: 2px;
}
.hwpcm-trigger-icon {
	display: inline-flex;
	color: #224079;
}
.hwpcm-trigger-icon svg {
	width: 20px;
	height: 20px;
}
.hwpcm-trigger-text u {
	text-underline-offset: 3px;
	font-weight: 600;
}

/* ---------- Overlay + dialog ---------- */
html.hwpcm-lock,
html.hwpcm-lock body {
	overflow: hidden !important;
}
.hwpcm-overlay[hidden] {
	display: none !important;
}
.hwpcm-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 30, 52, 0.55);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .2s ease;
}
.hwpcm-overlay.is-open {
	opacity: 1;
}
.hwpcm-dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 44px 40px 36px;
	background: #fff;
	border-top: 4px solid #224079;
	border-radius: 0;
	box-shadow: 0 24px 60px rgba(20, 30, 52, 0.28);
	text-align: center;
	transform: translateY(12px) scale(.98);
	transition: transform .22s ease;
	font-family: Poppins, sans-serif;
}
.hwpcm-overlay.is-open .hwpcm-dialog {
	transform: none;
}
.hwpcm-close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	background: #224079;
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.hwpcm-close:hover,
.hwpcm-close:focus-visible {
	background: #18305c;
	color: #fff;
	transform: rotate(90deg);
}
.hwpcm-close:focus-visible {
	outline: 2px solid #224079;
	outline-offset: 3px;
}
.hwpcm-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 0 auto 14px;
	background: #f5f1e8;
	border-radius: 50%;
	color: #224079;
}
.hwpcm-title {
	margin: 0 0 8px;
	padding: 0;
	font-family: Poppins, sans-serif;
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	color: #224079;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.hwpcm-sub {
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.55;
	color: #6b6b6b;
}
.hwpcm-form {
	margin: 0;
	text-align: left;
}
.hwpcm-label {
	display: block;
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #224079;
}
.hwpcm-dialog .hwpcm-input {
	display: block;
	width: 100%;
	height: 56px;
	margin: 0;
	padding: 0 16px;
	background: #f5f1e8;
	border: 1px solid #e3dccb;
	border-radius: 0;
	box-shadow: none;
	font-family: Poppins, sans-serif;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #1d2b45;
	transition: border-color .2s ease, background-color .2s ease;
}
.hwpcm-dialog .hwpcm-input::placeholder {
	font-weight: 400;
	letter-spacing: .02em;
	text-transform: none;
	color: #9a9486;
}
.hwpcm-dialog .hwpcm-input:focus {
	outline: none;
	background: #fff;
	border-color: #224079;
}
.hwpcm-dialog .hwpcm-input.has-error {
	border-color: #b3261e;
	background: #fdf3f2;
}
.hwpcm-msg {
	min-height: 20px;
	margin: 8px 0 14px;
	font-size: 13px;
	line-height: 1.45;
}
.hwpcm-msg:empty {
	margin-bottom: 6px;
}
.hwpcm-msg.hwpcm-msg--error {
	color: #b3261e;
}
.hwpcm-msg.hwpcm-msg--success {
	color: #1f6f43;
	font-weight: 500;
}
.hwpcm-dialog .hwpcm-apply {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 20px;
	background: #224079;
	border: 0;
	border-radius: 0;
	color: #fff;
	font-family: Poppins, sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: none;
	cursor: pointer;
	transition: background-color .2s ease;
}
.hwpcm-dialog .hwpcm-apply:hover,
.hwpcm-dialog .hwpcm-apply:focus-visible {
	background: #18305c;
	color: #fff;
}
.hwpcm-dialog .hwpcm-apply:focus-visible {
	outline: 2px solid #224079;
	outline-offset: 3px;
}
.hwpcm-dialog .hwpcm-apply.hwpcm-busy {
	cursor: wait;
	opacity: .8;
}
.hwpcm-dialog.hwpcm-done .hwpcm-icon {
	background: #e5f2ea;
	color: #1f6f43;
}

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 600px) {
	.hwpcm-overlay {
		align-items: flex-end;
		padding: 0;
	}
	.hwpcm-dialog {
		max-width: none;
		max-height: 92vh;
		padding: 40px 22px calc(26px + env(safe-area-inset-bottom));
		transform: translateY(100%);
	}
	.hwpcm-title {
		font-size: 23px;
	}
	.hwpcm-dialog .hwpcm-input {
		font-size: 17px; /* >= 16px so iOS does not zoom */
	}
	.hwpcm-trigger-wrap.hwpcm-at-cart {
		display: block;
		margin: 0 0 12px;
	}
	.hwpcm-trigger-wrap.hwpcm-at-cart .hwpcm-trigger,
	.hwpcm-trigger-wrap.hwpcm-at-checkout .hwpcm-trigger {
		width: 100%;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hwpcm-overlay,
	.hwpcm-dialog,
	.hwpcm-close {
		transition: none;
	}
}

/* Woodmart styles form fields with strong selectors; keep the pop-up's own look. */
#hwpcm-modal .hwpcm-input {
	height: 56px !important;
	padding: 0 16px !important;
	background: #f5f1e8 !important;
	border: 1px solid #e3dccb !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
#hwpcm-modal .hwpcm-input:focus {
	background: #fff !important;
	border-color: #224079 !important;
}
#hwpcm-modal .hwpcm-input.has-error {
	background: #fdf3f2 !important;
	border-color: #b3261e !important;
}
