/****************************
    SECTION MACHINES (seznam strojů – Jihlava i Pelhřimov)
****************************/
#section-machines {
	padding: 0 20px 110px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.machines-intro {
	color: #bbb;
	font-size: 1rem;
	line-height: 1.6;
	text-align: center;
	max-width: 800px;
	margin: -20px auto 40px;
}

/* --- záložky kategorií --- */
.machines-filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	max-width: 1100px;
	margin-bottom: 30px;
}

.machines-tab {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #111;
	border: none;
	color: #fff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 10px 18px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.machines-tab:hover,
.machines-tab.active {
	background: var(--accent-color);
}

.machines-count {
	font-size: 0.75rem;
	color: #777;
	transition: color 0.3s ease;
}

.machines-tab:hover .machines-count,
.machines-tab.active .machines-count {
	color: rgba(255, 255, 255, 0.75);
}

/* --- seznam strojů --- */
.machines-panel {
	width: 100%;
	max-width: 1100px;
	background: #0e0e0e;
	padding: 40px;
	border-radius: 18px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
}

.machines-list {
	list-style: none;
	display: none;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 20px;
}

.machines-list.active {
	display: grid;
	animation: machinesIn 0.3s ease;
}

/* název stroje a pod ním značka */
.machines-list li {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	background: #1a1a1a;
	padding: 14px 20px;
	border-radius: 10px;
	font-weight: 600;
	color: #fff;
}

/* místo pro ikonku přehrání vpravo */
.machines-list li:has(.machine-video) {
	padding-right: 64px;
}

/* stroj s videem – klikací je celý řádek */
.machine-video {
	color: inherit;
	text-decoration: none;
}

.machine-video::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 10px;
}

.machine-video:focus-visible {
	outline: none;
}

.machine-video:focus-visible::after {
	outline: 2px solid var(--accent-color);
	outline-offset: 2px;
}

/* ikonka přehrání vpravo (pozicovaná vůči řádku) */
.machine-video::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 20px;
	width: 28px;
	height: 28px;
	margin-top: -14px;
	border-radius: 50%;
	background: #2a2a2a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M0 0l10 6-10 6z' fill='%23fff'/%3E%3C/svg%3E") 10px center / 10px 12px no-repeat;
}

.machine-qty {
	color: #888;
	font-size: 0.85rem;
	margin-left: 4px;
}

.machine-brand {
	color: #888;
	font-size: 0.8rem;
	font-weight: 400;
}

@keyframes machinesIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- odkaz na videa --- */
.machines-video {
	width: 100%;
	max-width: 1100px;
	margin-top: 30px;
	background: #0e0e0e;
	padding: 40px;
	border-radius: 18px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.machines-video h3 {
	font-size: 1.6rem;
	font-weight: 800;
	color: #fff;
	margin-bottom: 12px;
}

.machines-video p {
	color: #ccc;
	font-size: 0.95rem;
	line-height: 1.7;
	max-width: 640px;
}

.machines-video-btn {
	flex-shrink: 0;
	background: #fff;
	color: #000;
	text-decoration: none;
	font-weight: 700;
	padding: 12px 22px;
	border-radius: 8px;
	transition: all 0.25s ease;
}

.machines-video-btn:hover {
	background: var(--accent-color);
	color: #fff;
}

/* --- popup s videem ke stroji --- */
.machine-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.machine-modal.visible {
	opacity: 1;
}

.machine-modal-content {
	width: 100%;
	max-width: 1100px;
	max-height: 100%;
	overflow-y: auto;
	background: #0e0e0e;
	border-radius: 20px;
	padding: 25px 30px 30px;
	box-sizing: border-box;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
	animation: machinesIn 0.35s ease;
}

.machine-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 18px;
}

.machine-modal-brand {
	display: block;
	font-size: 0.75rem;
	letter-spacing: 2px;
	color: #888;
	font-weight: 700;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.machine-modal-header h3 {
	color: #fff;
	font-size: 1.6rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.2;
}

.machine-modal-close {
	background: none;
	border: none;
	color: var(--accent-color);
	font-size: 38px;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.2s ease, color 0.25s ease;
}

.machine-modal-close:hover {
	transform: scale(1.15);
	color: #fff;
}

.machine-modal-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: calc(100svh - 190px);
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}

.machine-modal-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.machine-modal-yt {
	display: inline-block;
	margin-top: 16px;
	color: #aaa;
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 4px;
	transition: color 0.25s ease;
}

.machine-modal-yt:hover {
	color: #fff;
}

/* bez souhlasu s cookies je místo přehrávače text s odkazem na YouTube */
.machine-modal-consent {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 25px;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	padding: 40px;
	box-sizing: border-box;
	text-align: center;
}

.machine-modal-consent p {
	color: #ccc;
	font-size: 1rem;
	line-height: 1.7;
	max-width: 600px;
}

.machine-modal-consent-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 15px 30px;
}

.machine-modal-consent-actions .machine-modal-yt {
	margin-top: 0;
}

/* --- responzivita --- */
@media (max-width: 800px) {
	.machines-intro {
		margin-top: -30px;
	}

	.machines-tab {
		font-size: 0.8rem;
		padding: 8px 14px;
	}

	.machines-panel {
		padding: 20px;
	}

	.machines-list {
		grid-template-columns: 1fr;
	}

	.machines-video {
		flex-direction: column;
		align-items: flex-start;
		gap: 25px;
		padding: 30px 20px;
	}

	.machines-video h3 {
		font-size: 1.3rem;
	}
}

@media (max-width: 600px) {
	.machine-modal {
		padding: 10px;
	}

	.machine-modal-content {
		padding: 18px 16px 20px;
		border-radius: 16px;
	}

	.machine-modal-header h3 {
		font-size: 1.2rem;
	}

	.machine-modal-consent {
		padding: 25px 18px;
		gap: 20px;
	}

	.machine-modal-consent p {
		font-size: 0.9rem;
	}
}

@media (max-width: 450px) {
	.machines-list li {
		padding: 12px 16px;
		font-size: 0.9rem;
	}

	.machines-list li:has(.machine-video) {
		padding-right: 56px;
	}

	.machine-video::before {
		right: 16px;
	}

	.machine-brand {
		font-size: 0.75rem;
	}
}
