/**
 * Comet Bookings – időpontválasztó popup.
 */

.cb-modal {
	--cb-accent: #1f6feb;
	--cb-accent-contrast: #ffffff;
	--cb-bg: #ffffff;
	--cb-fg: #1c1d1f;
	--cb-muted: #6b7280;
	--cb-line: #e3e5e9;
	--cb-open: #eef4ff;
	--cb-radius: 10px;

	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-size: 15px;
	line-height: 1.45;
	color: var(--cb-fg);
}

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

body.cb-modal-open {
	overflow: hidden;
}

.cb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 24, 0.55);
}

.cb-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 32px);
	overflow: hidden;
	background: var(--cb-bg);
	border-radius: var(--cb-radius);
	box-shadow: 0 24px 60px rgba(15, 18, 24, 0.28);
}

.cb-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--cb-line);
}

.cb-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

.cb-modal__close {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	min-width: 32px;
	height: 32px;
	min-height: 32px;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	text-align: center;
	color: var(--cb-muted);
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 6px;
}

.cb-modal__close:hover,
.cb-modal__close:focus-visible {
	color: var(--cb-fg);
	background: var(--cb-open);
}

.cb-modal__body {
	flex: 1 1 auto;
	padding: 18px 20px;
	overflow-y: auto;
}

.cb-modal__product {
	margin: 0 0 14px;
	font-size: 14px;
	color: var(--cb-muted);
}

.cb-modal__columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

/* --- naptár --- */

.cb-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.cb-cal__label {
	font-weight: 600;
	text-align: center;
}

.cb-cal__arrow {
	/* A témák gombszabályai gyakran adnak saját paddinget, min-widthet és
	   balra zárt szöveget, ezért itt mindet visszaállítjuk. */
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	min-width: 32px;
	max-width: 32px;
	height: 32px;
	min-height: 32px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	text-align: center;
	text-indent: 0;
	color: var(--cb-fg);
	cursor: pointer;
	background: transparent;
	border: 1px solid var(--cb-line);
	border-radius: 6px;
}

.cb-cal__arrow:hover:not(:disabled) {
	border-color: var(--cb-accent);
	color: var(--cb-accent);
}

.cb-cal__arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.cb-cal__weekdays,
.cb-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.cb-cal__weekday {
	padding: 4px 0;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	text-transform: uppercase;
	color: var(--cb-muted);
}

.cb-cal__cell {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font: inherit;
	font-size: 14px;
	color: var(--cb-fg);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
}

.cb-cal__cell--empty {
	border: 0;
}

.cb-cal__cell--open {
	cursor: pointer;
	background: var(--cb-open);
	border-color: transparent;
	font-weight: 600;
}

.cb-cal__cell--open:hover,
.cb-cal__cell--open:focus-visible {
	border-color: var(--cb-accent);
}

.cb-cal__cell--closed {
	color: #b6bac2;
	cursor: not-allowed;
}

.cb-cal__cell.is-selected {
	color: var(--cb-accent-contrast);
	background: var(--cb-accent);
	border-color: var(--cb-accent);
}

.cb-cal__msg,
.cb-slots__msg {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--cb-muted);
}

/* --- idősávok --- */

.cb-slots__title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
}

.cb-slots__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
	max-height: 260px;
	overflow-y: auto;
}

.cb-slot {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 8px;
	font: inherit;
	font-size: 14px;
	color: var(--cb-fg);
	text-align: center;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--cb-line);
	border-radius: 8px;
}

.cb-slot:hover:not(:disabled) {
	border-color: var(--cb-accent);
}

.cb-slot.is-selected {
	color: var(--cb-accent-contrast);
	background: var(--cb-accent);
	border-color: var(--cb-accent);
}

.cb-slot--full {
	color: #b6bac2;
	cursor: not-allowed;
	background: #f6f7f9;
}

.cb-slot__meta {
	font-size: 11px;
	opacity: 0.8;
}

/* --- megjegyzés --- */

.cb-note {
	margin-top: 18px;
}

.cb-note__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}

.cb-note__input {
	width: 100%;
	padding: 9px 10px;
	font: inherit;
	font-size: 14px;
	color: var(--cb-fg);
	background: #fff;
	border: 1px solid var(--cb-line);
	border-radius: 8px;
	resize: vertical;
}

.cb-note__input:focus {
	border-color: var(--cb-accent);
	outline: none;
}

.cb-note__count {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--cb-muted);
	text-align: right;
}

.cb-error {
	display: none;
	margin: 14px 0 0;
	padding: 10px 12px;
	font-size: 14px;
	color: #8a1c1c;
	background: #fdecec;
	border-radius: 8px;
}

/* --- lábléc --- */

.cb-modal__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	border-top: 1px solid var(--cb-line);
	background: #fafbfc;
}

.cb-summary {
	font-size: 14px;
	font-weight: 600;
}

.cb-actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.cb-btn {
	padding: 10px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 8px;
}

.cb-btn--ghost {
	color: var(--cb-fg);
	background: transparent;
	border-color: var(--cb-line);
}

.cb-btn--primary {
	color: var(--cb-accent-contrast);
	background: var(--cb-accent);
}

.cb-btn--primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.cb-btn.is-busy {
	opacity: 0.7;
	cursor: progress;
}

@media (max-width: 640px) {
	.cb-modal {
		padding: 0;
	}

	.cb-modal__dialog {
		max-width: none;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}

	.cb-modal__columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.cb-slots__list {
		max-height: none;
	}
}
