/* Order Request modal — inquiry-mode replacement for Add to Cart confirmation.
 * Reuses the visual language of pdp-size-confirmation.css and adds
 * contact fields and a success state.
 */

/* Ensure the hidden attribute always wins over display:flex. */
.sm-order-request[hidden] {
	display: none !important;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.sm-order-request {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.sm-order-request__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	cursor: pointer;
}

/* ── Dialog ──────────────────────────────────────────────────────────────── */
.sm-order-request__dialog {
	position: relative;
	background: #fff;
	border-radius: 12px;
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.25 );
	padding: 28px 32px;
}

.sm-order-request__header {
	margin-bottom: 20px;
}

.sm-order-request__title {
	font-size: 1.25rem;
	font-weight: 400;
	margin: 0 0 4px;
}

.sm-order-request__subtitle {
	font-size: 0.875rem;
	color: #555;
	margin: 0;
}

/* ── Configuration summary table ─────────────────────────────────────────── */
.sm-order-request__table-wrap {
	margin-bottom: 20px;
	overflow-x: auto;
}

.sm-order-request__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.sm-order-request__table th,
.sm-order-request__table td {
	border: 1px solid #e5e5e5;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}

.sm-order-request__table th {
	background: #f8f8f8;
	font-weight: 400;
	white-space: nowrap;
}

/* ── Contact form fields ─────────────────────────────────────────────────── */
.sm-order-request__fields {
	margin-bottom: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sm-order-request__field label {
	display: block;
	font-size: 0.85rem;
	font-weight: 400;
	margin-bottom: 4px;
	color: #333;
}

.sm-order-request__field input,
.sm-order-request__field textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.9rem;
	font-family: inherit;
	box-sizing: border-box;
}

.sm-order-request__field input:focus,
.sm-order-request__field textarea:focus {
	outline: none;
	border-color: #4a90d9;
	box-shadow: 0 0 0 2px rgba( 74, 144, 217, 0.15 );
}

.sm-order-request__field textarea {
	resize: vertical;
	min-height: 60px;
}

.sm-order-request__field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media ( max-width: 480px ) {
	.sm-order-request__field-row {
		grid-template-columns: 1fr;
	}
}

/* ── Size confirmation checkbox ──────────────────────────────────────────── */
.sm-order-request__confirm-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 16px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #333;
}

.sm-order-request__confirm-check input {
	margin-top: 3px;
	flex-shrink: 0;
}

/* ── Notice ──────────────────────────────────────────────────────────────── */
.sm-order-request__notice {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 0.82rem;
	color: #5d4037;
	margin-bottom: 16px;
	line-height: 1.5;
}

/* ── Error message ───────────────────────────────────────────────────────── */
.sm-order-request__error {
	background: #ffebee;
	border: 1px solid #ef9a9a;
	border-radius: 6px;
	padding: 8px 12px;
	color: #c62828;
	font-size: 0.85rem;
	margin-bottom: 12px;
}

/* ── Actions ─────────────────────────────────────────────────────────────── */
.sm-order-request__actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.sm-order-request__btn {
	padding: 10px 20px;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 400;
	cursor: pointer;
	border: none;
	transition: background 0.15s, opacity 0.15s;
}

.sm-order-request__btn--primary {
	background: #1a73e8;
	color: #fff;
}

.sm-order-request__btn--primary:hover {
	background: #1557b0;
}

.sm-order-request__btn--primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.sm-order-request__btn--secondary {
	background: #f5f5f5;
	color: #333;
	border: 1px solid #ccc;
}

.sm-order-request__btn--secondary:hover {
	background: #e8e8e8;
}

/* ── Success state ───────────────────────────────────────────────────────── */
.sm-order-request__success {
	text-align: center;
	padding: 20px 0;
}

.sm-order-request__success-icon {
	font-size: 3rem;
	margin-bottom: 12px;
	color: #2e7d32;
}

.sm-order-request__success-title {
	font-size: 1.1rem;
	font-weight: 400;
	margin: 0 0 8px;
	color: #1b5e20;
}

.sm-order-request__success-id {
	font-size: 0.9rem;
	color: #555;
	margin: 0 0 20px;
}

.sm-order-request__success-close {
	padding: 10px 28px;
	border-radius: 6px;
	background: #2e7d32;
	color: #fff;
	border: none;
	font-size: 0.9rem;
	font-weight: 400;
	cursor: pointer;
}

.sm-order-request__success-close:hover {
	background: #1b5e20;
}

/* ── Loading spinner on submit button ────────────────────────────────────── */
.sm-order-request__btn--primary.is-loading {
	position: relative;
	color: transparent;
	pointer-events: none;
}

.sm-order-request__btn--primary.is-loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-top: -8px;
	margin-left: -8px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: sm-spin 0.6s linear infinite;
}

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