/* ShowPro Quote Request — frontend styles */

/* ==========================================================================
   Quote button
   ========================================================================== */

.showpro-quote-wrap {
	margin: 1em 0;
}

/* Alignment variants — controlled by ShowPro → Settings */
.showpro-quote-wrap--left   { text-align: left; }
.showpro-quote-wrap--center { text-align: center; }
.showpro-quote-wrap--right  { text-align: right; }

.showpro-quote-btn {
	cursor: pointer;
	display: inline-block;
}

/* Collapse empty price wrapper (when _showpro_hide_price = yes) */
.woocommerce .price:empty,
.woocommerce-page .price:empty {
	display: none;
}

/* ==========================================================================
   Modal — overlay
   ========================================================================== */

.showpro-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba( 0, 0, 0, 0.6 );
	display: flex; /* toggled in JS */
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

body.showpro-modal-open {
	overflow: hidden;
}

/* ==========================================================================
   Modal — dialog box
   ========================================================================== */

.showpro-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 10px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	box-shadow: 0 25px 60px rgba( 0, 0, 0, 0.35 );
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Modal — header
   ========================================================================== */

.showpro-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e5e7eb;
	flex-shrink: 0;
}

.showpro-modal__title {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.4;
}

.showpro-modal__close {
	flex-shrink: 0;
	background: none;
	border: 1px solid transparent;
	padding: 0.25rem 0.5rem;
	font-size: 1.125rem;
	line-height: 1;
	color: #6b7280;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.showpro-modal__close:hover {
	background: #f3f4f6;
	color: #111827;
}

.showpro-modal__close:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* ==========================================================================
   Modal — body / form
   ========================================================================== */

.showpro-modal__body {
	padding: 1.5rem;
	flex: 1;
	overflow-y: auto;
}

/* Honeypot — off-screen AND invisible so bots can see it but users can't */
.showpro-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* Required-field note */
.showpro-form__required-note {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	color: #6b7280;
}

/* Error banner — tabindex="-1" in HTML; outline:none prevents focus ring */
.showpro-form__errors {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 6px;
	color: #dc2626;
	font-size: 0.875rem;
	white-space: pre-line;
	outline: none;
}

/* Fields */
.showpro-form__field {
	margin-bottom: 1rem;
}

.showpro-form__field label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: #374151;
}

.showpro-required {
	color: #dc2626;
	margin-left: 0.125rem;
}

.showpro-form__field input[type="text"],
.showpro-form__field input[type="email"],
.showpro-form__field input[type="tel"],
.showpro-form__field input[type="number"],
.showpro-form__field textarea {
	display: block;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 1rem;
	line-height: 1.5;
	color: #111827;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
}

.showpro-form__field input:focus,
.showpro-form__field textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba( 37, 99, 235, 0.15 );
}

.showpro-form__field input[aria-invalid="true"],
.showpro-form__field textarea[aria-invalid="true"] {
	border-color: #dc2626;
}

/* Actions row */
.showpro-form__actions {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	margin-top: 1.25rem;
	flex-wrap: wrap;
}

/* Spinner */
.showpro-form__spinner {
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid #e5e7eb;
	border-top-color: #2563eb;
	border-radius: 50%;
	-webkit-animation: showpro-spin 0.65s linear infinite;
	animation: showpro-spin 0.65s linear infinite;
}

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

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

/* ==========================================================================
   Modal — success state
   ========================================================================== */

.showpro-modal__success {
	text-align: center;
	padding: 2.5rem 1rem;
}

.showpro-modal__success-msg {
	font-size: 1rem;
	color: #374151;
	line-height: 1.6;
	outline: none; /* receives programmatic focus via JS */
}

/* ==========================================================================
   Responsive — 480 px (sheet-from-bottom on phones)
   ========================================================================== */

@media ( max-width: 480px ) {
	.showpro-modal {
		padding: 0;
		align-items: flex-end;
	}

	.showpro-modal__dialog {
		max-width: 100%;
		max-height: 88vh;
		border-radius: 16px 16px 0 0;
	}

	.showpro-form__submit {
		flex: 1;
	}
}

/* ==========================================================================
   Responsive — 360 px (smallest common viewport, e.g. Galaxy A series)
   ========================================================================== */

@media ( max-width: 360px ) {
	.showpro-modal__header,
	.showpro-modal__body {
		padding: 1rem;
	}

	.showpro-modal__title {
		font-size: 1rem;
	}

	.showpro-form__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.showpro-form__submit {
		width: 100%;
		text-align: center;
	}

	/* Ensure number input spinners don't overflow */
	.showpro-form__field input[type="number"] {
		-moz-appearance: textfield;
	}

	.showpro-form__field input[type="number"]::-webkit-inner-spin-button,
	.showpro-form__field input[type="number"]::-webkit-outer-spin-button {
		-webkit-appearance: none;
	}
}
