/**
 * Kalendarz rezerwacji, front.
 *
 * Wszystko pod .serez, bo wtyczka wchodzi na stronę z własnym Bootstrapem
 * i nie wolno jej ruszyć niczego poza swoim blokiem. Kolory idą ze zmiennych,
 * które PHP wstrzykuje z ustawień.
 */

.serez {
	--serez-bg: #F3EDE4;
	--serez-surface: #FFFFFF;
	--serez-accent: #A08963;
	--serez-text: #3D3A34;
	--serez-muted: #8A8378;
	--serez-radius: 14px;

	box-sizing: border-box;
	color: var(--serez-text);
	font-size: 16px;
	line-height: 1.6;
	max-width: 1000px;
	margin: 0 auto;
}

.serez *,
.serez *::before,
.serez *::after {
	box-sizing: inherit;
}

.serez-title {
	margin: 0 0 24px;
	text-align: center;
}

/* ------------------------------------------------------------- zakładki */

.serez-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 24px;
}

.serez-tab {
	appearance: none;
	background: transparent;
	border: 1px solid var(--serez-accent);
	border-radius: 50px;
	color: var(--serez-accent);
	cursor: pointer;
	font: inherit;
	letter-spacing: 0.02em;
	padding: 10px 26px;
	transition: background-color .2s ease, color .2s ease;
}

.serez-tab:hover,
.serez-tab:focus-visible {
	background: rgba(160, 137, 99, .12);
}

.serez-tab.is-active {
	background: var(--serez-accent);
	color: #fff;
}

.serez-panel {
	display: none;
}

.serez-panel.is-active {
	display: block;
}

.serez-intro {
	color: var(--serez-muted);
	margin: 0 0 24px;
	text-align: center;
}

/* ------------------------------------------------------------- kalendarz */

.serez-calendar {
	background: var(--serez-bg);
	border-radius: var(--serez-radius);
	padding: 20px;
	transition: opacity .2s ease;
}

.serez-calendar.is-loading {
	opacity: .45;
	pointer-events: none;
}

.serez-monthnav {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: center;
	margin-bottom: 18px;
}

.serez-month {
	font-size: 1.15em;
	min-width: 200px;
	text-align: center;
	text-transform: capitalize;
}

.serez-nav {
	appearance: none;
	background: var(--serez-surface);
	border: 0;
	border-radius: 50%;
	color: var(--serez-text);
	cursor: pointer;
	font-size: 18px;
	height: 40px;
	line-height: 1;
	width: 40px;
}

.serez-nav:disabled {
	cursor: default;
	opacity: .3;
}

.serez-weekhead {
	color: var(--serez-muted);
	display: grid;
	font-size: .8em;
	gap: 8px;
	grid-template-columns: repeat(7, 1fr);
	letter-spacing: .08em;
	margin-bottom: 8px;
	text-align: center;
	text-transform: uppercase;
}

.serez-days {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(7, 1fr);
}

.serez-day {
	background: var(--serez-surface);
	border-radius: calc(var(--serez-radius) - 6px);
	min-height: 92px;
	opacity: .55;
	padding: 8px 6px;
}

.serez-day.has-slots {
	opacity: 1;
}

.serez-day-blank {
	background: transparent;
}

.serez-day.is-today .serez-daynum {
	background: var(--serez-accent);
	border-radius: 50%;
	color: #fff;
	display: inline-block;
	height: 24px;
	line-height: 24px;
	text-align: center;
	width: 24px;
}

.serez-daynum {
	color: var(--serez-muted);
	display: block;
	font-size: .85em;
	margin-bottom: 6px;
}

.serez-day.has-slots .serez-daynum {
	color: var(--serez-text);
}

/* Nazwa dnia przydaje się dopiero, gdy siatka tygodnia znika na wąskim ekranie. */
.serez-daylabel {
	display: none;
}

/* Dzień z wolnymi godzinami jest przyciskiem. Same godziny pokazujemy dopiero
   po kliknięciu, w panelu pod siatką: wypisane wprost w kratkach rozpychają
   kalendarz przy każdym normalnym grafiku. */
.serez-day-open {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	display: block;
	font: inherit;
	padding: 0;
	text-align: left;
	width: 100%;
}

.serez-count {
	color: var(--serez-accent);
	display: block;
	font-size: .78em;
	margin-top: 4px;
}

.serez-count-taken {
	color: var(--serez-muted);
}

.serez-day.is-open {
	box-shadow: 0 0 0 2px var(--serez-accent);
}

/* ------------------------------------------------- godziny wybranego dnia */

.serez-daypanel {
	border-top: 1px solid rgba(0, 0, 0, .1);
	margin-top: 24px;
	padding-top: 22px;
}

.serez-daypanel[hidden] {
	display: none;
}

.serez-daypanel-title {
	font-weight: 600;
	margin: 0 0 14px;
	text-transform: capitalize;
}

.serez-daypanel-times {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.serez-daypanel-times li {
	margin: 0;
}

.serez-daypanel-times .serez-time {
	min-width: 104px;
	padding: 10px 18px;
	width: auto;
}

.serez-hint {
	color: var(--serez-muted);
	font-size: .85em;
	margin: 20px 0 0;
	text-align: center;
}

.serez-hint[hidden] {
	display: none;
}

.serez-times {
	list-style: none;
	margin: 0;
	padding: 0;
}

.serez-times[hidden] {
	display: none;
}

.serez-times li {
	margin: 0 0 4px;
}

.serez-time {
	appearance: none;
	background: var(--serez-accent);
	border: 1px solid transparent;
	border-radius: 8px;
	color: #fff;
	cursor: pointer;
	display: block;
	font: inherit;
	font-size: .85em;
	padding: 7px 4px;
	text-align: center;
	transition: background-color .15s ease, color .15s ease;
	width: 100%;
}

.serez-time:hover,
.serez-time:focus-visible {
	background: var(--serez-text);
	color: #fff;
}

/* Zajęty termin nie jest oferta, wiec ma wygladac na nieaktywny i nie
   reagowac na najechanie. Zostaje w siatce tylko po to, zeby bylo widac
   rytm tygodnia. */
.serez-time.is-taken,
.serez-time[disabled] {
	background: transparent;
	border-color: rgba(0, 0, 0, .12);
	color: var(--serez-muted);
	cursor: default;
}

.serez-time.is-taken:hover,
.serez-time[disabled]:hover {
	background: transparent;
	color: var(--serez-muted);
}

.serez-hour {
	display: block;
	font-weight: 600;
}

.serez-state {
	display: block;
	font-size: .78em;
	letter-spacing: .04em;
	opacity: .85;
}

/* ------------------------------------------------------------- legenda */

.serez-legend {
	color: var(--serez-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: .85em;
	gap: 20px;
	justify-content: center;
	margin: 22px 0 0;
}

.serez-legend-item {
	align-items: center;
	display: inline-flex;
	gap: 8px;
}

.serez-dot {
	border-radius: 4px;
	display: inline-block;
	height: 14px;
	width: 22px;
}

.serez-dot-free {
	background: var(--serez-accent);
}

.serez-dot-taken {
	background: transparent;
	border: 1px solid rgba(0, 0, 0, .18);
}

.serez-price {
	display: block;
	font-size: .8em;
	opacity: .8;
}

.serez-empty {
	color: var(--serez-muted);
	padding: 30px 10px;
	text-align: center;
}

/* -------------------------------------------------------------- okienko */

.serez-modal {
	align-items: center;
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 20px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 99999;
}

.serez-modal[hidden] {
	display: none;
}

.serez-modal-backdrop {
	background: rgba(38, 35, 31, .55);
	bottom: 0;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

.serez-modal-box {
	background: var(--serez-surface);
	border-radius: var(--serez-radius);
	box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
	max-height: calc(100vh - 40px);
	max-width: 560px;
	overflow-y: auto;
	padding: 30px 34px 34px;
	position: relative;
	width: 100%;
}

.serez-modal-close {
	appearance: none;
	background: var(--serez-bg);
	border: 0;
	border-radius: 50%;
	color: var(--serez-text);
	cursor: pointer;
	font-size: 22px;
	height: 38px;
	line-height: 1;
	position: absolute;
	right: 18px;
	top: 18px;
	width: 38px;
}

.serez-modal-close:hover {
	background: var(--serez-accent);
	color: #fff;
}

.serez-modal-title {
	margin: 0 50px 20px 0;
}

/* Podsumowanie terminu: etykieta po lewej, wartosc po prawej. */
.serez-meta {
	margin: 0 0 24px;
}

.serez-meta-row {
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	display: flex;
	gap: 16px;
	justify-content: space-between;
	padding: 10px 0;
}

.serez-meta-row[hidden] {
	display: none;
}

.serez-meta dt {
	color: var(--serez-muted);
	font-weight: 400;
}

.serez-meta dd {
	font-weight: 600;
	margin: 0;
	text-align: right;
}

/* Strona pod oknem nie moze sie przewijac razem z nim. */
body.serez-modal-open {
	overflow: hidden;
}

/* ------------------------------------------------------------ formularz */

.serez-form {
	background: transparent;
	border-radius: 0;
	margin-top: 0;
	padding: 0;
}

.serez-fields {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(2, 1fr);
}

.serez-form label {
	color: var(--serez-muted);
	display: block;
	font-size: .9em;
	font-weight: 400;
}

.serez-form input[type="text"],
.serez-form input[type="email"],
.serez-form textarea {
	/* Pola siedza teraz na bialym tle okienka, wiec musza byc od niego ciemniejsze. */
	background: var(--serez-bg);
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: 8px;
	color: var(--serez-text);
	display: block;
	font: inherit;
	margin-top: 4px;
	padding: 11px 14px;
	width: 100%;
}

.serez-form input:focus,
.serez-form textarea:focus {
	border-color: var(--serez-accent);
	outline: none;
}

.serez-full {
	display: block;
	margin-top: 16px;
}

.serez-consent {
	align-items: flex-start;
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.serez-consent input {
	flex: 0 0 auto;
	margin-top: 5px;
}

.serez-consent span {
	font-size: .85em;
}

.serez-consent a {
	color: var(--serez-accent);
}

/* Honeypot: wychodzi poza ekran, zamiast display:none, bo boty pomijają ukryte pola. */
.serez-hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

.serez-error {
	background: #F6E4E1;
	border-radius: 8px;
	color: #8C3A2B;
	margin: 18px 0 0;
	padding: 12px 16px;
}

.serez-submit {
	appearance: none;
	background: var(--serez-accent);
	border: 0;
	border-radius: 50px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	letter-spacing: .04em;
	margin-top: 20px;
	padding: 14px 38px;
	transition: opacity .2s ease;
}

.serez-submit:hover {
	opacity: .88;
}

.serez-submit:disabled,
.serez-submit.is-busy {
	cursor: wait;
	opacity: .6;
}

.serez-note {
	color: var(--serez-muted);
	font-size: .85em;
	margin: 12px 0 0;
}

.serez-success {
	padding: 10px 0 0;
	text-align: center;
}

.serez-success p {
	margin: 0 0 22px;
}

/* ------------------------------------------------------------ responsywnie */

@media (max-width: 860px) {
	.serez-fields {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	/* Siedem kolumn na telefonie robi z godzin nieczytelne słupki,
	   więc miesiąc zamienia się w listę dni, które mają wolne terminy. */
	.serez-weekhead {
		display: none;
	}

	.serez-days {
		grid-template-columns: 1fr;
	}

	.serez-day:not(.has-slots) {
		display: none;
	}

	.serez-day {
		min-height: 0;
		padding: 14px 16px;
	}

	.serez-daynum {
		display: none;
	}

	.serez-daylabel {
		display: block;
		font-weight: 600;
		margin-bottom: 10px;
		text-transform: capitalize;
	}

	.serez-times {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.serez-times li {
		margin: 0;
	}

	.serez-time {
		font-size: .95em;
		padding: 9px 16px;
		width: auto;
	}

	.serez-price {
		display: inline;
		margin-left: 6px;
	}
}
