/*
 * Product tile of najlepsiemobily.sk (site layer): the homepage "Najviac ušetríte" tile and the
 * category archive card (catalog.js swaps the plugin card for it). Markup: nm_home_tile() in
 * inc/home.php; the archive gets it as the "tile" field of mobilky_cat_card_meta().
 *
 * article.nmh-tile > .nmh-tile__top (discount, Home Credit, no charger) · a.nmh-tile__media (photo,
 * .nmh-tile__info: colour dots chip + free shipping) · .nmh-tile__head (name, rating) · ul.nmh-tile__tags ·
 * p.nmh-tile__stock · .nmh-tile__deal (coupon strip, price, cart button)
 */

.nmh-tile {
	position: relative;
	font-family: var(--nd-font);
	color: var(--nd-c-ink);
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	padding: 16px 18px 18px;
	background: #fff;
	font-size: 15px;
	transition: box-shadow .2s;
}
.nmh-tile a {
	color: inherit;
	text-decoration: none;
}
.nmh-tile:hover {
	position: relative;
	z-index: 1;
	box-shadow: 0 10px 32px rgba(15, 65, 87, .16);
}
.nmh-tile > div {
	flex-direction: row;
}
/* Discount, Home Credit and no charger float over the top of the photo (lower tile). */
.nmh-tile .nmh-tile__top {
	position: absolute;
	top: 16px;
	right: 18px;
	left: 18px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	min-height: 28px;
	pointer-events: none;
}
.nmh-tile .nmh-tile__top > * {
	pointer-events: auto;
}
.nmh-tile .nmh-tile__nocharger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--white, #fff) 85%, transparent);
}
.nmh-tile .nmh-tile__pct {
	flex: none;
	white-space: nowrap;
	margin-left: -18px;
	padding: 6px 14px 6px 18px;
	border-radius: 0 999px 999px 0;
	background: #c4122f;
	color: #fff;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.1;
}
.nmh-tile .nmh-tile__badges {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	color: var(--nd-c-muted, #6b7280);
}
.nmh-tile .nmh-tile__hc {
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--primary-ultra-light);
	color: var(--primary-dark);
	font-size: 13px;
	white-space: nowrap;
}
.nmh-tile .nmh-tile__hc b {
	color: var(--primary-semi-dark);
}
.nmh-tile .nmh-tile__media {
	position: relative;
	display: block;
	height: 190px;
}
.nmh-tile .nmh-tile__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform .25s;
}
.nmh-tile:hover .nmh-tile__media img {
	transform: scale(1.04);
}
.nmh-tile .nmh-tile__info {
	position: absolute;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
}
/* Colours: only the dots, as a chip above "Doprava zadarmo"; the count stays for screen readers. */
.nmh-tile .nmh-tile__colors {
	display: inline-flex;
	padding: 5px 8px;
	border-radius: 999px;
	background: var(--nd-c-brand-tint);
	line-height: 1;
}
.nmh-tile .nmh-tile__colors .card-colors {
	position: relative;
	width: auto;
	height: 14px;
	margin: 0;
}
.nmh-tile .nmh-tile__colors .card-colors__count {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.nmh-tile .nmh-tile__head {
	display: block;
}
.nmh-tile .nmh-tile__name {
	display: -webkit-box;
	min-height: calc(2 * 1.3em);
	overflow: hidden;
	color: var(--nd-c-text, #1c1c1c);
	font-size: 18px;
	font-weight: var(--nd-fw-semibold, 600);
	line-height: 1.3;
	text-decoration: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.nmh-tile .nmh-tile__head .pcard__rating {
	min-height: 20px;
	margin-top: 4px;
	font-size: 15px;
}
.nmh-tile .nmh-tile__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 0 -18px;
	padding: 0;
	list-style: none;
}
.nmh-tile .nmh-tile__tags li {
	flex: 1 1 0;
	min-width: max-content;
	padding: 3px 9px;
	text-align: center;
	border-radius: 0;
	background: var(--primary-ultra-light);
	color: var(--primary-dark);
	font-size: 14px;
	font-weight: 600;
}
.nmh-tile .nmh-tile__tags li.is-seal {
	background: #e7f6ec;
	color: #11743a;
}
.nmh-tile .nmh-tile__stock {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 5px;
	margin: 0;
	color: var(--nd-c-muted, #6b7280);
	font-size: 15px;
}
.nmh-tile .nmh-tile__stock i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #16a34a;
	box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}
.nmh-tile .nmh-tile__stock b {
	color: #11743a;
}
/* Stock: box icon + "Skladom", then truck icon + "3–5 dní" – one line at every tile width, the same
   line icons (mobilky_card_icon(), 17px). */
.nmh-tile .nmh-tile__instock,
.nmh-tile .nmh-tile__days {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-left: 4px;
	color: var(--nd-c-text, #1c1c1c);
	font-weight: 600;
	white-space: nowrap;
}
.nmh-tile .nmh-tile__instock {
	margin-left: 0;
	color: #11743a;
	font-weight: 700;
}
.nmh-tile .nmh-tile__instock svg,
.nmh-tile .nmh-tile__days svg {
	flex: none;
	width: 17px;
	height: 17px;
	color: var(--primary);
}
.nmh-tile .nmh-tile__instock svg {
	color: currentColor;
}
.nmh-tile .nmh-tile__stock.is-out i {
	background: #9ca3af;
	box-shadow: none;
}
.nmh-tile .nmh-tile__ship {
	padding: 3px 9px;
	border-radius: 999px;
	background: #e7f6ec;
	color: #11743a;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}
/* Price box: coupon strip with the saving on top, then the price (never wraps) and the cart button. */
.nmh-tile > .nmh-tile__deal {
	display: flex;
	flex-direction: column;
	margin: auto -17px -17px -18px; /* 1px right and bottom stays for the grid line */
	border-top: 1px solid var(--primary-light);
	background: #fff;
}
.nmh-tile .nmh-tile__cpn {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 2px 8px;
	padding: 7px 18px;
	border-bottom: 1px dashed var(--primary-light);
	background: var(--primary-ultra-light);
	color: var(--primary-dark);
	font-size: 13px;
}
.nmh-tile .nmh-tile__cpn code {
	padding: 0 5px;
	border: 1px dashed var(--primary);
	border-radius: 4px;
	background: #fff;
	color: var(--primary-semi-dark);
	font-family: inherit;
	font-weight: 700;
}
.nmh-tile .nmh-tile__cpn b {
	color: #c4122f;
	white-space: nowrap;
}
.nmh-tile .nmh-tile__row {
	display: flex;
	flex-wrap: wrap; /* a price wider than the room beside the button pushes the button below */
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 18px 14px;
}
.nmh-tile .nmh-tile__amounts {
	display: flex;
	flex: 1000 1 0; /* wraps on its narrowest content (the price), takes nearly all free space */
	flex-direction: column;
}
.nmh-tile .nmh-tile__now {
	color: var(--nd-c-text, #1c1c1c);
	font-size: 20px;
	font-weight: 800;
	line-height: 1.05;
	white-space: nowrap;
}
.nmh-tile .nmh-tile__was {
	display: flex;
	flex-wrap: wrap; /* the saving drops under the old price instead of running under the button */
	column-gap: 4px;
	color: var(--nd-c-muted, #6b7280);
	font-size: 13px;
}
.nmh-tile .nmh-tile__was s,
.nmh-tile .nmh-tile__was em {
	white-space: nowrap;
}
.nmh-tile .nmh-tile__cart {
	display: flex;
	flex: 1 0 auto; /* beside the price it barely grows; alone on its line it spans the row */
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 42px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: var(--nd-c-cta);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
	transition: background .15s;
}
.nmh-tile .nmh-tile__cart:hover,
.nmh-tile .nmh-tile__cart:focus-visible {
	background: var(--nd-c-cta-hover);
	color: #fff;
}
.nmh-tile .nmh-tile__cart.added::after {
	display: none;
}



/* Without a coupon: the price box is one light panel – price over the old price on the left,
   "Akciová cena" over the saving on the right, the cart button across the tile below. */
.nmh-tile {
	container: nmtile / inline-size;
}
.nmh-tile > .nmh-tile__deal--plain {
	background: var(--nd-c-brand-tint);
}
.nmh-tile > .nmh-tile__deal--plain > .nmh-tile__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 10px 8px;
	padding: 10px 18px 12px;
}
.nmh-tile > .nmh-tile__deal--plain .nmh-tile__now {
	font-size: 20px;
	line-height: 1;
	letter-spacing: -.01em;
}
.nmh-tile .nmh-tile__note {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 3px;
	margin: 0;
	color: var(--primary-dark);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	text-align: right;
	white-space: nowrap;
}
.nmh-tile .nmh-tile__note b {
	color: #c4122f;
	font-weight: 700;
}
.nmh-tile > .nmh-tile__deal--plain .nmh-tile__cart {
	grid-column: 1 / -1;
	height: 40px;
}
@container nmtile (max-width: 200px) {
	.nmh-tile > .nmh-tile__deal--plain > .nmh-tile__row {
		padding-right: 10px;
		padding-left: 10px;
	}
	.nmh-tile .nmh-tile__note {
		font-size: 12px;
	}
}

/* On WooCommerce pages (body.woocommerce) the legacy Oxygen stylesheet paints every a.button with
   !important (165-header-compiled.css: primary blue, uppercase, padding); the tile keeps its own button. */
.woocommerce .nmh-tile a.nmh-tile__cart {
	padding: 0 14px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--nd-c-cta) !important;
	color: #fff !important;
	font-size: 15px !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	box-shadow: none !important;
}
.woocommerce .nmh-tile a.nmh-tile__cart:hover,
.woocommerce .nmh-tile a.nmh-tile__cart:focus-visible {
	background: var(--nd-c-cta-hover) !important;
	box-shadow: none !important;
}

/* Category archive: the tile fills the plugin card (#cat-results .wa-is-card draws the grid lines
   outside its box), so the price box runs to the card edge on every side. */
.wa-is-card.cat-card--tile {
	display: flex;
}
.wa-is-card.cat-card--tile > .nmh-tile {
	flex: 1;
	min-width: 0;
}
.cat-card--tile > .nmh-tile > .nmh-tile__deal {
	margin: auto -18px -18px;
}

@media (max-width: 640px) {
	.nmh-tile { padding: 12px 10px; font-size: 14px; }
	.nmh-tile .nmh-tile__top { top: 12px; right: 10px; left: 10px; }
	.nmh-tile .nmh-tile__tags { margin: 0 -10px; }
	.nmh-tile .nmh-tile__media { height: 140px; }
	.nmh-tile .nmh-tile__name { font-size: 16px; }
	.nmh-tile .nmh-tile__hc, .nmh-tile .nmh-tile__nocharger { display: none; }
	.nmh-tile .nmh-tile__pct { margin-left: -10px; padding-left: 10px; font-size: 16px; }
	.nmh-tile > .nmh-tile__deal { margin: auto -9px -11px -10px; }
	.nmh-tile .nmh-tile__row { flex-direction: column; align-items: stretch; padding: 8px 10px 10px; }
	.nmh-tile .nmh-tile__cpn { padding: 5px 10px; font-size: 12px; }
	.nmh-tile .nmh-tile__cart { justify-content: center; }
	.nmh-tile .nmh-tile__ship { font-size: 12px; }
	.cat-card--tile > .nmh-tile > .nmh-tile__deal { margin: auto -10px -12px; }
}
