/**
 * Product-page "Contact Us" popup — teaser text/CTA under Add to Cart, and
 * the modal form itself. Kept visually neutral (WooCommerce-native rounded
 * corners/spacing) rather than matching any one store's branding, since this
 * ships to multiple stores.
 */

.sp-contact-request-teaser {
	margin: 16px 0;
	padding: 14px 16px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #f8f9fb;
}

.sp-contact-request-headline {
	margin: 0 0 4px;
	font-weight: 600;
}

/* The phrase inside the headline that opens a popup. Underlined so it reads
   as a link even where the theme strips link colouring from this context. */
.sp-contact-headline-link {
	cursor: pointer;
	text-decoration: underline;
}

.sp-contact-request-description {
	margin: 0 0 10px;
	color: #555;
	font-size: 0.92em;
}

/* Modal overlay */
.sp-contact-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sp-contact-modal-overlay[hidden] {
	display: none;
}

.sp-contact-modal {
	position: relative;
	width: 100%;
	max-width: 700px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 10px;
	padding: 28px 32px 28px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* Centred above the title. Capped rather than sized so a wide wordmark and a
   square mark both stay proportionate without cropping. */
.sp-contact-modal-logo {
	display: block;
	max-height: 56px;
	max-width: 150px;
	width: auto;
	height: auto;
	margin: 12px auto;
}

.sp-contact-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: 0;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 4px;
}

.sp-contact-modal-close:hover {
	color: #000;
}

/* Shared with the standalone page version of this form (see
   contact-request-page.php) — id-scoped since only one instance of the form
   ever renders per page, rather than tied to the modal specifically. */
#sp-contact-form-title {
	margin: 0 0 16px;
	font-size: 1.25em;
	text-align: center;
}

/* Room for the close button in the top-right corner — the modal only. */
.sp-contact-modal #sp-contact-form-title {
	padding-right: 24px;
}

/* Plain page container for the standalone [sp_contact_request_form]
   shortcode — same field styling as the popup, without the fixed overlay,
   centering, or box-shadow that only make sense for a modal. */
.sp-contact-page {
	max-width: 700px;
	margin: 0 auto;
	padding: 24px 0;
}

.sp-contact-modal-description {
	margin: -8px 0 16px;
	color: #555;
	font-size: 0.92em;
	text-align: center;
}

.sp-contact-field {
	margin: 0 0 14px;
}

/* Paired fields — First/Last Name, and Phone/Company. min-width: 0 lets each
   half shrink below its content's natural width instead of overflowing the
   row on a narrow phone screen. */
.sp-contact-field-row {
	display: flex;
	gap: 10px;
}

.sp-contact-field-row .sp-contact-field {
	flex: 1 1 0;
	min-width: 0;
}

.sp-contact-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	font-size: 0.92em;
}

.sp-contact-field label small {
	font-weight: 400;
	color: #777;
}

.sp-contact-field input[type="text"],
.sp-contact-field input[type="email"],
.sp-contact-field input[type="tel"],
.sp-contact-field textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	font-size: 0.95em;
	box-sizing: border-box;
}

.sp-contact-field textarea {
	resize: vertical;
	min-height: 120px;
}

.sp-contact-required {
	color: #d63638;
}

.sp-contact-field-hint,
.sp-contact-allowed-formats {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
	color: #777;
}

.sp-contact-field-hint.is-error {
	color: #d63638;
}

/* Files already uploaded and waiting to be linked to the request. */
.sp-contact-upload-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

.sp-contact-upload-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 8px;
	border: 1px solid #dcdcde;
	border-radius: 12px;
	background: #f6f7f7;
	font-size: 0.85em;
	word-break: break-all;
}

.sp-contact-upload-remove {
	border: 0;
	padding: 0 2px;
	background: none;
	color: #777;
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
}

.sp-contact-upload-remove:hover {
	color: #d63638;
}

.sp-contact-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	height: 0;
	overflow: hidden;
}

.sp-contact-submit {
	width: 100%;
	text-align: center;
	cursor: pointer;
	border-radius: var( --btn-accented-brd-radius );
	color: var( --btn-accented-color );
	box-shadow: var( --btn-accented-box-shadow );
	background-color: var( --btn-accented-bgcolor );
	text-transform: var( --btn-accented-transform, var( --btn-transform, uppercase ) );
	font-weight: var( --btn-accented-font-weight, var( --btn-font-weight, 600 ) );
	font-family: var( --btn-accented-font-family, var( --btn-font-family, inherit ) );
	font-style: var( --btn-accented-font-style, var( --btn-font-style, unset ) );
	white-space: nowrap;
}

.sp-contact-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

.sp-contact-form-status {
	margin: 0 0 12px;
	font-size: 0.92em;
}

.sp-contact-form-status:empty {
	display: none;
}

.sp-contact-form-status.is-success {
	color: #fff;
	font-size: 1.05em;
	background: #254b96;
	text-align: center;
	padding: 20px;
}

.sp-contact-form-status.is-error {
	color: #d63638;
}

/* wpautop() (see ContactPopupContent::success_message_html()) wraps admin
   text in <p> tags — collapse the browser's default paragraph margins so a
   one-paragraph message doesn't add unwanted space above/below it, and a
   multi-paragraph one only gets spacing between paragraphs. */
.sp-contact-form-status p {
	margin: 0 0 10px;
}

.sp-contact-form-status p:last-child {
	margin-bottom: 0;
}

/* A default blue link is unreadable on the success message's own blue
   background — this only affects a link inside that specific state. */
.sp-contact-form-status.is-success a {
	color: #fff;
	text-decoration: underline;
}

.sp-contact-upload-errors {
	margin: 10px 0 0;
	color: #d63638;
	font-size: 0.9em;
}

/* Appended inside the success box (see sp-contact-request.js) after a
   submission that went through but had an attachment problem — the default
   red is too close to unreadable on that box's own dark blue background. */
.sp-contact-form-status.is-success .sp-contact-upload-errors {
	color: #ffd7d7;
}

@media (max-width: 480px) {
	.sp-contact-modal {
		padding: 22px 16px 18px;
	}
}
