/**
 * Karfeil Product Enquiry - front-end styles.
 *
 * Tokens taken from the live staging site (Flatsome + Elementor):
 *   heading   Montserrat 700, gold  #d1ad72   (matches the "Contact us" panel)
 *   body      Lato 400,             #212121
 *   primary   navy                  #0f2747
 *   input     40px tall, 1px #69727d, square, inset 0 1px 2px rgba(0,0,0,.1)
 *   button    navy, radius 8px, 14px Lato, letter-spacing .42px, capitalize
 */

:root {
	--kpe-accent: #0f2747;
	--kpe-accent-hover: #d1ad72;
	--kpe-ink: #212121;
	--kpe-muted: #69727d;
	--kpe-line: #69727d;
	--kpe-line-soft: #e3e6ec;
	--kpe-surface: #ffffff;
	--kpe-surface-alt: #f4f5f7;
	--kpe-error: #b20000;
	--kpe-success: #627d47;
	--kpe-radius: 8px;
	--kpe-shadow: 0 26px 70px rgba(15, 39, 71, 0.3);
	--kpe-font-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--kpe-font-head: "Montserrat", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------- Button */

.kpe-enquire-button {
	cursor: pointer;
}

/* The loop button reuses Flatsome's own classes, so it only needs the reset
   that turns a <button> into the same box the theme styles an <a> as. */
.kpe-enquire-button--loop {
	display: inline-block;
	background: transparent;
	border: 0;
}

.kpe-enquire-button--single {
	min-width: 220px;
}

/* Hide the cart UI on enquiry-only product pages. */
.kpe-enquiry-single form.cart,
.kpe-enquiry-single .single_add_to_cart_button:not(.kpe-enquire-button),
.kpe-enquiry-single .sticky-add-to-cart,
.kpe-enquiry-single form.cart .quantity {
	display: none !important;
}

.kpe-single-wrap {
	margin: 0 0 1.5em;
}

/* ----------------------------------------------------------------- Modal */

.kpe-modal[hidden] {
	display: none;
}

.kpe-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	font-family: var(--kpe-font-body);
	font-size: 15px;
	line-height: 1.6;
	color: var(--kpe-ink);
	-webkit-font-smoothing: antialiased;
}

.kpe-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 22, 40, 0.6);
	animation: kpe-fade 0.22s ease both;
}

.kpe-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	margin: auto;
	background: var(--kpe-surface);
	border-radius: var(--kpe-radius);
	box-shadow: var(--kpe-shadow);
	animation: kpe-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
	overflow: hidden;
}

@keyframes kpe-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes kpe-rise {
	from { opacity: 0; transform: translateY(18px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.kpe-modal__overlay,
	.kpe-modal__dialog {
		animation: none;
	}
}

.kpe-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	line-height: 1;
	font-size: 26px;
	color: var(--kpe-muted);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.18s ease, background 0.18s ease;
}

.kpe-modal__close:hover,
.kpe-modal__close:focus {
	color: var(--kpe-accent);
	background: var(--kpe-surface-alt);
	outline: none;
}

/* --------------------------------------------------------------- Header */

.kpe-modal__header {
	padding: 30px 34px 0;
	background: var(--kpe-surface);
}

/* The gold rule under section headings, as used across the site. */
.kpe-modal__eyebrow {
	display: none;
}

.kpe-modal__title {
	position: relative;
	margin: 0 0 14px;
	padding-bottom: 12px;
	font-family: var(--kpe-font-head);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--kpe-accent-hover);
}

.kpe-modal__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 76px;
	height: 2px;
	background: var(--kpe-accent-hover);
}

.kpe-modal__intro {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--kpe-ink);
}

/* ----------------------------------------------------------------- Body */

.kpe-modal__body {
	padding: 20px 34px 32px;
}

.kpe-product {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	margin: 0 0 22px;
	background: var(--kpe-surface-alt);
	border-left: 3px solid var(--kpe-accent-hover);
}

.kpe-product[hidden] {
	display: none;
}

.kpe-product__media img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
}

.kpe-product__media img[hidden] {
	display: none;
}

.kpe-product__meta {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.kpe-product__label {
	font-size: 12px;
	line-height: 1.5;
	color: var(--kpe-muted);
}

.kpe-product__title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--kpe-accent);
}

.kpe-product__price {
	font-size: 14px;
	font-weight: 700;
	color: var(--kpe-ink);
}

.kpe-product__price:empty {
	display: none;
}

/* ---------------------------------------------------------------- Alerts */

.kpe-alert {
	margin: 0 0 18px;
	padding: 11px 14px;
	font-size: 14px;
	line-height: 1.5;
}

.kpe-alert[hidden] {
	display: none;
}

.kpe-alert--error {
	color: #7a1414;
	background: #fdecec;
	border: 1px solid #f3c9c9;
	border-left: 3px solid var(--kpe-error);
}

/* ------------------------------------------------------------------ Form */

.kpe-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 16px;
}

.kpe-field--full {
	grid-column: 1 / -1;
}

.kpe-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.kpe-field__label {
	margin: 0 0 5px;
	font-family: var(--kpe-font-body);
	font-size: 14.4px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
	color: var(--kpe-ink);
}

.kpe-field__required {
	margin-left: 3px;
	color: var(--kpe-error);
}

/* Matches the Elementor form fields used on Become a Distributor. */
.kpe-modal .kpe-field__control {
	width: 100%;
	max-width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 12px;
	font-family: var(--kpe-font-body);
	font-size: 15px;
	line-height: 1.4;
	color: var(--kpe-ink);
	background: #fff;
	border: 1px solid var(--kpe-line);
	border-radius: 0;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
	transition: border-color 0.16s ease, box-shadow 0.16s ease;
	-webkit-appearance: none;
	appearance: none;
}

.kpe-modal select.kpe-field__control {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2369727d' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px;
	padding-right: 34px;
}

.kpe-modal textarea.kpe-field__control {
	height: auto;
	min-height: 104px;
	padding: 9px 12px;
	border-radius: 3px;
	resize: vertical;
}

.kpe-modal .kpe-field__control::placeholder {
	color: #9aa1ab;
	opacity: 1;
}

.kpe-modal .kpe-field__control:focus {
	border-color: var(--kpe-accent);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(15, 39, 71, 0.1);
	outline: none;
}

.kpe-field.is-invalid .kpe-field__control {
	border-color: var(--kpe-error);
	background: #fffafa;
}

.kpe-field.is-invalid .kpe-field__control:focus {
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(178, 0, 0, 0.12);
}

.kpe-field__error {
	margin-top: 5px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--kpe-error);
}

.kpe-field__error[hidden] {
	display: none;
}

/* Flatsome sets `label { font-weight: bold }`, so state the weight explicitly. */
.kpe-field__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0;
	font-family: var(--kpe-font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	text-transform: none;
	color: var(--kpe-ink);
	cursor: pointer;
}

.kpe-field__checkbox span {
	font-weight: 400;
}

.kpe-field__checkbox input[type="checkbox"] {
	margin: 3px 0 0;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	accent-color: var(--kpe-accent);
}

.kpe-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --------------------------------------------------------------- Actions */

.kpe-form__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--kpe-line-soft);
}

/* Mirrors the site's "Send" / "Submit Enquiry" button. */
.kpe-modal .kpe-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 180px;
	height: 44px;
	margin: 0;
	padding: 0 26px;
	font-family: var(--kpe-font-body);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.42px;
	text-transform: capitalize;
	color: #fff;
	background: var(--kpe-accent);
	border: 1px solid var(--kpe-accent);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.kpe-modal .kpe-submit:hover:not(:disabled),
.kpe-modal .kpe-submit:focus:not(:disabled) {
	background: var(--kpe-accent-hover);
	border-color: var(--kpe-accent-hover);
	color: var(--kpe-accent);
	outline: none;
}

.kpe-modal .kpe-submit:active:not(:disabled) {
	transform: translateY(1px);
}

.kpe-modal .kpe-submit:disabled,
.kpe-modal .kpe-submit.is-loading {
	opacity: 0.72;
	cursor: progress;
}

.kpe-submit__spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: kpe-spin 0.7s linear infinite;
}

.kpe-submit.is-loading .kpe-submit__spinner {
	display: inline-block;
}

@keyframes kpe-spin {
	to { transform: rotate(360deg); }
}

.kpe-form__privacy {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--kpe-muted);
}

/* --------------------------------------------------------------- Success */

.kpe-success[hidden] {
	display: none;
}

.kpe-success {
	padding: 22px 8px 10px;
	text-align: center;
	animation: kpe-fade 0.25s ease both;
}

.kpe-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 66px;
	height: 66px;
	margin-bottom: 16px;
	color: var(--kpe-success);
	background: rgba(98, 125, 71, 0.1);
	border-radius: 50%;
}

.kpe-success__title {
	margin: 0 0 8px;
	font-family: var(--kpe-font-head);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--kpe-accent-hover);
}

.kpe-success__text {
	margin: 0 auto;
	max-width: 400px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--kpe-ink);
}

.kpe-success__ref {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--kpe-muted);
}

.kpe-success__ref:empty {
	display: none;
}

.kpe-modal .kpe-success__close {
	height: 44px;
	margin-top: 22px;
	padding: 0 26px;
	font-family: var(--kpe-font-body);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.42px;
	text-transform: capitalize;
	color: #fff;
	background: var(--kpe-accent);
	border: 1px solid var(--kpe-accent);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.kpe-modal .kpe-success__close:hover {
	background: var(--kpe-accent-hover);
	color: var(--kpe-accent);
}

/* ---------------------------------------------------------------- Mobile */

@media screen and (max-width: 600px) {
	.kpe-modal {
		padding: 0;
	}

	.kpe-modal__dialog {
		max-width: none;
		min-height: 100%;
		border-radius: 0;
	}

	.kpe-modal__header {
		padding: 26px 20px 0;
	}

	.kpe-modal__title {
		font-size: 25px;
	}

	.kpe-modal__body {
		padding: 18px 20px 28px;
	}

	.kpe-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.kpe-modal .kpe-submit {
		width: 100%;
	}
}

/* Lock background scrolling while the modal is open. */
body.kpe-modal-open {
	overflow: hidden;
}
