/*
 * Class timetable and booking dialog (sgc-core/includes/classes/public.php, assets/js/timetable.js).
 * Matches the prototype's "Class timetable" screen and booking modal.
 */

/* ---------- week tabs ---------- */
.sgc-weeks { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.sgc-weeks__tab {
	padding: 9px 16px; border-radius: 12px; border: 1px solid var(--sgc-line);
	color: var(--sgc-heading); font-weight: 700; font-size: .85rem; text-decoration: none; background: var(--sgc-surface);
}
.sgc-weeks__tab:hover { background: var(--sgc-accent-soft); }
.sgc-weeks__tab[aria-current="page"] { background: var(--sgc-brand); border-color: var(--sgc-brand); color: var(--sgc-on-brand); }

/* ---------- filters ---------- */
.sgc-filters { display: grid; gap: 14px; padding: 18px; background: var(--sgc-surface-2); border-radius: 20px; margin-bottom: 20px; }
.sgc-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sgc-filters__label { font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sgc-heading); min-width: 92px; }
.sgc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sgc-chip {
	border: 1px solid var(--sgc-line) !important; background: var(--sgc-bg) !important; color: var(--sgc-heading) !important;
	border-radius: 12px !important; padding: 8px 14px !important; font-size: .78rem !important; font-weight: 700;
	text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; cursor: pointer;
}
.sgc-chip:hover { background: var(--sgc-accent-soft) !important; }
.sgc-chip[aria-pressed="true"] { background: var(--sgc-brand) !important; color: var(--sgc-on-brand) !important; border-color: var(--sgc-brand) !important; }
.sgc-timetable__count { margin: 0 0 16px; }

/* ---------- days and classes ---------- */
.sgc-day + .sgc-day { margin-top: 28px; }
.sgc-day__label {
	font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--sgc-brand);
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.sgc-day__count { font-family: var(--sgc-font-body); font-weight: 500; font-size: .85rem; color: var(--sgc-muted); }
.sgc-class {
	display: grid; grid-template-columns: 92px 1fr 170px 150px; gap: 18px; align-items: center;
	padding: 18px 4px; border-bottom: 1px solid var(--sgc-line);
}
.sgc-class[hidden], .sgc-day[hidden], .sgc-empty[hidden] { display: none; }
.sgc-class__time { font-family: var(--sgc-font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; color: var(--sgc-heading); }
.sgc-class__time small { display: block; font-family: var(--sgc-font-body); font-weight: 500; font-size: .8rem; color: var(--sgc-muted); margin-top: 2px; }
.sgc-class__title { font-size: 1.15rem; margin: 8px 0 0; }
.sgc-class__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .875rem; color: var(--sgc-muted); }
.sgc-intensity { display: inline-flex; gap: 3px; align-items: center; vertical-align: -1px; }
.sgc-intensity i { width: 6px; height: 12px; border-radius: 2px; background: var(--sgc-line); }
.sgc-intensity i.on { background: var(--sgc-brand); }
.sgc-spots { font-size: .85rem; color: var(--sgc-ink); }
.sgc-spots__bar { display: block; height: 6px; border-radius: 6px; background: var(--sgc-surface-2); overflow: hidden; margin-top: 6px; }
.sgc-spots__bar span { display: block; height: 100%; background: var(--sgc-brand); }
.sgc-spots.is-low { color: var(--sgc-warn); }
.sgc-spots.is-low .sgc-spots__bar span { background: var(--sgc-warn); }
.sgc-class__action { justify-self: end; }
@media (max-width: 760px) {
	.sgc-class { grid-template-columns: 70px 1fr; gap: 10px 14px; }
	.sgc-spots, .sgc-class__action { grid-column: 2; justify-self: start; }
	.sgc-spots { width: 100%; max-width: 240px; }
	.sgc-filters__label { min-width: 0; width: 100%; }
}
.sgc-empty { padding: 40px; text-align: center; border: 1.5px dashed var(--sgc-line); border-radius: 20px; }
.sgc-empty h3 { margin: 0 0 8px; }
.sgc-notice.is-warn { background: var(--sgc-warn-soft); color: var(--sgc-warn); margin: 0 0 16px; }

/* ---------- booking dialog ---------- */
.sgc-dialog {
	border: 1px solid var(--sgc-line); border-radius: var(--sgc-radius-card); padding: 28px;
	background: var(--sgc-surface); color: var(--sgc-ink); box-shadow: var(--sgc-card-shadow);
	width: calc(100% - 32px); max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto;
}
.sgc-dialog::backdrop { background: var(--sgc-backdrop); backdrop-filter: blur(4px); }
.sgc-dialog__close {
	position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50% !important;
	border: 1px solid var(--sgc-line) !important; background: var(--sgc-surface) !important; color: var(--sgc-heading) !important;
	font-size: 1.2rem !important; line-height: 1; padding: 0 !important; box-shadow: none !important; letter-spacing: 0 !important;
}
.sgc-book h2 { font-size: 2rem; margin: 0 0 4px; padding-right: 40px; }
.sgc-steps { display: flex; gap: 6px; margin: 0 0 14px; padding-right: 48px; }
.sgc-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--sgc-surface-2); }
.sgc-steps span.on { background: var(--sgc-brand); }
.sgc-step-label { font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sgc-brand); margin: 0 0 6px; }
.sgc-summary { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--sgc-surface-2); margin: 14px 0 18px; }
.sgc-book__form { display: grid; gap: 14px; }
.sgc-book__form > p { margin: 0; }
.sgc-field { display: grid; gap: 6px; }
.sgc-hint { font-size: .82rem; color: var(--sgc-muted); }
.sgc-err { font-size: .82rem; font-weight: 550; color: var(--sgc-warn); }
.sgc-book [aria-invalid="true"] { border-color: var(--sgc-warn) !important; }
.sgc-phone { display: flex; }
.sgc-phone span {
	padding: 12px; border: 1.5px solid var(--sgc-line); border-right: 0; border-radius: 12px 0 0 12px;
	background: var(--sgc-surface-2); font-weight: 600; color: var(--sgc-ink);
}
.sgc-phone span { flex-shrink: 0; white-space: nowrap; }
.sgc-phone .input { border-radius: 0 12px 12px 0; min-width: 0; flex: 1; }
.sgc-book .sgc-notice { margin: 0 0 14px; }
.sgc-check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.sgc-check input { margin-top: 2px; flex-shrink: 0; }
.sgc-opts { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.sgc-opt {
	display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--sgc-line);
	border-radius: 14px; cursor: pointer; background: var(--sgc-surface);
	text-transform: none !important; letter-spacing: 0 !important; font-size: 1rem !important; font-weight: 400 !important; color: var(--sgc-ink) !important;
}
.sgc-opt:has(input:checked) { border-color: var(--sgc-brand); background: var(--sgc-accent-soft); }
.sgc-opt input { margin-top: 3px; }
.sgc-opt__text { flex: 1; }
.sgc-opt__price { font-family: var(--sgc-font-display); color: var(--sgc-heading); white-space: nowrap; }
.sgc-book__nav { display: flex; gap: 10px; margin-top: 18px; }
.sgc-book__go { flex: 1; }

.sgc-book__ok {
	width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 0 14px;
	background: var(--sgc-ok-soft); color: var(--sgc-ok-ink); font-weight: 800; font-size: 1.3rem;
}
.sgc-book__done { display: grid; gap: 10px; }

/* ---------- My account: cancel confirmation and messages (sgc-core/includes/classes/member.php) ---------- */
.sgc-notice.is-ok { background: var(--sgc-ok-soft); color: var(--sgc-ok-ink); }
.sgc-account > .sgc-notice { margin: 0 0 18px; }
.sgc-confirm { padding: 22px; margin: 0 0 18px; border-color: var(--sgc-brand); }
.sgc-confirm h2 { font-size: 1.5rem; margin: 0 0 6px; }
.sgc-confirm p { margin: 0 0 14px; }
.sgc-confirm__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.sgc-row__note { text-align: right; max-width: 180px; }
