/* ==========================================================================
   Gomaeme Presupuestos — estilos del frontend
   Los colores salen de las variables que define el panel (Ajustes → General).
   ========================================================================== */

:root {
	--gmp-fondo: #1a1a1a;
	--gmp-texto: #ffffff;
	--gmp-fondo-hover: #c8102e;
	--gmp-texto-hover: #ffffff;
	--gmp-borde: #d4d4d4;
	--gmp-borde-foco: #1a1a1a;
	--gmp-gris: #6b6b6b;
	--gmp-error: #b3261e;
	--gmp-ok: #1b5e20;
	--gmp-radio: 3px;
}

/* --- Botón ---------------------------------------------------------------- */

.gmp-boton {
	display: inline-block;
	padding: 0.85em 1.6em;
	border: 0;
	border-radius: var(--gmp-radio);
	background: var(--gmp-fondo);
	color: var(--gmp-texto);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.gmp-boton:hover,
.gmp-boton:focus-visible {
	background: var(--gmp-fondo-hover);
	color: var(--gmp-texto-hover);
	text-decoration: none;
}

.gmp-boton:focus-visible {
	outline: 2px solid var(--gmp-fondo-hover);
	outline-offset: 2px;
}

.gmp-boton--chico {
	padding: 0.6em 1em;
	font-size: 0.875em;
	width: 100%;
}

.gmp-boton-envoltorio {
	margin: 1em 0;
}

.gmp-boton-envoltorio--listado {
	margin: 0.5em 0 0;
}

/* --- Botón flotante ------------------------------------------------------- */

.gmp-flotante {
	position: fixed;
	z-index: 99990;
}

.gmp-flotante--circulo_der {
	right: var(--gmp-flot-lado, 20px);
	bottom: var(--gmp-flot-abajo, 20px);
}

.gmp-flotante--circulo_izq {
	left: var(--gmp-flot-lado, 20px);
	bottom: var(--gmp-flot-abajo, 20px);
}

/* Colores propios del flotante, independientes del resto de los botones. */
.gmp-boton--flotante {
	background: var(--gmp-flot-fondo);
	color: var(--gmp-flot-texto);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.gmp-boton--flotante:hover,
.gmp-boton--flotante:focus-visible {
	background: var(--gmp-flot-fondo-hover);
	color: var(--gmp-flot-texto-hover);
}

.gmp-flotante--circulo_der .gmp-boton--flotante,
.gmp-flotante--circulo_izq .gmp-boton--flotante {
	border-radius: 999px;
	padding: 1em 1.6em;
}

/*
   Círculo perfecto. width y height iguales con padding en cero: si quedara
   padding, el contenido lo empujaría y dejaría de ser un círculo exacto.
   El radio va en 999px y no en 50%: con 50%, al estirarse el botón quedaría
   una elipse; con 999px las puntas siguen siendo semicírculos y se forma
   una píldora.
*/
.gmp-boton.gmp-boton--circular {
	width: var(--gmp-flot-diametro, 53px);
	height: var(--gmp-flot-diametro, 53px);
	min-width: var(--gmp-flot-diametro, 53px);
	padding: 0;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--gmp-flot-texto-tam, 22px);
	font-weight: 700;
	line-height: 1;
	box-sizing: border-box;
	/* XStore y otros temas pesados fijan min-height y line-height en los
	   button. Sin esto el círculo se estiraría en vertical. */
	min-height: 0;
	max-height: var(--gmp-flot-diametro, 53px);
	flex: 0 0 auto;
}

.gmp-flotante--circulo_der .gmp-boton--circular,
.gmp-flotante--circulo_izq .gmp-boton--circular {
	padding: 0;
}

/*
   Botón que se estira al pasar el mouse.

   El ancho queda en auto con min-width igual al diámetro, así en reposo es
   un círculo exacto. Lo que se anima es el max-width de la etiqueta, porque
   `width: auto` no es animable y una transición hacia él no haría nada.
   Al crecer la etiqueta, el botón crece con ella.

   Como el contenedor está anclado con `right`, el botón se estira hacia la
   izquierda por sí solo: el borde derecho está fijo y el ancho empuja al
   otro lado. No hace falta ninguna transformación.
*/
.gmp-boton.gmp-boton--expandible {
	width: auto;
	overflow: hidden;
	white-space: nowrap;
	justify-content: flex-start;
}

.gmp-boton .gmp-boton__icono {
	width: var(--gmp-flot-diametro, 53px);
	height: var(--gmp-flot-diametro, 53px);
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--gmp-flot-texto-tam, 22px);
	line-height: 1;
}

.gmp-boton .gmp-boton__etiqueta {
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	transition: max-width 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

/* Anclado a la derecha: el símbolo queda a la derecha y el texto aparece
   a su izquierda, que es hacia donde crece. */
.gmp-flotante--circulo_der .gmp-boton--expandible {
	flex-direction: row-reverse;
}

.gmp-flotante--circulo_der .gmp-boton--expandible:hover .gmp-boton__etiqueta,
.gmp-flotante--circulo_der .gmp-boton--expandible:focus-visible .gmp-boton__etiqueta {
	max-width: 260px;
	opacity: 1;
	padding-left: 20px;
}

/* Anclado a la izquierda: crece hacia la derecha, así que el orden se invierte. */
.gmp-flotante--circulo_izq .gmp-boton--expandible:hover .gmp-boton__etiqueta,
.gmp-flotante--circulo_izq .gmp-boton--expandible:focus-visible .gmp-boton__etiqueta {
	max-width: 260px;
	opacity: 1;
	padding-right: 20px;
}

/* En pantallas táctiles no hay mouse: el botón queda como círculo y el
   texto se lee igual desde el aria-label. */
@media (hover: none) {
	.gmp-boton--expandible .gmp-boton__etiqueta {
		display: none;
	}
}

.gmp-flotante--barra_inferior {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 16px;
	background: rgba(255, 255, 255, 0.96);
	border-top: 1px solid var(--gmp-borde);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

.gmp-flotante--barra_inferior .gmp-boton {
	display: block;
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	box-shadow: none;
}

@media (max-width: 782px) {
	.gmp-flotante--sin-movil {
		display: none;
	}
}

/* --- Ventana -------------------------------------------------------------- */

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

.gmp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
}

.gmp-modal__fondo {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 20, 0.6);
}

.gmp-modal__caja {
	position: relative;
	width: 100%;
	max-width: 620px;
	margin: auto;
	background: #fff;
	border-radius: var(--gmp-radio);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.gmp-modal__cerrar {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 38px;
	height: 38px;
	border: 0;
	background: transparent;
	color: var(--gmp-gris);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--gmp-radio);
}

.gmp-modal__cerrar:hover {
	background: #f0f0f0;
	color: #000;
}

.gmp-modal__cabecera {
	padding: 24px 28px 0;
}

.gmp-modal__titulo {
	margin: 0 0 6px;
	font-size: 1.4rem;
	line-height: 1.25;
	padding-right: 32px;
}

.gmp-modal__bajada {
	margin: 0;
	color: var(--gmp-gris);
	font-size: 0.95rem;
	line-height: 1.5;
}

.gmp-modal__producto {
	margin: 12px 0 0;
	padding: 10px 12px;
	background: #f5f5f5;
	border-left: 3px solid var(--gmp-fondo);
	font-size: 0.95rem;
	font-weight: 600;
}

.gmp-modal__producto[hidden] {
	display: none;
}

.gmp-modal__cuerpo {
	padding: 20px 28px 28px;
}

body.gmp-abierto {
	overflow: hidden;
}

/* --- Formulario ----------------------------------------------------------- */

.gmp-form__campos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.gmp-campo--completo {
	grid-column: 1 / -1;
}

@media (max-width: 560px) {
	.gmp-form__campos {
		grid-template-columns: 1fr;
	}
	.gmp-campo--mitad {
		grid-column: 1 / -1;
	}
}

.gmp-campo {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.gmp-campo__etiqueta {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}

.gmp-campo__req {
	color: var(--gmp-error);
	margin-left: 2px;
}

.gmp-campo__control {
	width: 100%;
	padding: 0.65em 0.75em;
	border: 1px solid var(--gmp-borde);
	border-radius: var(--gmp-radio);
	background: #fff;
	font: inherit;
	font-size: 0.95rem;
	color: inherit;
	box-sizing: border-box;
}

.gmp-campo__control:focus {
	border-color: var(--gmp-borde-foco);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

textarea.gmp-campo__control {
	resize: vertical;
	min-height: 96px;
}

.gmp-campo__grupo {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.gmp-campo__opcion {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.95rem;
}

.gmp-campo--con-error .gmp-campo__control {
	border-color: var(--gmp-error);
}

.gmp-campo__error {
	color: var(--gmp-error);
	font-size: 0.8125rem;
	line-height: 1.35;
}

.gmp-campo__error[hidden] {
	display: none;
}

/* Trampa antispam: fuera de pantalla, no display:none (los robots lo detectan) */
.gmp-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.gmp-form__acciones {
	margin-top: 18px;
}

.gmp-boton--enviar {
	width: 100%;
}

.gmp-boton--enviar[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.gmp-form__intro,
.gmp-form__cierre {
	font-size: 0.925rem;
	line-height: 1.55;
	color: var(--gmp-gris);
}

.gmp-form__intro {
	margin-bottom: 16px;
}

.gmp-form__cierre {
	margin-top: 14px;
}

.gmp-form__captcha {
	margin-top: 16px;
}

/* --- Avisos --------------------------------------------------------------- */

.gmp-form__aviso {
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: var(--gmp-radio);
	font-size: 0.925rem;
	line-height: 1.5;
}

.gmp-form__aviso[hidden] {
	display: none;
}

.gmp-form__aviso--error {
	background: #fdecea;
	border-left: 3px solid var(--gmp-error);
	color: #7f1d1d;
}

.gmp-form__aviso--ok {
	background: #e8f5e9;
	border-left: 3px solid var(--gmp-ok);
	color: #14532d;
}

/* --- Formulario en la solapa ---------------------------------------------- */

.gmp-form-envoltorio--solapa {
	max-width: 640px;
}

.gmp-solapa__bajada {
	color: var(--gmp-gris);
	margin-bottom: 16px;
}

/* --- Preferencia de movimiento reducido ----------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.gmp-boton,
	.gmp-boton__etiqueta {
		transition: none;
	}
}
