/*
 * Estilo de línea inferior para formularios de Contact Form 7
 * (reemplaza a "Material Design for Contact Form 7").
 *
 * Sólo se aplica dentro de un elemento con la clase "cf7-material", por ejemplo:
 *   <div class="form-perfil cf7-material"> ... </div>
 *
 * Colores y tamaños: cambia las variables en Apariencia > Personalizar > CSS adicional:
 *   .cf7-material { --cf7m-linea: #1a237e; --cf7m-acento: #F87601; }
 */
.cf7-material {
	--cf7m-linea: #1a237e;        /* línea inferior de los campos */
	--cf7m-foco: #1a237e;         /* línea al escribir */
	--cf7m-texto: #111111;        /* texto escrito / opción elegida */
	--cf7m-etiqueta: #1a237e;     /* textos de ayuda (placeholder) */
	--cf7m-tamano: 15px;          /* tamaño de letra */
	--cf7m-alto: 34px;            /* alto de los campos */
	--cf7m-error: #dc3232;        /* errores */
	--cf7m-boton: #1a237e;        /* fondo del botón Enviar */
	--cf7m-boton-texto: #ffffff;  /* texto del botón Enviar */

	/* Mismas variables para los campos País / Estado / Ciudad */
	--cf7pec-linea: var(--cf7m-linea);
	--cf7pec-linea-foco: var(--cf7m-foco);
	--cf7pec-texto: var(--cf7m-texto);
	--cf7pec-tamano: var(--cf7m-tamano);
	--cf7pec-alto: var(--cf7m-alto);
	--cf7pec-error: var(--cf7m-error);
}


/* ---------- Columnas (row / col-sm-N / col-md-N), por si el tema no trae Bootstrap ---------- */
.cf7-material .row {
	display: flex !important;
	flex-wrap: wrap !important;
	margin-left: -15px !important;
	margin-right: -15px !important;
}
.cf7-material .row > * {
	box-sizing: border-box;
	flex: 0 0 100% !important;
	max-width: 100% !important;
	width: 100% !important;
	padding-left: 15px;
	padding-right: 15px;
	min-width: 0;
}
@media (min-width: 576px) {
	.cf7-material .row > .col-sm-1 { flex: 0 0 8.3333% !important; max-width: 8.3333% !important; }
	.cf7-material .row > .col-sm-2 { flex: 0 0 16.6667% !important; max-width: 16.6667% !important; }
	.cf7-material .row > .col-sm-3 { flex: 0 0 25% !important; max-width: 25% !important; }
	.cf7-material .row > .col-sm-4 { flex: 0 0 33.3333% !important; max-width: 33.3333% !important; }
	.cf7-material .row > .col-sm-5 { flex: 0 0 41.6667% !important; max-width: 41.6667% !important; }
	.cf7-material .row > .col-sm-6 { flex: 0 0 50% !important; max-width: 50% !important; }
	.cf7-material .row > .col-sm-7 { flex: 0 0 58.3333% !important; max-width: 58.3333% !important; }
	.cf7-material .row > .col-sm-8 { flex: 0 0 66.6667% !important; max-width: 66.6667% !important; }
	.cf7-material .row > .col-sm-9 { flex: 0 0 75% !important; max-width: 75% !important; }
	.cf7-material .row > .col-sm-10 { flex: 0 0 83.3333% !important; max-width: 83.3333% !important; }
	.cf7-material .row > .col-sm-11 { flex: 0 0 91.6667% !important; max-width: 91.6667% !important; }
	.cf7-material .row > .col-sm-12 { flex: 0 0 100% !important; max-width: 100% !important; }
}
@media (min-width: 768px) {
	.cf7-material .row > .col-md-1 { flex: 0 0 8.3333% !important; max-width: 8.3333% !important; }
	.cf7-material .row > .col-md-2 { flex: 0 0 16.6667% !important; max-width: 16.6667% !important; }
	.cf7-material .row > .col-md-3 { flex: 0 0 25% !important; max-width: 25% !important; }
	.cf7-material .row > .col-md-4 { flex: 0 0 33.3333% !important; max-width: 33.3333% !important; }
	.cf7-material .row > .col-md-5 { flex: 0 0 41.6667% !important; max-width: 41.6667% !important; }
	.cf7-material .row > .col-md-6 { flex: 0 0 50% !important; max-width: 50% !important; }
	.cf7-material .row > .col-md-7 { flex: 0 0 58.3333% !important; max-width: 58.3333% !important; }
	.cf7-material .row > .col-md-8 { flex: 0 0 66.6667% !important; max-width: 66.6667% !important; }
	.cf7-material .row > .col-md-9 { flex: 0 0 75% !important; max-width: 75% !important; }
	.cf7-material .row > .col-md-10 { flex: 0 0 83.3333% !important; max-width: 83.3333% !important; }
	.cf7-material .row > .col-md-11 { flex: 0 0 91.6667% !important; max-width: 91.6667% !important; }
	.cf7-material .row > .col-md-12 { flex: 0 0 100% !important; max-width: 100% !important; }
}

/* Utilidades usadas en el formulario */
.cf7-material .text-center { text-align: center !important; }
.cf7-material .mt-5 { margin-top: 3rem !important; }
.cf7-material .mb-5 { margin-bottom: 3rem !important; }
.cf7-material .mb-3 { margin-bottom: 1rem !important; }

/* Separación entre campos */
.cf7-material .wpcf7-form-control-wrap {
	display: block;
	margin-bottom: 22px;
}

/* ---------- Campos de texto, correo, teléfono, etc. ---------- */
.cf7-material input[type="text"],
.cf7-material input[type="email"],
.cf7-material input[type="tel"],
.cf7-material input[type="url"],
.cf7-material input[type="number"],
.cf7-material input[type="date"],
.cf7-material input[type="time"],
.cf7-material textarea,
.cf7-material select {
	display: block;
	width: 100% !important;
	max-width: 100%;
	margin: 0 !important;
	padding: 4px 0 6px !important;
	box-sizing: border-box !important;
	border: 0 !important;
	border-bottom: 1px solid var(--cf7m-linea) !important;
	border-radius: 0 !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--cf7m-texto) !important;
	font-family: inherit !important;
	font-size: var(--cf7m-tamano) !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: 0.5px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cf7-material input[type="text"],
.cf7-material input[type="email"],
.cf7-material input[type="tel"],
.cf7-material input[type="url"],
.cf7-material input[type="number"],
.cf7-material input[type="date"],
.cf7-material input[type="time"],
.cf7-material select {
	height: var(--cf7m-alto) !important;
}
.cf7-material textarea {
	min-height: 90px;
	resize: vertical;
}
.cf7-material input::placeholder,
.cf7-material textarea::placeholder {
	color: var(--cf7m-etiqueta) !important;
	opacity: 1 !important;
}

/* Al escribir */
.cf7-material input:focus,
.cf7-material textarea:focus,
.cf7-material select:focus {
	border-bottom-color: var(--cf7m-foco) !important;
	box-shadow: 0 1px 0 0 var(--cf7m-foco) !important;
}

/* Sólo lectura (por ejemplo "Condiciones de pago: Contado") */
.cf7-material input[readonly] {
	color: #555555 !important;
	cursor: default;
}
.cf7-material input[readonly]:focus {
	box-shadow: none !important;
}

/* ---------- Listas desplegables ---------- */
.cf7-material select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	padding-right: 28px !important;
	text-transform: uppercase;
	cursor: pointer;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5l5.5 5.5 5.5-5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 8px center !important;
	background-size: 14px 9px !important;
}
.cf7-material select::-ms-expand { display: none; }
.cf7-material select option { text-transform: none; color: #111111; }

/* ---------- Casillas (checkbox) y opciones (radio) ---------- */
.cf7-material .campo-opciones {
	margin: 6px 0 18px;
}
.cf7-material .wpcf7-checkbox,
.cf7-material .wpcf7-radio {
	display: flex !important;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin-bottom: 0;
}
.cf7-material .wpcf7-list-item {
	display: inline-flex;
	align-items: center;
	margin: 0 !important;
}
.cf7-material .wpcf7-list-item label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	margin: 0;
}
.cf7-material input[type="checkbox"],
.cf7-material input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0 8px 0 0;
	accent-color: var(--cf7m-linea);
	cursor: pointer;
	flex-shrink: 0;
}
.cf7-material .wpcf7-list-item label input[type="checkbox"],
.cf7-material .wpcf7-list-item label input[type="radio"] {
	margin-right: 0;
}
.cf7-material .wpcf7-list-item-label {
	font-size: var(--cf7m-tamano);
	color: var(--cf7m-texto);
}

/* ---------- Etiqueta pequeña sobre un campo ---------- */
.cf7-material .etiqueta-campo {
	display: block;
	margin: 0 0 2px;
	color: var(--cf7m-etiqueta);
	font-size: 12px;
	letter-spacing: 0.4px;
}

/* ---------- Archivos ---------- */
.cf7-material input[type="file"] {
	display: block;
	max-width: 100%;
	padding: 8px 0;
	font-size: 14px;
}

/* ---------- Botón Enviar ---------- */
.cf7-material .wpcf7-submit {
	display: inline-block;
	margin-top: 10px;
	padding: 12px 32px;
	border: 0;
	border-radius: 4px;
	background-color: var(--cf7m-boton);
	color: var(--cf7m-boton-texto);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
	transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.cf7-material .wpcf7-submit:hover {
	filter: brightness(1.15);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22);
}
.cf7-material .wpcf7-submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* ---------- Errores ---------- */
.cf7-material .wpcf7-not-valid {
	border-bottom-color: var(--cf7m-error) !important;
}
.cf7-material .wpcf7-not-valid-tip {
	display: block;
	margin-top: 4px;
	color: var(--cf7m-error);
	font-size: 13px;
}
