/* Product Inquiry for WooCommerce - frontend styles */

.pefw-hidden {
	display: none !important;
}

.pefw-enquiry-btn {
	margin-top: 10px;
}

.pefw-btn-loop {
	margin-top: 6px;
	font-size: 0.85em;
}

/* Modal */
#pefw-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#pefw-modal {
	background: #fff;
	border-radius: 8px;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px;
	position: relative;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

#pefw-modal h3 {
	margin: 0 0 16px;
}

#pefw-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 4px;
}

#pefw-close:hover {
	color: #000;
}

/* Product list inside modal */
#pefw-product-list {
	margin-bottom: 16px;
}

.pefw-product-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	background: #f6f6f6;
	border-radius: 4px;
	margin-bottom: 6px;
	font-size: 0.92em;
}

.pefw-product-item button {
	background: none;
	border: none;
	color: #b32d2e;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 2px 6px;
}

.pefw-empty-note {
	font-size: 0.9em;
	color: #666;
	background: #f6f6f6;
	padding: 10px 12px;
	border-radius: 4px;
}

/* Form */
#pefw-form p {
	margin: 0 0 12px;
}

#pefw-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 0.9em;
}

#pefw-form input[type="text"],
#pefw-form input[type="email"],
#pefw-form input[type="tel"],
#pefw-form textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}

#pefw-form .pefw-row {
	display: flex;
	gap: 12px;
}

#pefw-form .pefw-row p {
	flex: 1;
}

.pefw-req {
	color: #b32d2e;
}

.pefw-hp {
	position: absolute !important;
	left: -9999px !important;
}

.pefw-error {
	color: #b32d2e;
	font-size: 0.9em;
}

#pefw-success p {
	background: #edf7ed;
	border-left: 4px solid #46b450;
	padding: 14px 16px;
	border-radius: 4px;
}

/* "Added to inquiry list" toast */
#pefw-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100000;
	background: #1a7f37;
	color: #fff;
	padding: 12px 22px;
	border-radius: 6px;
	font-weight: 600;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	animation: pefw-toast-in 0.2s ease;
	display: flex;
	align-items: center;
	gap: 14px;
}

.pefw-toast-link {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 4px;
	padding: 4px 12px;
	font: inherit;
	font-size: 0.9em;
	cursor: pointer;
}

.pefw-toast-link:hover {
	background: rgba(255, 255, 255, 0.32);
}

@keyframes pefw-toast-in {
	from { opacity: 0; transform: translate(-50%, 10px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

/* In-popup link to past inquiries */
#pefw-view-history-wrap {
	margin-top: 14px;
	text-align: center;
	font-size: 0.9em;
}

/* Pulse the cart button when a product is added */
@keyframes pefw-pulse {
	0%   { transform: scale(1); }
	30%  { transform: scale(1.14); }
	55%  { transform: scale(0.96); }
	100% { transform: scale(1); }
}

.pefw-pulse {
	animation: pefw-pulse 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
	.pefw-pulse { animation: none; }
}

/* Shortcode inquiry badge — [andison_inquiry_badge], placeable anywhere */
.pefw-inquiry-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	position: relative;
	background: transparent;
	color: inherit;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 8px 16px;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	vertical-align: middle;
}

.pefw-inquiry-badge:hover {
	opacity: 0.85;
}

/* SVG mail icon — sized via width/height (font-size does not affect SVG) */
.pefw-inquiry-badge-icon {
	width: 19px;
	height: 19px;
	flex: 0 0 auto;
	vertical-align: middle;
}

/* Header variant — ready-made pill for the site header (no inline CSS needed).
   Use: [andison_inquiry_badge variant="header"] */
.pefw-inquiry-badge.pefw-badge-header {
	height: 48px;                 /* matches a typical header search bar */
	padding: 0 22px;
	background: #ffffff;
	color: #1f2a8a;               /* navy text, readable on the white pill */
	border: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;          /* keep the label on one line */
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pefw-inquiry-badge.pefw-badge-header:hover {
	background: #eef1ff;
	opacity: 1;
}

.pefw-inquiry-badge.pefw-badge-header .pefw-inquiry-badge-count {
	background: #e2401c;
	color: #fff;
}

@media (max-width: 1024px) {
	.pefw-inquiry-badge.pefw-badge-header {
		height: 42px;
		padding: 0 16px;
		font-size: 13px;
	}
}

.pefw-inquiry-badge-count {
	background: #e2401c;
	color: #fff;
	border-radius: 999px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
}

/* Floating inquiry-cart button */
#pefw-float {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99990;
	background: #333;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 18px;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

#pefw-float:hover {
	background: #000;
}

#pefw-float-count {
	background: #e2401c;
	border-radius: 999px;
	min-width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
}

/* Floating "My Inquiries" history button — sits to the left of the cart button */
#pefw-history-float {
	position: fixed;
	bottom: 24px;
	right: 92px;
	z-index: 99990;
	background: #2b6cb0;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 18px;
	font-size: 15px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

#pefw-history-float:hover {
	background: #1f4e80;
}

/* When the cart button is hidden, drop history into the corner slot. */
#pefw-float.pefw-hidden ~ #pefw-history-float {
	right: 24px;
}

/* History modal */
#pefw-history-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#pefw-history-modal {
	background: #fff;
	border-radius: 8px;
	max-width: 560px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px;
	position: relative;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

#pefw-history-modal h3 {
	margin: 0 0 16px;
}

#pefw-history-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 4px;
}

.pefw-history-item {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 12px;
}

.pefw-history-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.pefw-history-date {
	font-size: 0.85em;
	color: #666;
}

.pefw-status {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 9px;
	border-radius: 999px;
	white-space: nowrap;
}

.pefw-status-pending   { background: #fff3cd; color: #8a6100; }
.pefw-status-responded { background: #d8f0dd; color: #1a7f37; }
.pefw-status-closed    { background: #e2e2e2; color: #555; }

.pefw-history-products {
	margin: 0 0 8px;
	padding-left: 18px;
}

.pefw-history-products li {
	margin: 2px 0;
}

.pefw-history-message {
	margin: 6px 0 0;
	font-size: 0.92em;
	color: #444;
	white-space: pre-wrap;
}


/* v1.4 inquiry experience refresh */
.pefw-enquiry-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px 20px !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: #08cdb0 !important;
	color: #fff !important;
	font-weight: 750 !important;
	letter-spacing: .02em;
	box-shadow: 0 10px 24px rgba(8, 205, 176, .24);
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.pefw-enquiry-btn::before {
	content: '';
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	background: center / 20px 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
}

.pefw-enquiry-btn:hover {
	background: #06bda2 !important;
	color: #fff !important;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(8, 205, 176, .3);
}

.pefw-enquiry-btn:focus-visible,
#pefw-modal button:focus-visible,
#pefw-modal input:focus-visible,
#pefw-modal textarea:focus-visible {
	outline: 3px solid rgba(49, 25, 232, .24) !important;
	outline-offset: 3px;
}

#pefw-overlay,
#pefw-history-overlay {
	background: rgba(10, 18, 37, .72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	padding: 16px;
}

#pefw-modal,
#pefw-history-modal {
	width: min(620px, 100%);
	max-width: 620px;
	max-height: calc(100dvh - 32px);
	padding: 30px 32px 26px;
	border: 1px solid rgba(148, 163, 184, .24);
	border-radius: 20px;
	box-shadow: 0 28px 80px rgba(8, 15, 35, .32);
	scrollbar-gutter: stable;
	overscroll-behavior: contain;
}

#pefw-modal h3,
#pefw-history-modal h3 {
	margin: 0 52px 6px 0;
	color: #172033;
	font-size: clamp(24px, 3vw, 30px);
	line-height: 1.15;
	font-weight: 800;
}

.pefw-modal-intro {
	margin: 0 44px 22px 0;
	color: #647087;
	font-size: 14px;
	line-height: 1.55;
}

.pefw-section-label {
	margin: 0 0 7px;
	color: #465269;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

#pefw-close,
#pefw-history-close {
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 999px;
	background: #f1f4f8;
	color: #536078;
	font-size: 25px;
	transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

#pefw-close:hover,
#pefw-history-close:hover {
	background: #e8edf5;
	color: #172033;
	transform: rotate(4deg);
}

#pefw-product-list {
	margin-bottom: 20px;
}

.pefw-product-item,
.pefw-empty-note {
	border: 1px solid #e3e9f2;
	border-radius: 10px;
	background: #f7f9fc;
}

.pefw-product-item {
	min-height: 50px;
	padding: 10px 12px 10px 14px;
	font-weight: 650;
	color: #29354a;
}

.pefw-product-item button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 999px;
}

.pefw-product-item button:hover {
	background: #ffeaec;
}

#pefw-form p {
	margin: 0 0 15px;
}

#pefw-form label {
	margin-bottom: 6px;
	color: #273249;
	font-size: 13px;
	font-weight: 750;
}

#pefw-form input[type="text"],
#pefw-form input[type="email"],
#pefw-form input[type="tel"],
#pefw-form textarea {
	width: 100%;
	min-height: 48px;
	padding: 11px 13px;
	border: 1px solid #cfd7e4;
	border-radius: 10px;
	background: #fff;
	color: #172033;
	font-size: 15px;
	box-shadow: inset 0 1px 2px rgba(16, 24, 40, .03);
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

#pefw-form textarea {
	min-height: 122px;
	line-height: 1.5;
	resize: vertical;
}

#pefw-form input::placeholder,
#pefw-form textarea::placeholder {
	color: #99a3b4;
}

#pefw-form input:focus,
#pefw-form textarea:focus {
	border-color: #3119e8;
	box-shadow: 0 0 0 4px rgba(49, 25, 232, .1);
	background: #fff;
}

#pefw-form .pefw-row {
	gap: 14px;
}

.pefw-error {
	padding: 11px 13px;
	border: 1px solid #ffc8ce;
	border-radius: 9px;
	background: #fff1f2;
	color: #a6192e;
	font-weight: 650;
}

#pefw-form > p:last-child {
	position: sticky;
	bottom: -26px;
	z-index: 3;
	margin: 0;
	padding: 14px 0 2px;
	background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 14px);
}

#pefw-submit {
	width: 100%;
	min-height: 52px;
	border: 0;
	border-radius: 10px;
	background: #3119e8;
	color: #fff;
	font-weight: 800;
	letter-spacing: .02em;
	box-shadow: 0 11px 24px rgba(49, 25, 232, .2);
}

#pefw-submit:hover {
	background: #2512c4;
	color: #fff;
}

#pefw-submit:disabled {
	cursor: wait;
	opacity: .68;
}

#pefw-success p {
	padding: 18px 20px;
	border: 1px solid #a9e5bd;
	border-left: 5px solid #27a958;
	border-radius: 10px;
	background: #effbf3;
	color: #176a37;
	font-weight: 650;
}

#pefw-view-history-wrap {
	margin: 16px 0 0;
}

.pefw-history-item {
	border-color: #e2e8f1;
	border-radius: 11px;
	background: #fbfcfe;
	box-shadow: 0 4px 14px rgba(23, 32, 51, .04);
}

@media (max-width: 640px) {
	#pefw-overlay,
	#pefw-history-overlay {
		align-items: flex-end;
		padding: 0;
	}

	#pefw-modal,
	#pefw-history-modal {
		width: 100%;
		max-width: none;
		max-height: calc(100dvh - 10px);
		padding: 24px 18px 20px;
		border-radius: 20px 20px 0 0;
	}

	#pefw-modal h3,
	#pefw-history-modal h3 {
		font-size: 24px;
	}

	.pefw-modal-intro {
		margin-right: 36px;
	}

	#pefw-form .pefw-row {
		flex-direction: column;
		gap: 0;
	}

	#pefw-form input[type="text"],
	#pefw-form input[type="email"],
	#pefw-form input[type="tel"],
	#pefw-form textarea {
		font-size: 16px;
	}

	#pefw-form > p:last-child {
		bottom: -20px;
	}

	.pefw-enquiry-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pefw-enquiry-btn,
	#pefw-close,
	#pefw-history-close {
		transition: none;
	}
}
