/*
 * Akcni modely na titulni strance.
 *
 * Ctyri vizitky v mrizce, stejne siroke jako novinky pod nimi. Radky uvnitr
 * vizitky se srovnavaji pres subgrid, takze nazvy, parametry i ceny sedi
 * na jedne lince i pri ruzne dlouhych nazvech.
 */

.top_cars.acjc-top {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 24px;
	margin: 6px 0 0;
	padding: 0;
	float: none;
}

.acjc-top__card {
	display: grid;
	grid-row: span 4;
	grid-template-rows: subgrid;
	gap: 0;
	width: auto;
	margin: 0;
	padding: 0 0 16px;
	border: 1px solid #e6e6e6;
	background: #fff;
	color: #1d1d1d !important;
	text-decoration: none !important;
	transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.acjc-top__card:hover {
	border-color: #d8d8d8;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
	transform: translateY(-3px);
}

/*
 * Cela vizitka je jeden odkaz, takze by ji styl webu jinak celou podtrhl
 * a obarvil jako odkaz - vcetne ceny a parametru. Podtrzeni sundavame
 * uplne a barvy si rika kazdy prvek sam.
 */
.acjc-top__card,
.acjc-top__card:hover,
.acjc-top__card:focus,
.acjc-top__card *,
.acjc-top__card:hover * {
	border-bottom: 0;
	text-decoration: none !important;
	text-underline-offset: 0;
}

/* --- Fotka --------------------------------------------------------------- */

.acjc-top__media {
	position: relative;
	display: block;
	overflow: hidden;
	/*
	 * Presne pomer fotek ze skladu (640 x 400). Kdyz se ramecek lisil,
	 * zbyval nad vozem a pod nim bily pruh.
	 */
	aspect-ratio: 8 / 5;
	background: #f1f1f1;
}

.acjc-top__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.acjc-top__card:hover .acjc-top__media img {
	transform: scale(1.04);
}

.acjc-top__noimg {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f3f3f3, #e7e7e7);
}

/*
 * Stitek patri doprava - vlevo nahore ma prodejce na fotkach vlastni logo
 * a sleva by mu sedela pres nej.
 */
.acjc-top__save,
.acjc-top__kind {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 5px 10px;
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.acjc-top__save {
	background: #1b7a35;
}

.acjc-top__kind {
	background: rgba(0, 0, 0, .62);
}

/* --- Text ---------------------------------------------------------------- */

.acjc-top__title {
	display: block;
	margin: 0;
	padding: 14px 16px 0;
	color: #1d1d1d;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
}

/*
 * Sloupcu je presne tolik, kolik je udaju - pri trech se text nezlomi
 * a nemusi se orezavat.
 */
.acjc-top__params {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 4px;
	padding: 12px 10px 0;
	align-content: start;
}

.acjc-top__param {
	display: grid;
	justify-items: center;
	gap: 3px;
	min-width: 0;
	color: #5f5f5f;
	font-size: 13px;
	line-height: 1.2;
	text-align: center;
}

.acjc-top__param > span {
	overflow: hidden;
	width: 100%;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.acjc-top__ikona {
	display: block;
	width: 22px;
	height: 22px;
	object-fit: contain;
}

/* --- Cena a vyzva -------------------------------------------------------- */

.acjc-top__foot {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 14px 16px 0;
}

.acjc-top__price {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.acjc-top__now {
	color: var(--acjc-accent-ink, #c85a00);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
}

.acjc-top__was {
	color: #8b8b8b;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: line-through;
	white-space: nowrap;
}

.acjc-top__cta {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 14px;
	background: var(--acjc-accent, #fe7912);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background .15s ease;
}

.acjc-top__card:hover .acjc-top__cta {
	background: var(--acjc-accent-dark, #c85a00);
}

/* Starsi prohlizec bez subgridu dostane prosty sloupec. */
@supports not (grid-template-rows: subgrid) {
	.acjc-top__card {
		display: flex;
		flex-direction: column;
	}

	.acjc-top__params {
		flex: 1 0 auto;
	}
}

@media only screen and (max-width: 1240px) {
	.top_cars.acjc-top {
		gap: 22px 18px;
	}

	.acjc-top__title {
		font-size: 17px;
	}

	.acjc-top__now {
		font-size: 20px;
	}
}

@media only screen and (max-width: 959px) {
	.top_cars.acjc-top {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media only screen and (max-width: 767px) {
	.top_cars.acjc-top {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
	}

	.acjc-top__title {
		padding: 10px 10px 0;
		font-size: 15px;
	}

	.acjc-top__params {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px 4px;
		padding: 10px 8px 0;
	}

	.acjc-top__foot {
		/* Cena a tlacitko pod sebou, at se nic nezalamuje na dva radky. */
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 12px 10px 0;
	}

	.acjc-top__now {
		font-size: 18px;
	}

	.acjc-top__cta {
		justify-content: center;
		height: 36px;
	}
}
