/* Mega menu de modelos (ver includes/class-tc-megamenu.php). */

.tc-mm {
	--tc-mm-fondo: #ffffff;
	--tc-mm-tarjeta: #f1efec;
	--tc-mm-texto: #101114;
	--tc-mm-suave: #6b6b6b;
	--tc-mm-rojo: #e30613;

	box-sizing: border-box;
	font-family: "Poppins", sans-serif;
	color: var(--tc-mm-texto);
}

.tc-mm *,
.tc-mm *::before,
.tc-mm *::after {
	box-sizing: border-box;
}

.tc-mm[hidden] {
	display: none !important;
}

/* El que se abre desde el menu: a todo el ancho, bajo el header. */
.tc-mm--flotante {
	position: fixed;
	right: 0;
	left: 0;
	z-index: 99990;
	max-height: calc(100vh - 90px);
	overflow-y: auto;
	border-top: 1px solid rgba(16, 17, 20, 0.06);
	background: var(--tc-mm-fondo);
	box-shadow: 0 24px 50px rgba(16, 17, 20, 0.14);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.tc-mm--flotante.is-abierto {
	opacity: 1;
	transform: none;
}

.tc-mm__dentro {
	display: grid;
	grid-template-columns: 1fr 2.2fr 1fr;
	gap: 28px 36px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 30px 32px 10px;
}

/* Pasajero | Camioneta (la lista larga, 3 por fila) | Pick-up + Comercial */
.tc-mm__grupo:nth-child(-n + 2) {
	grid-row: span 3;
}

.tc-mm__grupo:nth-child(2) .tc-mm__lista {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tc-mm__grupo:nth-child(n + 3) {
	grid-column: 3;
}

.tc-mm .tc-mm__titulo {
	margin: 0 0 14px !important;
	padding: 0 0 10px !important;
	border-bottom: 1px solid rgba(16, 17, 20, 0.08);
	font-family: inherit !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	letter-spacing: 0.14em !important;
	text-transform: uppercase !important;
	color: var(--tc-mm-suave) !important;
}

.tc-mm .tc-mm__lista {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.tc-mm .tc-mm__lista li {
	margin: 0 !important;
	padding: 0 !important;
}

.tc-mm .tc-mm__lista li::before,
.tc-mm .tc-mm__lista li::marker {
	content: none !important;
	display: none !important;
}

.tc-mm .tc-mm__modelo {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 10px 14px 12px;
	border-radius: 16px;
	background: var(--tc-mm-tarjeta);
	text-decoration: none !important;
	color: var(--tc-mm-texto) !important;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tc-mm .tc-mm__modelo:hover,
.tc-mm .tc-mm__modelo:focus-visible {
	background: #ebe8e3;
	box-shadow: 0 10px 24px rgba(16, 17, 20, 0.1);
	transform: translateY(-2px);
	outline: none;
}

.tc-mm__foto {
	display: block;
	aspect-ratio: 16 / 7;
	overflow: hidden;
}

.tc-mm__foto img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform 0.3s ease;
}

.tc-mm__modelo:hover .tc-mm__foto img {
	transform: scale(1.05) translateX(2%);
}

.tc-mm__nombre {
	margin-top: 4px;
	font-family: "Display Text", "Toyota Display", "Poppins", sans-serif;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.25;
}

.tc-mm__nombre::after {
	content: " ›";
	color: var(--tc-mm-rojo);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.tc-mm__modelo:hover .tc-mm__nombre::after {
	opacity: 1;
}

.tc-mm__precio {
	margin-top: 2px;
	font-size: 12px;
	color: var(--tc-mm-suave);
}

.tc-mm__pie {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 28px;
	max-width: 1280px;
	margin: 16px auto 0;
	padding: 16px 32px 22px;
	border-top: 1px solid rgba(16, 17, 20, 0.08);
}

.tc-mm .tc-mm__pie a {
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	color: var(--tc-mm-texto) !important;
}

.tc-mm .tc-mm__pie a span {
	color: var(--tc-mm-rojo);
}

.tc-mm .tc-mm__pie a:hover {
	color: var(--tc-mm-rojo) !important;
}

/* El submenu propio del tema bajo "Modelos" sobra con el panel. */
.tc-megamenu--activo > .sub-menu,
.tc-megamenu--activo > ul {
	display: none !important;
}

/* Tableta: dos columnas */
@media (max-width: 1100px) {
	.tc-mm__dentro {
		grid-template-columns: 1fr 1fr;
	}

	.tc-mm__grupo:nth-child(-n + 2),
	.tc-mm__grupo:nth-child(n + 3) {
		grid-row: auto;
		grid-column: auto;
	}

	.tc-mm__grupo:nth-child(2) {
		grid-column: 1 / -1;
	}

	.tc-mm__grupo:nth-child(2) .tc-mm__lista {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Movil: una columna, tarjetas de dos en dos */
@media (max-width: 700px) {
	.tc-mm--flotante {
		max-height: calc(100vh - 70px);
	}

	.tc-mm__dentro {
		grid-template-columns: 1fr;
		padding: 20px 16px 6px;
	}

	.tc-mm .tc-mm__lista,
	.tc-mm__grupo:nth-child(2) .tc-mm__lista {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tc-mm__nombre {
		font-size: 13px;
	}

	.tc-mm__pie {
		padding: 14px 16px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tc-mm--flotante,
	.tc-mm .tc-mm__modelo,
	.tc-mm__foto img {
		transition: none;
	}
}

/* Todas las tarjetas a la misma altura, con el coche grande. */
.tc-mm__foto {
	aspect-ratio: auto;
	height: 74px;
}

.tc-mm__foto img {
	transform-origin: center;
	transform: scale(1.15);
}

.tc-mm__modelo:hover .tc-mm__foto img {
	transform: scale(1.22) translateX(2%);
}

/* Sin recuadros: los coches sobre blanco; el gris solo al pasar el raton. */
.tc-mm .tc-mm__modelo {
	padding: 6px 12px 12px;
	background: transparent;
}

.tc-mm .tc-mm__modelo:hover,
.tc-mm .tc-mm__modelo:focus-visible {
	background: #f1efec;
	box-shadow: none;
	transform: none;
}

.tc-mm .tc-mm__lista {
	gap: 4px 10px;
}

.tc-mm__dentro,
.tc-mm__pie {
	max-width: 1360px;
}

/* El coche nunca se recorta: sin zoom en el hover (solo se desliza un poco)
   y la foto puede salirse de su caja. */
.tc-mm__foto {
	height: 80px;
	overflow: visible !important;
}

.tc-mm__foto img,
.tc-mm__modelo:hover .tc-mm__foto img {
	transform: none !important;
}

.tc-mm__modelo:hover .tc-mm__foto img {
	transform: translateX(4px) !important;
}

/* Sin recuadros (refuerzo por si el tema o la cache dejan el fondo gris). */
.tc-mm .tc-mm__lista .tc-mm__modelo {
	background: transparent !important;
	box-shadow: none !important;
}

.tc-mm .tc-mm__lista .tc-mm__modelo:hover,
.tc-mm .tc-mm__lista .tc-mm__modelo:focus-visible {
	background: #f1efec !important;
}

/* =======================================================================
   Orden por filas, todo alineado: Pasajero arriba, Camioneta debajo y
   Pick-up y Comercial juntos en la ultima fila. Todas las tarjetas del
   mismo ancho, coche y nombre centrados. Sin precio y sin fondo al pasar
   el raton: solo el nombre en rojo y el coche se desliza un poco.
   ======================================================================= */

@media (min-width: 701px) {
	.tc-mm .tc-mm__dentro {
		grid-template-columns: 1fr 1fr;
		gap: 22px 40px;
		padding-top: 26px;
	}

	.tc-mm .tc-mm__grupo:nth-child(-n + 2) {
		grid-row: auto;
		grid-column: 1 / -1;
	}

	.tc-mm .tc-mm__grupo:nth-child(n + 3) {
		grid-row: auto;
		grid-column: auto;
	}

	.tc-mm .tc-mm__lista,
	.tc-mm .tc-mm__grupo:nth-child(2) .tc-mm__lista {
		grid-template-columns: repeat(auto-fill, minmax(150px, 170px));
		gap: 6px 14px;
	}
}

.tc-mm .tc-mm__titulo {
	margin-bottom: 8px !important;
}

.tc-mm .tc-mm__lista .tc-mm__modelo,
.tc-mm .tc-mm__lista .tc-mm__modelo:hover,
.tc-mm .tc-mm__lista .tc-mm__modelo:focus-visible {
	align-items: center;
	padding: 4px 6px 8px;
	background: transparent !important;
	text-align: center;
}

.tc-mm .tc-mm__nombre {
	margin-top: 2px;
	font-size: 14px;
	transition: color 0.15s ease;
}

.tc-mm .tc-mm__nombre::after {
	content: none;
}

.tc-mm .tc-mm__modelo:hover .tc-mm__nombre,
.tc-mm .tc-mm__modelo:focus-visible .tc-mm__nombre {
	color: var(--tc-mm-rojo);
}

.tc-mm .tc-mm__foto {
	width: 100%;
	height: 74px;
}

/* Movil y tableta: el panel flotante no se usa (ver megamenu.js). */
@media (max-width: 1024px), (hover: none) {
	.tc-mm--flotante {
		display: none !important;
	}
}

/* Filas uniformes: 7 columnas iguales en todas las filas. */
@media (min-width: 1025px) {
	.tc-mm .tc-mm__dentro {
		grid-template-columns: repeat(7, minmax(0, 1fr));
		column-gap: 14px;
	}

	.tc-mm .tc-mm__grupo:nth-child(-n + 2) {
		grid-column: 1 / -1;
	}

	/* Pick-up y Comercial comparten la ultima fila: 3 + 4 columnas. */
	.tc-mm .tc-mm__grupo:nth-child(3) {
		grid-column: 1 / span 3;
	}

	.tc-mm .tc-mm__grupo:nth-child(4) {
		grid-column: 4 / span 4;
	}

	.tc-mm .tc-mm__grupo:nth-child(n + 5) {
		grid-column: 1 / -1;
	}

	.tc-mm .tc-mm__grupo:nth-child(-n + 2) .tc-mm__lista,
	.tc-mm .tc-mm__grupo:nth-child(n + 5) .tc-mm__lista {
		grid-template-columns: repeat(7, minmax(0, 1fr));
	}

	.tc-mm .tc-mm__grupo:nth-child(3) .tc-mm__lista {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tc-mm .tc-mm__grupo:nth-child(4) .tc-mm__lista {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.tc-mm .tc-mm__lista {
		column-gap: 14px !important;
	}
}
