/**
 * Rychlý nákup – styly (inspirováno janovapec.cz/rychly-nakup)
 */

.rn-wrap {
	max-width: 1200px;
	margin: 0 auto;
}

/* Sekce kategorie */
.rn-category {
	margin: 0 0 36px;
}

.rn-category-title {
	text-align: center;
	margin: 0 0 20px;
}

.rn-rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Řádek produktu */
.rn-row {
	display: grid;
	grid-template-columns: 110px 1.6fr 0.8fr auto 1fr 1fr;
	align-items: center;
	gap: 20px;
	background: #fff;
	border-radius: 14px;
	padding: 0 28px 0 0;
	min-height: 110px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
	overflow: hidden;
	position: relative;
	transition: box-shadow 0.2s ease;
}

.rn-row.rn-has-qty {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.rn-buy.rn-loading {
	opacity: 0.75;
}

/* ---------- Karta produktu (fotka + název + řádky/varianty) ---------- */
.rn-product {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 0 22px;
	background: #fff;
	border-radius: 14px;
	min-height: 120px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

.rn-product .rn-col-img {
	align-self: stretch;
}

.rn-product-body {
	padding: 10px 24px 10px 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.rn-product .rn-col-name {
	margin-bottom: 2px;
}

/* Jednotlivé řádky variant uvnitř karty */
.rn-lines {
	display: flex;
	flex-direction: column;
}

.rn-line {
	display: grid;
	grid-template-columns: 0.7fr auto 1fr 1fr;
	align-items: center;
	gap: 14px;
	position: relative;
	padding: 4px 0;
}

.rn-line + .rn-line {
	border-top: 1px solid #f0efea;
}

/* Obrázek */
.rn-col-img {
	align-self: stretch;
}

.rn-col-img a,
.rn-col-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

/* Název */
.rn-col-name a {
	font-weight: 700;
	font-size: 18px;
	text-transform: uppercase;
	color: inherit;
	text-decoration: none;
}

.rn-col-name a:hover {
	text-decoration: underline;
}

/* Gramáž / varianta */
.rn-col-meta {
	color: #777;
	font-size: 15px;
}

/* Stepper */
.rn-stepper {
	display: inline-flex;
	align-items: center;
	background: #f1f1ee;
	border-radius: 40px;
	padding: 4px;
}

.rn-stepper button {
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #333;
	transition: background 0.15s ease;
	padding: 0;
}

.rn-stepper button:hover {
	background: #e2e2dd;
}

.rn-stepper button:focus,
.rn-stepper button:focus-visible,
.rn-stepper button:active {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: #e2e2dd;
}

.rn-qty-box {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
}

.rn-stepper .rn-qty {
	width: 42px;
	text-align: center;
	border: none;
	background: transparent;
	font-size: 16px;
	font-weight: 700;
	padding: 0;
	margin: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	transition: opacity 0.15s ease;
}

.rn-stepper .rn-qty:focus {
	outline: none;
}

/* Spinner – zobrazí se hned po změně množství, dokud se košík nesynchronizuje */
.rn-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(0, 0, 0, 0.18);
	border-top-color: #e8512e;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	animation: rn-spin 0.7s linear infinite;
}

.rn-buy.rn-syncing .rn-spinner {
	opacity: 1;
}

.rn-buy.rn-syncing .rn-qty {
	opacity: 0;
}

@keyframes rn-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Ceny */
.rn-col-price,
.rn-col-total {
	text-align: right;
	line-height: 1.4;
}

.rn-price-incl,
.rn-total-incl {
	display: block;
	font-weight: 700;
}

.rn-price-excl,
.rn-total-excl {
	display: block;
	font-size: 13px;
	color: #999;
}

/* Chybová hláška */
.rn-error {
	position: absolute;
	left: 0;
	bottom: 0;
	right: 0;
	background: #c0392b;
	color: #fff;
	font-size: 13px;
	padding: 4px 12px;
	display: none;
}

/* Skrýt spinner u number inputu (kdyby) */
.rn-qty::-webkit-outer-spin-button,
.rn-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- Souhrn + tlačítko ---------- */
.rn-summary {
	margin: 40px 0 0;
	text-align: right;
}

.rn-summary-row {
	display: flex;
	justify-content: flex-end;
	align-items: baseline;
	gap: 40px;
	padding: 4px 28px 4px 0;
}

.rn-summary-label {
	color: #555;
}

.rn-summary-row .rn-grand-incl,
.rn-summary-row .rn-grand-excl {
	min-width: 130px;
	font-weight: 700;
	text-align: right;
}

.rn-summary-row:first-child .rn-grand-incl {
	font-size: 19px;
}

.rn-actions {
	text-align: center;
	margin: 40px 0 80px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	/* Jednoduchý produkt */
	.rn-row {
		grid-template-columns: 100px 1fr auto;
		grid-template-areas:
			"img name name"
			"img meta qty"
			"img price total";
		gap: 8px 16px;
		padding: 0 20px 0 0;
		align-items: center;
	}

	.rn-row .rn-col-img   { grid-area: img; align-self: stretch; }
	.rn-row .rn-col-name  { grid-area: name; padding-top: 16px; }
	.rn-row .rn-col-meta  { grid-area: meta; }
	.rn-row .rn-col-qty   { grid-area: qty; justify-self: end; }
	.rn-row .rn-col-price { grid-area: price; text-align: left; padding-bottom: 14px; }
	.rn-row .rn-col-total { grid-area: total; padding-bottom: 14px; }

	/* Variabilní produkt – řádky variant zúžíme */
	.rn-line {
		grid-template-columns: 0.8fr auto 1fr 1fr;
		gap: 12px;
	}
}

/* Telefon – karty: obrázek vlevo, stepper a ceny pod sebou */
@media (max-width: 600px) {
	.rn-row {
		grid-template-columns: 110px 1fr;
		grid-template-areas:
			"img   name"
			"img   meta"
			"qty   qty"
			"price total";
		gap: 4px 16px;
		padding: 0 18px 18px 0;
		align-items: center;
		min-height: 0;
	}

	.rn-row .rn-col-img {
		grid-area: img;
		align-self: stretch;
		min-height: 92px;
	}

	.rn-row .rn-col-name {
		grid-area: name;
		padding-top: 16px;
	}

	.rn-col-name a {
		font-size: 16px;
		line-height: 1.25;
	}

	.rn-row .rn-col-meta {
		grid-area: meta;
	}

	.rn-row .rn-col-qty {
		grid-area: qty;
		justify-self: stretch;
		padding: 14px 18px 6px;
	}

	.rn-row .rn-stepper {
		width: 100%;
		justify-content: space-between;
	}

	.rn-row .rn-col-price {
		grid-area: price;
		text-align: left;
		padding-left: 18px;
	}

	.rn-row .rn-col-total {
		grid-area: total;
		text-align: right;
		align-self: end;
	}

	/* Variabilní produkt – karta: nahoře obrázek + název,
	   pod tím varianty přes celou šířku (stejně jako jednoduchý produkt) */
	.rn-product {
		grid-template-columns: 110px 1fr;
		grid-template-areas:
			"img   name"
			"lines lines";
		gap: 0 16px;
		min-height: 0;
		align-items: stretch;
	}

	.rn-product .rn-col-img {
		grid-area: img;
		align-self: stretch;
		min-height: 92px;
	}

	/* Obsah karty „rozpustíme“ do mřížky, aby šel obrázek jen k názvu */
	.rn-product-body {
		display: contents;
	}

	.rn-product .rn-col-name {
		grid-area: name;
		padding: 16px 18px 0 0;
		margin-bottom: 0;
	}

	.rn-product .rn-lines {
		grid-area: lines;
		padding: 0 18px;
	}

	/* Řádek varianty: gramáž nahoře, stepper přes celou šířku, ceny dole */
	.rn-line {
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"meta  meta"
			"qty   qty"
			"price total";
		gap: 4px 12px;
		padding: 14px 0;
	}

	.rn-line .rn-col-meta  { grid-area: meta; }
	.rn-line .rn-col-qty   { grid-area: qty; justify-self: stretch; padding-top: 4px; }
	.rn-line .rn-stepper   { width: 100%; justify-content: space-between; }
	.rn-line .rn-col-price { grid-area: price; text-align: left; }
	.rn-line .rn-col-total { grid-area: total; text-align: right; align-self: end; }
}
