/* ==========================================================================
   Contact Us Page - BrandSDK Contact Form
   Plugin: gallo-brand-compliance

   BrandSDK injects the contact form HTML from its contactus.html template.
   This stylesheet targets the actual BrandSDK class names:
     .b-contact_us, .contactusField, .fieldInput, .dropdownWrapper,
     .dropdownTxt, .fieldSelect, .row.group, #contactUsForm

   Theme override: set CSS custom properties on :root to match your brand.
   ========================================================================== */

/* ---- Page chrome ---- */

.contact-page__content {
	max-width: 900px;
}

.contact-page__content h1 {
	text-align: center;
}

/* ---- BrandSDK Container ---- */

.b-contact_us {
	margin-top: 32px;
	padding: 0;
}

/* Hide BrandSDK's duplicate h1 - the plugin renders its own styled h1 */
.b-contact_us > h1 {
	display: none;
}

/* Header wrapper (intro text, wine finder link, privacy link) */
.b-contact_us .formHeaderWrapper {
	max-width: 680px;
	margin: 0 auto;
	text-align: center;
	font-family: var(--gbl-font-body);
	font-size: 14px;
	color: var(--gbl-color-text);
	line-height: 1.6;
}

.b-contact_us .formHeaderWrapper a {
	color: var(--gbl-color-heading);
}

/* ---- Form layout ---- */

.b-contact_us form {
	display: block;
	max-width: 680px;
	margin: 32px auto 0;
}

/* BrandSDK adds .desktop class to the form - ensure it stays visible on mobile */
#ejgContactUs .desktop {
	display: block;
}

/* Field row containers - only inside the form, not the header wrapper */
.b-contact_us form .row {
	margin: 16px 0;
}

/* ---- Labels ---- */

.b-contact_us .contactusField.label {
	display: block;
	margin-bottom: 6px;
	font-family: var(--gbl-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--gbl-color-text);
}

.b-contact_us .contactusField.label .required {
	color: var(--gbl-color-error, #ca1e36);
	margin-left: 2px;
}

/* ---- Text inputs, email, textareas ---- */

/* BrandSDK defaults inputs to display: inline-block with fixed widths via
   its own injected <style> tags. Use !important on layout properties. */
/* Exclude radio/checkbox from block layout */
.b-contact_us input[type="radio"],
.b-contact_us input[type="checkbox"] {
	display: inline !important;
	width: auto !important;
}

.b-contact_us .contactusField.fieldInput:not(.dropdownWrapper):not(.fieldCheckBox):not(.radioField),
.b-contact_us input[type="text"],
.b-contact_us input[type="email"],
.b-contact_us textarea {
	display: block !important;
	width: 100% !important;
	padding: 10px 14px;
	border: 1px solid #d0d0d0;
	border-radius: 0;
	background: #fff;
	font-family: var(--gbl-font-body);
	font-size: 16px;
	color: var(--gbl-color-text);
	box-sizing: border-box;
}

.b-contact_us input[type="text"]:focus,
.b-contact_us input[type="email"]:focus,
.b-contact_us textarea:focus,
.b-contact_us select:focus {
	outline: none;
	border-color: var(--gbl-color-heading);
}

.b-contact_us textarea {
	min-height: 120px;
	resize: vertical;
	width: 100%;
}

/* ---- Custom dropdown overlay (BrandSDK pattern) ---- */
/* Reference: Kali Hart Wines form.scss */

/* The wrapper is just a positioning container - NO border here.
   The visible border belongs on .dropdownTxt only. */
.b-contact_us .dropdownWrapper {
	display: block;
	position: relative;
	width: 100%;
	border: none !important;
	padding: 0 !important;
	background: transparent !important;
}

/* Force full width on all dropdown wrappers */
.b-contact_us .fieldInput.dropdownWrapper {
	width: 100% !important;
	border: none !important;
	padding: 0 !important;
	background: transparent !important;
}

/* The visible dropdown element - single border, matching input styling.
   BrandSDK injects #ejgContactUs .dropdownTxt { width: 185px } via its own
   stylesheet, which beats class-only selectors. Use !important to override. */
.b-contact_us .dropdownTxt {
	display: flex;
	align-items: center;
	width: 100% !important;
	padding: 8px 12px !important;
	border: 1px solid #d0d0d0;
	background: transparent;
	font-family: var(--gbl-font-body);
	font-size: 16px;
	color: var(--gbl-color-text);
	text-align: left !important;
	box-sizing: border-box;
	cursor: pointer;
}

.b-contact_us .dropdownTxt .selectedTxt {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.2;
	margin: 0;
	padding: 0;
	flex: 1;
}

/* Override BrandSDK's injected .dropdownTxt span.arrowDown { display: block;
   float: right; margin: -23px 0 0; } which breaks flex alignment. */
.b-contact_us .dropdownTxt span.arrowDown {
	display: flex !important;
	float: none !important;
	align-items: center;
	margin: 0 0 0 auto !important;
	padding-left: 8px;
}

/* CSS-only chevron arrow (matches Kali Hart's keyboard_arrow_down style
   without requiring Material Icons font) */
.b-contact_us .dropdownTxt span.arrowDown::after {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--gbl-color-text, #333);
	border-bottom: 2px solid var(--gbl-color-text, #333);
	transform: rotate(45deg);
	margin-bottom: 3px;
	background: transparent;
	font-size: 0;
}

/* Native select sits invisibly on top of the overlay for accessibility */
.b-contact_us .dropdownWrapper select.fieldSelect {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

/* ---- Date of Birth row - inline fields ---- */

#dobWrapper .dropdownWrapper {
	display: block !important;
	width: 100% !important;
	margin-bottom: 8px;
}

#dobWrapper .dropdownTxt.dobTxt {
	width: 100% !important;
	height: 100%;
}

#dobWrapper input.fieldInput {
	display: inline-block !important;
	width: 100px !important;
	vertical-align: bottom;
	margin: 0 8px 0 0;
}

/* ---- Phone row - space between input and phone type dropdown ---- */

#phoneWrapper > input.fieldInput {
	margin-bottom: 8px;
}

/* ---- Section headings inside form ---- */

.b-contact_us #contactInfoText {
	font-family: var(--gbl-font-body);
	font-size: 16px;
	font-weight: 700;
	color: var(--gbl-color-text);
	margin-top: 24px;
}

/* ---- Submit button ---- */

.b-contact_us #submitBtnWrapper {
	text-align: center;
	margin-top: 24px;
}

.b-contact_us #submit,
.b-contact_us input[type="submit"] {
	display: inline-block;
	min-width: 200px;
	padding: 14px 40px;
	background: var(--gbl-color-btn-bg, #4F729A);
	color: #fff;
	border: none;
	font-family: var(--gbl-font-heading);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease;
}

.b-contact_us #submit:hover,
.b-contact_us input[type="submit"]:hover {
	background: var(--gbl-color-btn-hover, #2D292B);
}

.b-contact_us #submit:disabled,
.b-contact_us input[type="submit"]:disabled {
	background: var(--gbl-color-btn-disabled, #a0b5c8);
	cursor: not-allowed;
}

/* ---- Form requirements text ---- */

.b-contact_us #formRequirementsWrapper {
	font-family: var(--gbl-font-body);
	font-size: 12px;
	color: #666;
	margin-top: 16px;
	line-height: 1.5;
}

/* ---- Validation - Parsley ---- */

.b-contact_us .parsley-errors-list {
	list-style: none;
	padding: 0;
	margin: 6px 0 0;
	color: var(--gbl-color-error, #ca1e36);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}

.b-contact_us input.parsley-error,
.b-contact_us select.parsley-error,
.b-contact_us textarea.parsley-error {
	border-color: var(--gbl-color-error, #ca1e36) !important;
	background-color: #fff !important;
}

.b-contact_us input.parsley-success,
.b-contact_us select.parsley-success,
.b-contact_us textarea.parsley-success {
	background-color: #fff !important;
	color: var(--gbl-color-text) !important;
	border-color: #d0d0d0 !important;
}

/* ---- Radio and checkbox groups ---- */

.b-contact_us input[type="radio"],
.b-contact_us input[type="checkbox"] {
	display: inline !important;
	width: auto !important;
	accent-color: var(--gbl-color-heading);
	cursor: pointer;
	margin-right: 4px;
	vertical-align: middle;
	margin-bottom: 10px;
}

/* Checkbox rows - input and label on the same line.
   BrandSDK puts .fieldCheckBox on the <input>, not a wrapper div.
   The parent .row needs flex so the sibling label sits inline. */
.b-contact_us .row:has(input.fieldCheckBox) {
	display: flex !important;
	align-items: flex-start;
	flex-wrap: nowrap;
}

.b-contact_us input.fieldCheckBox {
	flex-shrink: 0;
	margin-top: 4px;
}

.b-contact_us input.fieldCheckBox + label {
	display: inline !important;
	font-weight: 400;
	line-height: 1.5;
	cursor: pointer;
}

/* Radio fieldset - horizontal layout (e.g. Preferred Contact Method).
   BrandSDK puts .radioField on each <input>, not a wrapper div.
   The <fieldset> contains alternating input + label siblings. */
.b-contact_us fieldset {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	border: none;
	padding: 0;
	margin: 0;
}

.b-contact_us fieldset legend {
	flex-basis: 100%;
	margin-bottom: 4px;
}

.b-contact_us fieldset label.radioInlineLabel {
	display: inline !important;
	font-weight: 400;
	margin-bottom: 0;
	margin-right: 20px;
	cursor: pointer;
}

/* ---- Success message ---- */

.b-contact_us .success-message,
.b-contact_us .contact-success {
	text-align: center;
	font-family: var(--gbl-font-body);
	font-size: 18px;
	color: var(--gbl-color-text);
	padding: 40px 20px;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
	.contact-page__content {
		padding-left: 20px;
		padding-right: 20px;
	}

	.b-contact_us form {
		margin-top: 24px;
	}

	/* Stack DOB fields on mobile */
	#dobWrapper .fieldInput,
	#dobWrapper .dropdownWrapper {
		display: block;
		width: 100%;
		margin-bottom: 8px;
	}

	#dobWrapper input.fieldInput {
		width: 100%;
	}
}
