/**
 * Quote Request Modal — Styles
 *
 * Lightweight, dependency-free modal styling.
 * Color scheme: #17a2b8 (site primary) / #13899c (hover)
 */

/* ─── Modal Overlay ────────────────────────────────────────────────────────── */

.cqp-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cqp-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

/* Prevent body scroll when modal is open */
body.cqp-modal-open {
	overflow: hidden;
}

/* ─── Modal Container ──────────────────────────────────────────────────────── */

.cqp-modal-container {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 8px;
	width: 90%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: cqp-modal-in 0.2s ease-out;
}

@keyframes cqp-modal-in {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ─── Modal Header ─────────────────────────────────────────────────────────── */

.cqp-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid #e5e7eb;
	background: #17a2b8;
	border-radius: 8px 8px 0 0;
}

.cqp-modal-header h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
}

.cqp-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.15s;
}

.cqp-modal-close:hover {
	color: #fff;
}

/* ─── Modal Body ───────────────────────────────────────────────────────────── */

.cqp-modal-body {
	padding: 24px;
}

/* ─── Product Info ──────────────────────────────────────────────────────────── */

.cqp-product-info {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	padding: 12px 16px;
	background: #f0fafb;
	border: 1px solid #bfe5ec;
	border-radius: 6px;
	margin-bottom: 20px;
}

.cqp-product-name {
	font-weight: 600;
	color: #1f2937;
	font-size: 14px;
}

.cqp-product-sku {
	font-size: 12px;
	color: #6b7280;
}

.cqp-product-sku::before {
	content: "(SKU: ";
}

.cqp-product-sku::after {
	content: ")";
}

.cqp-product-price {
	font-size: 14px;
	color: #17a2b8;
	font-weight: 600;
}

/* ─── Form Layout ──────────────────────────────────────────────────────────── */

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

.cqp-form-row--half .cqp-form-group {
	flex: 1;
}

@media (max-width: 480px) {
	.cqp-form-row--half {
		flex-direction: column;
		gap: 0;
	}
}

.cqp-form-group {
	margin-bottom: 16px;
}

.cqp-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 4px;
}

.cqp-required {
	color: #dc2626;
}

/* ─── Form Inputs ──────────────────────────────────────────────────────────── */

.cqp-form-group select,
.cqp-form-group input[type="text"],
.cqp-form-group input[type="email"],
.cqp-form-group input[type="tel"],
.cqp-form-group textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.cqp-form-group select:focus,
.cqp-form-group input:focus,
.cqp-form-group textarea:focus {
	outline: none;
	border-color: #17a2b8;
	box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
}

.cqp-form-group textarea {
	resize: vertical;
	min-height: 60px;
}

/* ─── Field Errors ─────────────────────────────────────────────────────────── */

.cqp-field-error {
	display: block;
	font-size: 12px;
	color: #dc2626;
	margin-top: 2px;
	min-height: 0;
}

.cqp-has-error input,
.cqp-has-error select,
.cqp-has-error textarea {
	border-color: #dc2626 !important;
}

.cqp-has-error label {
	color: #dc2626;
}

/* ─── Actions ──────────────────────────────────────────────────────────────── */

.cqp-form-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
}

.cqp-submit-button,
.cqp-cancel-button {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s, opacity 0.15s;
}

.cqp-submit-button {
	background: #17a2b8;
	color: #fff;
	flex: 1;
}

.cqp-submit-button:hover:not(:disabled) {
	background: #13899c;
}

.cqp-submit-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cqp-cancel-button {
	background: #f3f4f6;
	color: #374151;
}

.cqp-cancel-button:hover {
	background: #e5e7eb;
}

.cqp-submit-spinner {
	font-style: normal;
}

/* ─── Success / Error Messages ─────────────────────────────────────────────── */

.cqp-message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
}

.cqp-message--success {
	background: #f0fdf4;
	border: 1px solid #86efac;
	color: #166534;
}

.cqp-message--error {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
}

/* ─── Quote Button (on product page) ───────────────────────────────────────── */

.cqp-quote-button {
	display: inline-block;
	margin-top: 12px;
}

.cqp-quote-button.button.alt {
	background: #17a2b8;
	color: #fff;
	border-color: #17a2b8;
}

.cqp-quote-button.button.alt:hover {
	background: #13899c;
	border-color: #13899c;
	color: #fff;
}