/* Comparador de Luz y Gas
   Todo va dentro de #clg-app para que el tema de WordPress no lo descoloque.
   Se adapta al ancho real del hueco donde está (container queries). */

#clg-app {
	--clg-tinta: #1c2b4a;
	--clg-texto: #33405a;
	--clg-tenue: #5d6b82;
	--clg-linea: #d5dce6;
	--clg-suave: #f2f5f9;
	--clg-luz: #f2b705;
	--clg-luz-suave: #fff6d6;
	--clg-gas: #2f6feb;
	--clg-gas-suave: #e3ecfd;
	--clg-ahorro: #157347;
	--clg-ahorro-suave: #e5f4ec;
	--clg-error: #b42318;
	--clg-acento: var(--clg-luz);
	--clg-acento-suave: var(--clg-luz-suave);
	container-type: inline-size;
	container-name: clg;
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	color: var(--clg-texto);
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}
#clg-app.clg-simple { max-width: 800px; }
#clg-app[data-tipo="gas"] { --clg-acento: var(--clg-gas); --clg-acento-suave: var(--clg-gas-suave); }

/* ---------- Limpieza de estilos del tema ---------- */
#clg-app, #clg-app *, #clg-app *::before, #clg-app *::after { box-sizing: border-box; }
#clg-app :where(h1, h2, h3, p, ul, ol, li, dl, dt, dd, figure, details, summary) { margin: 0; padding: 0; border: 0; background: none; }
#clg-app :where(ul, ol) { list-style: none; }
#clg-app :where(li)::marker { content: none; }
#clg-app :where(h2, h3) { color: var(--clg-tinta); font-weight: 800; text-transform: none; letter-spacing: -.01em; }
#clg-app :where(a) { color: var(--clg-tinta); }
#clg-app :where(button, input, label) { font: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; }
#clg-app :where(button) { width: auto; }
#clg-app :where(img, svg) { max-width: 100%; height: auto; }
#clg-app [hidden], #clg-app .clg-oculto[hidden] { display: none !important; }
#clg-app[data-tipo="gas"] .clg-solo-luz,
#clg-app[data-tipo="luz"] .clg-solo-gas { display: none !important; }
#clg-app .clg-oculto {
	position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
	overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0;
}
/* Textos según si el aparato es táctil (móvil) o con ratón (ordenador) */
#clg-app .clg-solo-tactil { display: none !important; }
@media (hover: none) and (pointer: coarse) {
	#clg-app .clg-solo-tactil { display: flex !important; }
	#clg-app span.clg-solo-tactil { display: block !important; }
	#clg-app .clg-solo-raton { display: none !important; }
}

#clg-app h2 { font-size: clamp(1.5rem, 4cqi, 2.1rem); line-height: 1.2; margin-bottom: .5rem; }
#clg-app h3 { font-size: 1.15rem; line-height: 1.3; margin-bottom: .4rem; }
#clg-app p { margin-bottom: .75rem; }
#clg-app .clg-entradilla { font-size: 1.05rem; max-width: 62ch; margin-bottom: 1.5rem; }
#clg-app .clg-pista { font-size: .85rem; color: var(--clg-tenue); margin: .25rem 0 1rem; }

/* ---------- Botones ---------- */
#clg-app .clg-boton {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
	padding: .85em 1.5em; margin: 0; border-radius: 12px; border: 2px solid var(--clg-tinta);
	background: var(--clg-tinta); color: #fff; text-align: center;
}
#clg-app .clg-boton:hover { background: #2a3d63; border-color: #2a3d63; color: #fff; }
#clg-app .clg-boton-sec { background: #fff; color: var(--clg-tinta); }
#clg-app .clg-boton-sec:hover { background: var(--clg-suave); color: var(--clg-tinta); border-color: var(--clg-tinta); }
#clg-app .clg-boton-acento { background: var(--clg-luz); border-color: var(--clg-luz); color: var(--clg-tinta); }
#clg-app .clg-boton-acento:hover { background: #ffcd2e; border-color: #ffcd2e; color: var(--clg-tinta); }
#clg-app .clg-boton-grande { font-size: 1.1rem; padding: 1em 1.8em; }
#clg-app .clg-boton-peq { font-size: .92rem; padding: .6em 1.1em; }
#clg-app .clg-icono { width: 1.3em; height: 1.3em; flex: none; }
#clg-app .clg-enlace {
	appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
	color: var(--clg-tinta); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
#clg-app .clg-boton:focus-visible, #clg-app .clg-enlace:focus-visible, #clg-app .clg-tipo:focus-visible,
#clg-app .clg-perfil:focus-visible, #clg-app .clg-filtro:focus-visible, #clg-app summary:focus-visible,
#clg-app a:focus-visible, #clg-app .clg-boton:focus-within, #clg-app .clg-zona:focus-within {
	outline: 3px solid var(--clg-gas); outline-offset: 3px;
}

/* ---------- Barra superior ---------- */
#clg-app .clg-cabecera {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 1rem 0; border-bottom: 1px solid var(--clg-linea);
}
#clg-app .clg-logo-web { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--clg-tinta); min-width: 0; }
#clg-app .clg-logo-simbolo { width: 44px; height: 44px; flex: none; display: block; }
#clg-app .clg-logo-nombre { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#clg-app .clg-logo-img { display: block; max-height: 52px; width: auto; max-width: 220px; }
#clg-app .clg-menu { display: flex; gap: 1.5rem; }
#clg-app .clg-menu a { color: var(--clg-tinta); font-weight: 600; text-decoration: none; }
#clg-app .clg-menu a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Portada ---------- */
#clg-app .clg-portada { max-width: 760px; margin: 0 auto; padding: clamp(2rem, 7cqi, 4.5rem) 0 clamp(1.5rem, 4cqi, 2.5rem); text-align: center; }
#clg-app .clg-portada-titulo { font-size: clamp(2.1rem, 7.5cqi, 3.8rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 1rem; }
#clg-app .clg-portada-sub { font-size: clamp(1.05rem, 2.6cqi, 1.25rem); max-width: 46ch; margin: 0 auto 2rem; }

/* La casilla "Sube aquí tu factura": el protagonista */
#clg-app .clg-subida { text-align: center; scroll-margin-top: 90px; }
#clg-app .clg-zona {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem;
	width: 100%; padding: clamp(1.75rem, 6cqi, 3rem) 1.25rem; cursor: pointer;
	background: var(--clg-luz-suave); border: 3px dashed var(--clg-luz); border-radius: 24px;
	transition: background-color .15s, border-color .15s, transform .15s;
}
#clg-app .clg-zona:hover, #clg-app .clg-zona.is-arrastrando { background: #ffefb0; border-style: solid; }
#clg-app .clg-zona.is-arrastrando { transform: scale(1.01); }
#clg-app .clg-zona-icono { width: 64px; height: 64px; color: var(--clg-tinta); display: block; }
#clg-app .clg-zona-icono svg { width: 100%; height: 100%; display: block; }
#clg-app .clg-zona-titulo { font-size: clamp(1.5rem, 5cqi, 2rem); font-weight: 800; color: var(--clg-tinta); line-height: 1.15; }
#clg-app .clg-zona-texto { font-size: 1rem; color: var(--clg-texto); max-width: 36ch; }
#clg-app .clg-zona-boton {
	display: inline-flex; margin-top: .75rem; padding: .9em 1.8em; border-radius: 12px;
	background: var(--clg-tinta); color: #fff; font-weight: 700; font-size: 1.05rem;
}
#clg-app .clg-zona:hover .clg-zona-boton { background: #2a3d63; }
#clg-app .clg-zona.is-cargando { cursor: progress; border-style: solid; }
#clg-app .clg-zona.is-cargando .clg-zona-boton { opacity: .5; }
#clg-app .clg-zona.is-cargando .clg-zona-icono { animation: clg-latido 1.2s ease-in-out infinite; }
#clg-app .clg-zona.is-ok { background: var(--clg-ahorro-suave); border-color: var(--clg-ahorro); }
@keyframes clg-latido { 50% { transform: translateY(-6px); } }

#clg-app .clg-boton-foto { width: 100%; margin-top: .75rem; }
#clg-app .clg-estado { font-size: 1rem; margin: 0; }
#clg-app .clg-estado:empty { display: none; }
#clg-app .clg-estado-factura { margin-top: 1rem; padding: .8rem 1rem; border-radius: 12px; background: var(--clg-suave); color: var(--clg-tinta); font-weight: 600; }
#clg-app .clg-estado.is-error { background: #fdecea; color: var(--clg-error); }
#clg-app .clg-estado-factura.is-ok { background: var(--clg-ahorro-suave); color: var(--clg-ahorro); }
#clg-app .clg-estado.is-cargando::before {
	content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.15em;
	border: 2px solid var(--clg-linea); border-top-color: var(--clg-tinta); border-radius: 50%;
	animation: clg-giro .8s linear infinite;
}
@keyframes clg-giro { to { transform: rotate(360deg); } }
#clg-app .clg-subida-legal { font-size: .85rem; color: var(--clg-tenue); margin: .9rem 0 0; }
#clg-app .clg-subida-legal a { color: var(--clg-tenue); }
#clg-app .clg-aviso-admin { font-size: .9rem; margin: 1rem 0 0; padding: .9rem 1rem; border-radius: 12px; background: var(--clg-luz-suave); text-align: left; }

#clg-app .clg-portada-alternativas { margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .35rem .5rem; font-size: .98rem; }
#clg-app .clg-garantias { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-top: 1.5rem; font-size: .95rem; color: var(--clg-tinta); }
#clg-app .clg-garantias li { position: relative; padding-left: 1.5em; }
#clg-app .clg-garantias li::before {
	content: ""; position: absolute; left: .1em; top: .3em; width: .95em; height: .55em;
	border-left: 3px solid var(--clg-ahorro); border-bottom: 3px solid var(--clg-ahorro); transform: rotate(-45deg);
}

/* ---------- Análisis (resultado de la factura) ---------- */
#clg-app .clg-analisis { max-width: 860px; margin: 0 auto 1rem; padding: 1.5rem 0 2rem; scroll-margin-top: 90px; }
#clg-app .clg-veredicto-caja {
	background: var(--clg-tinta); color: #d4dcea; border-radius: 22px; box-shadow: inset 0 8px 0 var(--clg-luz);
	padding: clamp(1.4rem, 4cqi, 2.2rem); margin-bottom: 1.25rem;
}
#clg-app .clg-veredicto-etiqueta { font-size: .95rem; margin-bottom: .4rem; }
#clg-app .clg-veredicto-cifra { font-size: clamp(1.6rem, 5.5cqi, 2.6rem); line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: -.02em; margin-bottom: 1rem; }
#clg-app .clg-veredicto-cifra strong { color: var(--clg-luz); white-space: nowrap; }
#clg-app .clg-veredicto-texto { font-size: 1.02rem; margin-bottom: 1.1rem; max-width: 60ch; }
#clg-app .clg-veredicto-comparacion { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
#clg-app .clg-veredicto-comparacion p { margin: 0; padding: .9rem 1rem; border-radius: 14px; background: rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: .2rem; }
#clg-app .clg-veredicto-comparacion span { font-size: .9rem; }
#clg-app .clg-veredicto-comparacion strong { font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums; }

#clg-app .clg-revisar { border: 1px solid var(--clg-linea); border-radius: 16px; background: #fff; margin-bottom: 1.5rem; }
#clg-app .clg-revisar > summary {
	cursor: pointer; list-style: none; padding: 1rem 1.25rem; font-weight: 700; color: var(--clg-tinta);
	display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
#clg-app .clg-revisar > summary::-webkit-details-marker { display: none; }
#clg-app .clg-revisar > summary::after { content: "+"; font-size: 1.5rem; line-height: 1; font-weight: 400; }
#clg-app .clg-revisar[open] > summary::after { content: "–"; }
#clg-app .clg-datos { padding: 0 1.25rem 1.25rem; }
#clg-app .clg-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 1rem 1.25rem; margin: 1rem 0 .25rem; }
#clg-app .clg-campo label { display: block; font-weight: 600; font-size: .92rem; color: var(--clg-tinta); margin: 0 0 .3rem; }
#clg-app .clg-campo input {
	display: block; width: 100%; height: auto; font-size: 1rem; color: var(--clg-tinta); background: #fff;
	padding: .7em .8em; margin: 0; border: 1px solid var(--clg-linea); border-radius: 10px;
}
#clg-app .clg-campo input:focus { outline: 2px solid var(--clg-acento); outline-offset: 1px; border-color: var(--clg-tinta); }
#clg-app .clg-estado-datos { margin-top: .75rem; padding: .7rem .9rem; border-radius: 10px; }

/* ---------- Secciones ---------- */
#clg-app .clg-seccion { padding: clamp(2.5rem, 7cqi, 4rem) 0; scroll-margin-top: 90px; }
#clg-app .clg-controles { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: 1rem; }

/* Luz / Gas */
#clg-app .clg-tipos { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 .5rem; background: #fff; border: 1px solid var(--clg-linea); border-radius: 999px; }
#clg-app .clg-controles .clg-tipos { margin: 0; }
#clg-app .clg-tipo {
	appearance: none; border: 0; margin: 0; background: transparent; color: var(--clg-tinta);
	font-weight: 700; font-size: 1rem; padding: .55em 1.7em; border-radius: 999px; cursor: pointer; line-height: 1.2;
}
#clg-app .clg-tipo:hover { background: var(--clg-suave); color: var(--clg-tinta); }
#clg-app .clg-tipo.is-activo { background: var(--clg-acento); color: var(--clg-tinta); }
#clg-app[data-tipo="gas"] .clg-tipo.is-activo { color: #fff; }

/* Perfiles y filtros */
#clg-app .clg-perfiles { display: flex; flex-wrap: wrap; gap: .5rem; }
#clg-app .clg-perfil {
	appearance: none; cursor: pointer; text-align: left; margin: 0; font-size: 1rem;
	display: flex; flex-direction: column; padding: .55em 1.1em; border-radius: 12px;
	background: #fff; color: var(--clg-tinta); border: 1px solid var(--clg-linea); line-height: 1.25;
}
#clg-app .clg-perfil:hover { background: var(--clg-suave); color: var(--clg-tinta); }
#clg-app .clg-perfil span { font-size: .8rem; color: var(--clg-tenue); }
#clg-app .clg-perfil.is-activo { border-color: var(--clg-tinta); box-shadow: inset 0 0 0 1px var(--clg-tinta); }
#clg-app .clg-filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
#clg-app .clg-filtro {
	appearance: none; font-size: .9rem; cursor: pointer; margin: 0; line-height: 1.3;
	padding: .4em .95em; border-radius: 999px; border: 1px solid var(--clg-linea); background: #fff; color: var(--clg-tinta);
}
#clg-app .clg-filtro:hover { background: var(--clg-suave); color: var(--clg-tinta); }
#clg-app .clg-filtro.is-activo { background: var(--clg-tinta); border-color: var(--clg-tinta); color: #fff; }
#clg-app .clg-perfil-resumen { font-size: .9rem; color: var(--clg-tenue); margin-bottom: 1.25rem; }

/* ---------- Tarjetas de tarifas ---------- */
#clg-app .clg-titulo { margin: 0 0 .25rem; }
#clg-app .clg-lista { margin: 1rem 0 0; display: grid; gap: .75rem; }
#clg-app .clg-tarifa {
	display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .75rem;
	padding: 1.1rem 1.25rem; background: #fff; border: 1px solid var(--clg-linea); border-radius: 16px;
}
#clg-app .clg-tarifa.es-mejor { border: 2px solid var(--clg-acento); box-shadow: 0 0 0 6px var(--clg-acento-suave); }
#clg-app .clg-posicion { font-size: 1.35rem; font-weight: 800; color: #b3bdcc; line-height: 1.6; font-variant-numeric: tabular-nums; }
#clg-app .es-mejor .clg-posicion { color: var(--clg-tinta); }
#clg-app .clg-mejor-aviso { font-weight: 700; font-size: .88rem; color: var(--clg-tinta); margin-bottom: .6rem; }
#clg-app .clg-tarifa-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; }
#clg-app .clg-marca { display: flex; align-items: center; gap: .75rem; min-width: 0; }
#clg-app .clg-logo { width: 46px; height: 46px; flex: none; object-fit: contain; border-radius: 10px; border: 1px solid var(--clg-linea); background: #fff; padding: 4px; }
#clg-app .clg-logo-inicial { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: var(--clg-suave); color: var(--clg-tinta); font-weight: 800; font-size: 1.2rem; }
#clg-app .clg-compania { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--clg-tinta); line-height: 1.25; }
#clg-app .clg-nombre { margin: 0; color: var(--clg-tenue); font-size: .95rem; }
#clg-app .clg-precio { margin: 0; text-align: right; }
#clg-app .clg-importe { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--clg-tinta); font-variant-numeric: tabular-nums; }
#clg-app .clg-importe small { font-size: .5em; font-weight: 700; margin-left: .1em; }
#clg-app .es-mejor .clg-importe { font-size: 2.1rem; }
#clg-app .clg-periodo { font-size: .85rem; color: var(--clg-tenue); }
#clg-app .clg-etiquetas { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0 0; }
#clg-app .clg-etiqueta { font-size: .8rem; padding: .2em .65em; border-radius: 6px; background: var(--clg-suave); color: var(--clg-tinta); }
#clg-app .clg-etiqueta-promo { background: var(--clg-luz-suave); font-weight: 700; }
#clg-app .clg-ahorro { margin: .7rem 0 0; font-weight: 700; color: var(--clg-ahorro); }
#clg-app .clg-mas { margin: .7rem 0 0; color: var(--clg-error); }
#clg-app .clg-igual, #clg-app .clg-detalle-factura { margin: .7rem 0 0; font-size: .92rem; }
#clg-app .clg-notas { margin: .6rem 0 0; font-size: .92rem; }
#clg-app .clg-tarifa-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-top: .9rem; }
#clg-app .clg-precios { font-size: .9rem; }
#clg-app .clg-precios summary { cursor: pointer; color: var(--clg-tinta); font-weight: 600; padding: .3em 0; }
#clg-app .clg-precios dl { margin: .4rem 0 0; display: grid; gap: .15rem; }
#clg-app .clg-precios dt { font-weight: 700; color: var(--clg-tinta); margin-top: .35rem; }
#clg-app .clg-precios dd { font-variant-numeric: tabular-nums; }
#clg-app .clg-ver-todas { margin-top: 1.25rem; }
#clg-app .clg-vacio { padding: 1rem 1.25rem; background: var(--clg-suave); border-radius: 12px; }
#clg-app .clg-aviso { margin-top: 1rem; font-size: .82rem; color: var(--clg-tenue); }

/* ---------- Cómo funciona ---------- */
#clg-app .clg-pasos { counter-reset: paso; margin-top: 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.75rem; }
#clg-app .clg-pasos li { counter-increment: paso; padding-top: 3.4rem; position: relative; }
#clg-app .clg-pasos li::before {
	content: counter(paso); position: absolute; top: 0; left: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem;
	background: var(--clg-luz); color: var(--clg-tinta);
}

/* ---------- Preguntas ---------- */
#clg-app .clg-preguntas { max-width: 760px; margin-top: 1.25rem; border-top: 1px solid var(--clg-linea); }
#clg-app .clg-preguntas details { border-bottom: 1px solid var(--clg-linea); }
#clg-app .clg-preguntas summary { cursor: pointer; font-weight: 700; color: var(--clg-tinta); padding: 1rem 0; font-size: 1.05rem; }
#clg-app .clg-preguntas details p { padding-bottom: 1rem; margin: 0; }

/* ---------- Cierre ---------- */
#clg-app .clg-final { background: var(--clg-tinta); color: #c9d3e3; border-radius: 24px; padding: clamp(2rem, 6cqi, 3.25rem); margin: 1rem 0 2rem; text-align: center; }
#clg-app .clg-final h2 { color: #fff; }
#clg-app .clg-final p { max-width: 52ch; margin: 0 auto 1.4rem; }

/* ---------- Pantallas estrechas (móvil o hueco pequeño) ---------- */
@container clg (max-width: 700px) {
	#clg-app .clg-menu { display: none; }
	#clg-app .clg-cabecera { justify-content: center; }
}
@container clg (max-width: 520px) {
	#clg-app .clg-portada { padding-top: 1.5rem; }
	#clg-app .clg-portada-sub { margin-bottom: 1.5rem; }
	#clg-app .clg-zona { border-radius: 20px; }
	#clg-app .clg-zona-icono { width: 52px; height: 52px; }
	#clg-app .clg-zona-boton { width: 100%; justify-content: center; }
	#clg-app .clg-garantias { flex-direction: column; align-items: center; gap: .4rem; }
	#clg-app .clg-tarifa { grid-template-columns: 1fr; gap: .25rem; padding: 1rem; }
	#clg-app .clg-posicion { line-height: 1; }
	#clg-app .clg-precio { text-align: left; width: 100%; }
	#clg-app .clg-tarifa-pie .clg-boton { width: 100%; }
	#clg-app .clg-veredicto-caja .clg-boton { width: 100%; }
	#clg-app .clg-tipos { display: flex; width: 100%; }
	#clg-app .clg-tipo { flex: 1; padding: .6em 1em; }
	#clg-app .clg-datos { padding: 0 1rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	#clg-app .clg-zona, #clg-app .clg-zona-icono { transition: none; animation: none !important; }
	#clg-app .clg-estado.is-cargando::before { animation: none; }
}
