/* ===========================================================
   Boteria Negreiros — Formulario de contacto v2
   Colores y tipografía se inyectan por variables desde el panel.
   Incluye reglas defensivas para que el tema (XStore) no recorte
   los campos ni el botón.
   =========================================================== */

.bn-contacto {
	/* Valores de respaldo; el panel los sobrescribe vía variables. */
	--bn-bg:             #faf7f0;
	--bn-brand:          #2c3b2e;
	--bn-brand-rgb:      44, 59, 46;
	--bn-accent:         #b89b6e;
	--bn-field-bg:       #e7dcc4;
	--bn-field-bg-focus: #f1ead8;
	--bn-field-text:     #2a2620;
	--bn-btn-bg:         #2c3b2e;
	--bn-btn-bg-hover:   #1f2b22;
	--bn-btn-text:       #ffffff;
	--bn-title-font:     inherit;
	--bn-body-font:      inherit;

	--bn-line:    #d8cdb4;
	--bn-muted:   #8c8268;
	--bn-error:   #a23b2e;
	--bn-success: #3a5a3f;
	--bn-radius:  2px;
	--bn-gap:     20px;

	background: var(--bn-bg);
	color: var(--bn-field-text);
	font-family: var(--bn-body-font);
	padding: clamp(40px, 7vw, 84px) 20px;
	box-sizing: border-box;
}
.bn-contacto *,
.bn-contacto *::before,
.bn-contacto *::after { box-sizing: border-box; }

.bn-contacto__inner { max-width: 760px; margin: 0 auto; }

/* ---------- Encabezado ---------- */
.bn-contacto__head { text-align: center; margin-bottom: clamp(28px, 5vw, 48px); }
.bn-contacto__eyebrow {
	display: inline-block;
	font-size: 12px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--bn-accent);
	margin-bottom: 14px;
	position: relative;
	padding: 0 18px;
}
.bn-contacto__eyebrow::before,
.bn-contacto__eyebrow::after {
	content: ""; position: absolute; top: 50%;
	width: 26px; height: 1px; background: var(--bn-accent); opacity: .55;
}
.bn-contacto__eyebrow::before { right: 100%; }
.bn-contacto__eyebrow::after  { left: 100%; }

.bn-contacto__title {
	font-family: var(--bn-title-font);
	font-weight: 500;
	font-size: clamp(34px, 6vw, 54px);
	line-height: 1.05;
	color: var(--bn-brand);
	margin: 0 0 16px;
}
.bn-contacto__lead {
	max-width: 46ch; margin: 0 auto;
	color: var(--bn-muted); font-size: 16px; line-height: 1.6;
}

/* ---------- Tarjeta con costura ---------- */
.bn-contacto .bn-form {
	background: #fff;
	border: 1px solid var(--bn-line);
	border-radius: var(--bn-radius);
	padding: clamp(24px, 5vw, 44px);
	position: relative;
	box-shadow: 0 18px 50px -30px rgba(var(--bn-brand-rgb), .45);
}
.bn-contacto .bn-form::before {
	content: ""; position: absolute; inset: 9px;
	border: 1px dashed var(--bn-accent); border-radius: var(--bn-radius);
	opacity: .45; pointer-events: none;
}

.bn-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bn-gap); }

/* ---------- Campos ---------- */
.bn-contacto .bn-field { display: flex; flex-direction: column; margin: 0; }
.bn-field--full { grid-column: 1 / -1; }

.bn-contacto .bn-field__label {
	font-size: 12px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--bn-brand);
	font-weight: 600;
	margin: 0 0 8px;
	line-height: 1.3;
}
.bn-req { color: var(--bn-accent); }

/* --- RESET DEFENSIVO de controles (vence al tema XStore) --- */
.bn-contacto .bn-field__input,
.bn-contacto .bn-field__select select,
.bn-contacto .bn-submit {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	line-height: 1.5 !important;
	font-family: inherit !important;
	font-size: 16px !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	float: none !important;
	overflow: visible !important;
	box-shadow: none;
}

.bn-contacto .bn-field__input {
	color: var(--bn-field-text);
	background: var(--bn-field-bg) !important;
	border: 1px solid transparent !important;
	border-radius: var(--bn-radius) !important;
	padding: 14px 16px !important;
	transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
	-webkit-appearance: none; appearance: none;
}
.bn-contacto .bn-field__input::placeholder { color: var(--bn-muted); opacity: .85; }
.bn-contacto .bn-field__input:hover { background: var(--bn-field-bg-focus) !important; }
.bn-contacto .bn-field__input:focus {
	outline: none;
	background: var(--bn-field-bg-focus) !important;
	border-color: var(--bn-brand) !important;
	box-shadow: 0 0 0 3px rgba(var(--bn-brand-rgb), .14) !important;
}
.bn-contacto .bn-field__textarea {
	resize: vertical;
	min-height: 130px !important;
	height: auto !important;
}

/* Select con flecha propia */
.bn-contacto .bn-field__select { position: relative; }
.bn-contacto .bn-field__select::after {
	content: ""; position: absolute; right: 16px; top: 50%;
	width: 9px; height: 9px;
	border-right: 2px solid var(--bn-brand);
	border-bottom: 2px solid var(--bn-brand);
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}
.bn-contacto .bn-field__select select {
	color: var(--bn-field-text) !important;
	background: var(--bn-field-bg) !important;
	border: 1px solid transparent !important;
	border-radius: var(--bn-radius) !important;
	padding: 14px 42px 14px 16px !important;
	cursor: pointer;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	background-image: none !important;
	transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.bn-contacto .bn-field__select select:hover { background: var(--bn-field-bg-focus) !important; }
.bn-contacto .bn-field__select select:focus {
	outline: none;
	background: var(--bn-field-bg-focus) !important;
	border-color: var(--bn-brand) !important;
	box-shadow: 0 0 0 3px rgba(var(--bn-brand-rgb), .14) !important;
}

/* Errores */
.bn-field--invalid .bn-field__input,
.bn-field--invalid .bn-field__select select { border-color: var(--bn-error) !important; background: #fbf1ef !important; }
.bn-field__error { display: none; color: var(--bn-error); font-size: 13px; margin-top: 6px; }
.bn-field--invalid .bn-field__error { display: block; }

/* ---------- Consentimiento ---------- */
.bn-contacto .bn-consent {
	display: flex; align-items: flex-start; gap: 12px;
	cursor: pointer; font-size: 14px; color: var(--bn-muted);
	line-height: 1.5; margin: 0;
}
.bn-contacto .bn-consent input {
	position: absolute !important; opacity: 0 !important; width: 0 !important; height: 0 !important; margin: 0 !important;
}
.bn-consent__box {
	flex: 0 0 auto; width: 22px; height: 22px;
	border: 1.5px solid var(--bn-line); border-radius: var(--bn-radius);
	background: var(--bn-field-bg); position: relative; margin-top: 1px;
	transition: background .2s ease, border-color .2s ease;
}
.bn-consent input:checked + .bn-consent__box { background: var(--bn-brand); border-color: var(--bn-brand); }
.bn-consent__box::after {
	content: ""; position: absolute; left: 7px; top: 3px;
	width: 6px; height: 11px;
	border-right: 2px solid #fff; border-bottom: 2px solid #fff;
	transform: rotate(45deg) scale(0); transition: transform .15s ease;
}
.bn-consent input:checked + .bn-consent__box::after { transform: rotate(45deg) scale(1); }
.bn-consent input:focus-visible + .bn-consent__box { box-shadow: 0 0 0 3px rgba(var(--bn-brand-rgb), .2); }
.bn-field--consent.bn-field--invalid .bn-consent__box { border-color: var(--bn-error); }

/* ---------- Honeypot ---------- */
.bn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Acciones / Botón ---------- */
.bn-form__actions { display: flex; align-items: center; gap: 22px; margin-top: 28px; flex-wrap: wrap; }

.bn-contacto .bn-submit {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	color: var(--bn-btn-text) !important;
	background: var(--bn-btn-bg) !important;
	border: none !important;
	border-radius: var(--bn-radius) !important;
	padding: 16px 40px !important;
	font-weight: 600 !important;
	letter-spacing: .04em !important;
	text-transform: none !important;
	line-height: 1.2 !important;
	height: auto !important;
	min-width: 200px;
	cursor: pointer;
	transition: background .2s ease, transform .1s ease;
}
.bn-contacto .bn-submit:hover { background: var(--bn-btn-bg-hover) !important; color: var(--bn-btn-text) !important; }
.bn-contacto .bn-submit:active { transform: translateY(1px); }
.bn-contacto .bn-submit:focus-visible { outline: 2px solid var(--bn-accent); outline-offset: 3px; }
.bn-contacto .bn-submit[disabled] { opacity: .75; cursor: progress; }

.bn-submit__label { display: inline-block; }
.bn-submit__spinner {
	display: none; width: 16px; height: 16px; margin-left: 10px;
	border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%;
	animation: bn-spin .7s linear infinite;
}
.bn-submit.is-loading .bn-submit__spinner { display: inline-block; }
@keyframes bn-spin { to { transform: rotate(360deg); } }

.bn-whatsapp {
	color: var(--bn-brand); font-size: 14px; text-decoration: none;
	border-bottom: 1px solid var(--bn-accent); padding-bottom: 1px;
	transition: color .2s ease;
}
.bn-whatsapp:hover { color: var(--bn-accent); }

/* ---------- Mensaje de respuesta ---------- */
.bn-form__feedback { margin-top: 22px; padding: 16px 18px; border-radius: var(--bn-radius); font-size: 15px; line-height: 1.5; }
.bn-form__feedback.is-success { background: #eef3ec; color: var(--bn-success); border-left: 3px solid var(--bn-success); }
.bn-form__feedback.is-error { background: #fbf1ef; color: var(--bn-error); border-left: 3px solid var(--bn-error); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	.bn-form__grid { grid-template-columns: 1fr; }
	.bn-contacto .bn-form::before { inset: 6px; }
	.bn-contacto .bn-submit { width: 100% !important; }
	.bn-form__actions { gap: 16px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	.bn-contacto .bn-field__input,
	.bn-contacto .bn-field__select select,
	.bn-consent__box,
	.bn-contacto .bn-submit,
	.bn-submit__spinner { transition: none !important; animation: none !important; }
}
