/* Reuses the color variables defined in filter.css / product-market.css if present
   (--csf-accent and --csf-accent-light vary per market, see product-market.css),
   with a fallback in case this file is used on its own. */
:root {
	--csf-accent: #2563eb;
	--csf-accent-light: #eff6ff;
	--csf-text: #1a1a1a;
	--csf-muted: #6b7280;
	--csf-border: #e5e7eb;
	--csf-bg: #ffffff;
}

.csf-order-form-wrapper {
	margin-top: 1rem;
	max-width: 100%;
}

.csf-form-intro-title {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--csf-text);
	border-left: 4px solid var(--csf-accent);
	padding-left: 14px;
	margin: 0 0 18px;
}

/* The product page's Elementor template (post_id 3838, shared by all products) fixes
   its main sections (image/title, summary/form) to a width of 930px, which confines
   all the content into a narrow column. We instead align them with Astra theme's actual
   content width (the "site-content-width" setting = 1400px, the same as the header)
   rather than 100% of the screen — on a wide screen, 100% would overflow past the header,
   which itself stays capped at 1400px centered. */
.elementor-3838 > .e-con.e-parent {
	--width: min(100%, 1400px) !important;
	max-width: 1400px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* The "Add to cart" widget (where our form renders) is a flex item that doesn't stretch
   by default within its container — targeted by widget type (a stable class, common to
   every product page), not by instance ID (fragile). */
.elementor-widget-woocommerce-product-add-to-cart {
	width: 100% !important;
	flex-grow: 1 !important;
}

.csf-form-errors {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 16px;
}

.csf-form-errors ul {
	margin: 0;
	padding-left: 1.1rem;
}

.csf-order-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Block: groups a set of related fields (contact details, request details, agreement),
   same visual language as the weather station cards (.sm-weather-card) elsewhere on the site. */
.csf-block {
	background: var(--csf-bg);
	border: 1px solid var(--csf-border);
	border-radius: 12px;
	padding: 20px 20px 22px;
}

.csf-block-title {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--csf-muted);
	margin: 0 0 14px;
}

/* Field grid: side by side as soon as there's room, stacked on mobile. */
.csf-field-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 320px));
	gap: 14px 20px;
}

.csf-field-grid .csf-span-full {
	grid-column: 1 / -1;
}

.csf-form-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.csf-form-field label {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--csf-text);
}

.csf-form-field .required {
	color: #dc2626;
}

.csf-form-field input[type="text"],
.csf-form-field input[type="email"],
.csf-form-field input[type="tel"],
.csf-form-field input[type="number"],
.csf-form-field input[type="date"],
.csf-form-field select,
.csf-form-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--csf-border);
	border-radius: 8px;
	font-size: 0.95rem;
	font-family: inherit;
	outline: none;
	background: var(--csf-bg);
	color: var(--csf-text);
	transition: border-color .15s, box-shadow .15s;
}

.csf-form-field input:focus,
.csf-form-field select:focus,
.csf-form-field textarea:focus {
	border-color: var(--csf-accent);
	box-shadow: 0 0 0 3px var(--csf-accent-light);
}

.csf-form-field textarea {
	min-height: 90px;
	resize: vertical;
}

/* Generic checkbox (customer account, service agreement): icon + label + description. */
.csf-checkbox-field {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
}

.csf-checkbox-field input {
	margin-top: 3px;
	accent-color: var(--csf-accent);
}

.csf-checkbox-field .description {
	display: block;
	font-size: 0.8rem;
	font-weight: 400;
	color: var(--csf-muted);
	margin-top: 2px;
}

.csf-agreement-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.csf-agreement-checkbox {
	flex: 1;
	min-width: 220px;
}

.csf-agreement-view-btn {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	padding: 7px 14px;
	border: 1px solid var(--csf-accent);
	border-radius: 20px;
	background: var(--csf-accent-light);
	color: var(--csf-accent);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

.csf-agreement-view-btn:hover {
	background: var(--csf-accent);
	color: #fff;
}

.csf-submit-row {
	display: flex;
	justify-content: flex-end;
}

.csf-submit-btn {
	padding: 13px 28px;
	border-radius: 9px;
	font-weight: 700;
}

.csf-modal[hidden] {
	display: none;
}

.csf-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.csf-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.csf-modal-content {
	position: relative;
	background: var(--csf-bg);
	border-radius: 12px;
	max-width: 560px;
	width: 100%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.csf-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--csf-border);
}

.csf-modal-header h2 {
	margin: 0;
	font-size: 1.1rem;
	color: var(--csf-text);
}

.csf-modal-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--csf-muted);
	padding: 0 4px;
}

.csf-modal-body {
	padding: 16px 20px;
	overflow-y: auto;
	font-size: 0.92rem;
	color: var(--csf-text);
}

@media (max-width: 480px) {
	.csf-order-form-wrapper {
		max-width: 100%;
	}

	.csf-block {
		padding: 16px;
	}

	.csf-submit-row {
		justify-content: stretch;
	}

	.csf-submit-btn {
		width: 100%;
		text-align: center;
	}
}
