/* ======================================================
   NÁHRADNÍ DÍLY – LAYOUT
====================================================== */

.spare-layout {
	display: grid;
	grid-template-columns: 190px 1fr;
	gap: 40px;
	align-items: start;
	margin-top: 120px; /* Přidáno pro odsazení celé sekce */
}

/* ======================================================
   GRID INZERÁTŮ
====================================================== */

.spare-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

/* ======================================================
   KARTA INZERÁTU
====================================================== */

.spare-card {
	background: #ffffff;
	border-radius: 14px;
	overflow: hidden;

	display: flex;
	flex-direction: column;

	box-shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.spare-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px rgba(15, 28, 46, 0.15);
}

/* ======================================================
   SLIDER – OBRÁZKY
====================================================== */
/* ======================================================
   OBRÁZEK INZERÁTU – STATICKÝ (VARIANTA A)
====================================================== */

.spare-card__image {
	width: 100%;
	height: 180px;
	background: #f2f4f8;
	overflow: hidden;
}

.spare-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	cursor: pointer;
}

.spare-slider {
	position: relative;
	width: 100%;
	height: 200px;
	background: #f2f4f8;
	overflow: hidden;
}

.slider-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.3s ease;
	cursor: zoom-in;
}

.slider-img.active {
	opacity: 1;
	z-index: 2;
}

/* Ovládací šipky */
.slider-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border: none;
	font-size: 22px;
	line-height: 1;
	padding: 6px 10px;
	cursor: pointer;
	z-index: 5;
	border-radius: 6px;
	transition: background 0.2s ease;
}

.slider-btn:hover {
	background: rgba(0, 0, 0, 0.75);
}

.slider-btn.prev {
	left: 8px;
}

.slider-btn.next {
	right: 8px;
}

/* ======================================================
   OBSAH KARTY
====================================================== */
.spare-title {
	margin: 30px;
}
.spare-card__content {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

/* Název */
.spare-card__content h3 {
	font-size: 16px;
	font-weight: 700;
	color: #0f1c2e;
	line-height: 1.3;
	margin: 0;
}

/* Popis – max 3 řádky */
.spare-card__content p {
	font-size: 14px;
	color: #444;
	line-height: 1.4;
	margin: 0;

	display: -webkit-box;
	line-clamp: 3; /* Standard property */
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* OEM */
.spare-card__content .oem {
	font-size: 13px;
	color: #666;
}

/* Cena – vždy dole */
.spare-card__content .cena {
	margin-top: auto;
	font-size: 18px;
	font-weight: 800;
	color: #1a1918;
}

/* ======================================================
   SIDEBAR – FILTRACE
====================================================== */

.spare-sidebar {
	background: #ffffff;
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
}

.spare-sidebar h3 {
	margin: 16px 0 8px;
	font-size: 15px;
	color: #0f1c2e;
}

.spare-sidebar input {
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	border: 1px solid #ccc;
	font-size: 14px;
}

/* Seznam filtrů */
.filter-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.filter-list li a {
	display: block;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 14px;
	color: #0f1c2e;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.filter-list li a:hover,
.filter-list li a.active {
	background: #ec531c;
	color: #ffffff;
}

/* Tlačítko hledání */
.filter-submit {
	margin-top: 16px;
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	border: none;
	background: #0f1c2e;
	color: #ffffff;
	font-size: 14px;
	cursor: pointer;
}

.filter-submit:hover {
	background: #ec531c;
}

/* ======================================================
   LIGHTBOX – ZVĚTŠENÍ OBRÁZKU
====================================================== */

#lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

#lightbox img {
	max-width: 90%;
	max-height: 90%;
	border-radius: 10px;
	cursor: zoom-in;
}

/* ŠIPKY */
.lb-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: none;
	font-size: 40px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	cursor: pointer;
	user-select: none;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.lb-btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

.lb-prev {
	left: 24px;
}

.lb-next {
	right: 24px;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 1024px) {
	.spare-layout {
		grid-template-columns: 1fr;
		margin-top: 50px;
	}

	.spare-sidebar {
		order: -1;
	}
}
/* ======================================================
   MOBIL – FILTRY JAKO ROZBALOVACÍ PANEL
====================================================== */
@media (max-width: 1600px) {
	.spare-layout {
		margin-top: 150px;
	}
}
@media (max-width: 1340px) {
	.spare-layout {
		margin-top: 50px;
	}
}

@media (max-width: 1020px) {
	/* layout – single column pro mobile */
	.spare-layout {
		grid-template-columns: 1fr;
		margin-top: 70px; /* zmenšení horního okraje */
		gap: 5px;
	}

	/* titul */
	.spare-title {
		margin: 16px 16px 12px;
	}

	/* filtr panel */
	.spare-sidebar {
		margin: 0 16px 16px;
		padding: 0;
	}

	.filter-toggle {
		width: 100%;
		padding: 14px 16px;
		border: none;
		background: #ffffff;
		font-size: 15px;
		font-weight: 600;
		text-align: left;
		border-radius: 14px;
		box-shadow: 0 6px 20px rgba(15, 28, 46, 0.08);
		cursor: pointer;
	}

	/* obsah filtru – zavřený */
	.spare-sidebar-inner {
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s ease;
	}

	/* otevřený stav */
	.spare-sidebar.open .spare-sidebar-inner {
		max-height: 1000px;
		margin-top: 12px;
	}

	/* vnitřek filtru */
	.spare-sidebar-inner .spare-filter {
		padding: 16px;
		background: #ffffff;
		border-radius: 14px;
		box-shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
	}
}
