@layer components {
	.rental-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
		gap: clamp(32px, 5vw, 64px);
		align-items: start;
	}

	.rental-layout__info {
		position: sticky;
		top: calc(var(--header-h) + 20px);
	}

	.rental-prices {
		margin-top: 32px;

		h2 { margin-bottom: 12px; font-size: 22px; text-transform: uppercase; }

		table { width: 100%; border-collapse: collapse; font-size: 15px; }
		th, td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--c-line); font-weight: var(--fw-regular); text-align: left; vertical-align: baseline; }
		th:last-child, td:last-child { padding-right: 0; font-weight: var(--fw-bold); text-align: right; white-space: nowrap; }

		thead th, thead th:last-child { color: var(--c-muted); font-size: 12px; font-weight: var(--fw-regular); letter-spacing: .12em; text-transform: uppercase; }

		tbody th[scope="rowgroup"] { padding-top: 20px; border-bottom: 1px solid var(--c-gold); color: var(--c-gold); font-size: 12px; font-weight: var(--fw-bold); letter-spacing: .12em; text-align: left; text-transform: uppercase; }

		td a { font-weight: var(--fw-bold); }
		td a:hover { color: var(--c-gold); }
	}

	.rental-prices__sizes { color: var(--c-muted); }
	.rental-prices__note { margin-top: 14px; color: var(--c-muted); font-size: 14px; }

	.rental-form {
		padding: clamp(20px, 3vw, 32px);
		border-top: 3px solid var(--c-gold);
		background: var(--c-panel);
	}

	.rental-form__hp { position: absolute; left: -9999px; }

	.rental-form__step {
		margin: 0 0 24px;
		padding: 0;
		border: 0;

		legend {
			display: flex;
			align-items: center;
			gap: 10px;
			margin-bottom: 12px;
			font-size: 17px;
			font-weight: var(--fw-bold);

			span {
				display: grid;
				place-items: center;
				width: 26px;
				height: 26px;
				border-radius: 50%;
				background: var(--c-gold);
				color: var(--c-black);
				font-size: 14px;
			}
		}
	}

	.rental-form__hint, .rental-form__note { color: var(--c-muted); font-size: 14px; }
	.rental-form__note { margin-block: 4px 12px; }
	.rental-form__range { min-height: 1.6em; margin-top: 8px; color: var(--c-gold); font-weight: var(--fw-regular); }
	.rental-form__error { color: var(--c-error); font-size: 14px; font-weight: var(--fw-regular); &:empty { display: none; } }

	.rental-form__consent {
		display: flex;
		gap: 10px;
		margin-block: 12px;
		color: var(--c-muted);
		font-size: 14px;

		input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--c-gold); }
		a { color: var(--c-text); }
	}

	.rental-form .cf-turnstile { margin-bottom: 12px; }

	.rental-form__message {
		margin-top: 16px;
		padding: 12px 16px;
		border-left: 3px solid var(--c-gold);
		background: var(--c-panel-2);
		font-weight: var(--fw-regular);

		&:empty { display: none; }
		&.is-success { border-color: var(--c-ok); }
		&.is-error { border-color: var(--c-error); }
	}

	/* Kalendář */
	.calendar {
		position: relative;
		margin-top: 12px;

		&[aria-busy="true"] { opacity: .5; }
	}

	.calendar__empty { padding: 24px; border: 1px dashed var(--c-line-strong); color: var(--c-muted); text-align: center; }

	.calendar__nav {
		position: absolute;
		inset: -4px 0 auto;
		display: flex;
		justify-content: space-between;
		pointer-events: none;

		button {
			width: 36px;
			height: 36px;
			border: 1px solid var(--c-line-strong);
			background: var(--c-bg);
			font-size: 20px;
			line-height: 1;
			pointer-events: auto;

			&:hover:not(:disabled) { border-color: var(--c-gold); color: var(--c-gold); }
			&:disabled { opacity: .3; cursor: default; }
		}
	}

	.calendar__months {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 24px;
	}

	.calendar__title {
		margin-bottom: 10px;
		font-weight: var(--fw-bold);
		text-align: center;
		text-transform: capitalize;
		line-height: 28px;
	}

	.calendar__grid {
		display: grid;
		grid-template-columns: repeat(7, 1fr);
		gap: 3px;

		abbr { color: var(--c-muted); font-size: 12px; text-align: center; text-decoration: none; }

		button {
			aspect-ratio: 1;
			padding: 0;
			border: 1px solid transparent;
			background: var(--c-bg);
			font-size: 14px;
			font-weight: var(--fw-regular);
			transition: background .15s, border-color .15s;

			&:hover:not(:disabled) { border-color: var(--c-gold); }
			&:disabled { opacity: .3; cursor: not-allowed; }
			&.is-busy { background: repeating-linear-gradient(135deg, #3a1c1c 0 4px, #2a1515 4px 8px); color: #b77; opacity: .8; text-decoration: line-through; }
			&.is-between { background: rgb(192 159 49 / 0.25); }
			&.is-start, &.is-end { background: var(--c-gold); color: var(--c-black); font-weight: var(--fw-bold); opacity: 1; }
		}
	}

	.calendar__legend {
		display: flex;
		flex-wrap: wrap;
		gap: 16px;
		margin-top: 12px;
		padding: 0;
		color: var(--c-muted);
		font-size: 13px;
		list-style: none;

		li { display: inline-flex; align-items: center; gap: 6px; }
		li::before { content: ""; width: 14px; height: 14px; background: var(--c-bg); border: 1px solid var(--c-line-strong); }
		.is-busy::before { background: #3a1c1c; }
		.is-selected::before { background: var(--c-gold); }
	}

	@media (max-width: 900px) {
		.rental-layout { grid-template-columns: minmax(0, 1fr); }
		.rental-layout__info { position: static; }
	}
}
