/**
 * Tabel Umroh — gaya frontend.
 * Semua warna berasal dari custom property yang ditulis inline oleh PHP,
 * jadi satu file ini melayani semua tabel tanpa CSS per-tabel.
 */

/* ---------------------------------------------------------------------
 * Akar
 * ------------------------------------------------------------------ */

.tu {
	--tu-fs: 1;
	--tu-radius: 16px;
	--tu-icon: 34px;
	--tu-icon-m: 26px;
	--tu-gap: 12px;
	--tu-pad-y: 14px;
	--tu-pad-x: 16px;

	--tu-s1: calc(10px * var(--tu-fs));
	--tu-s2: calc(11.5px * var(--tu-fs));
	--tu-s3: calc(12.5px * var(--tu-fs));
	--tu-s4: calc(14px * var(--tu-fs));
	--tu-s5: calc(16px * var(--tu-fs));
	--tu-s6: calc(20px * var(--tu-fs));

	box-sizing: border-box;
	color: var(--tu-text);
	background: var(--tu-bg);
	border-radius: var(--tu-radius);
	padding: clamp(14px, 3vw, 26px);
	line-height: 1.45;
	font-size: var(--tu-s4);
}

.tu *,
.tu *::before,
.tu *::after {
	box-sizing: border-box;
}

.tu--font-system {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tu--density-compact {
	--tu-pad-y: 10px;
	--tu-pad-x: 12px;
	--tu-gap: 9px;
}

.tu--density-relaxed {
	--tu-pad-y: 19px;
	--tu-pad-x: 20px;
	--tu-gap: 16px;
}

.tu--pattern-dots {
	background-image: radial-gradient(var(--tu-dot) 1px, transparent 1px);
	background-size: 30px 30px;
}

.tu--pattern-grid {
	background-image: linear-gradient(var(--tu-dot) 1px, transparent 1px),
		linear-gradient(90deg, var(--tu-dot) 1px, transparent 1px);
	background-size: 34px 34px;
}

/* ---------------------------------------------------------------------
 * Judul
 * ------------------------------------------------------------------ */

.tu__intro {
	margin: 0 0 clamp(16px, 3vw, 28px);
	max-width: 62ch;
}

.tu__title {
	margin: 0 0 8px;
	color: var(--tu-text);
	font-size: clamp(22px, 3.4vw, 32px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.tu__subtitle {
	margin: 0;
	color: var(--tu-muted);
	font-size: var(--tu-s5);
	line-height: 1.55;
}

.tu__empty {
	margin: 0;
	padding: 28px;
	text-align: center;
	color: var(--tu-muted);
	background: var(--tu-surface);
	border: 1px dashed var(--tu-border);
	border-radius: var(--tu-radius);
}

/* ---------------------------------------------------------------------
 * Filter bulan
 * ------------------------------------------------------------------ */

.tu__filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.tu-chip {
	appearance: none;
	margin: 0;
	padding: 7px 14px;
	font: inherit;
	font-size: var(--tu-s3);
	font-weight: 500;
	color: var(--tu-muted);
	background: var(--tu-surface);
	border: 1px solid var(--tu-border);
	border-radius: 999px;
	cursor: pointer;
	transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.tu-chip:hover {
	color: var(--tu-text);
	border-color: var(--tu-brand-35);
}

.tu-chip.is-active {
	color: var(--tu-brand);
	background: var(--tu-brand-12);
	border-color: var(--tu-brand-35);
}

/* ---------------------------------------------------------------------
 * Grup bulan
 * ------------------------------------------------------------------ */

.tu-group {
	margin-bottom: 22px;
	padding: clamp(14px, 2.4vw, 22px);
	background: var(--tu-surface);
	border: 1px solid var(--tu-border);
	border-radius: var(--tu-radius);
}

.tu-group:last-child {
	margin-bottom: 0;
}

.tu-group[hidden] {
	display: none;
}

.tu-group__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--tu-border);
}

.tu-group__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	color: var(--tu-brand);
	background: var(--tu-brand-12);
	border: 1px solid var(--tu-brand-20);
	border-radius: calc(var(--tu-radius) * .7);
}

.tu-group__icon .tu-svg {
	width: 20px;
	height: 20px;
}

.tu-group__meta {
	min-width: 0;
	flex: 1 1 auto;
}

.tu-group__title {
	margin: 0;
	color: var(--tu-text);
	font-size: var(--tu-s6);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.tu-group__count {
	margin: 2px 0 0;
	color: var(--tu-muted);
	font-size: var(--tu-s2);
}

.tu-group__tag {
	flex: 0 0 auto;
	padding: 5px 12px;
	color: var(--tu-muted);
	font-size: var(--tu-s2);
	font-weight: 500;
	background: var(--tu-surface-2);
	border: 1px solid var(--tu-border);
	border-radius: 999px;
}

/* ---------------------------------------------------------------------
 * Kepala tabel
 * ------------------------------------------------------------------ */

.tu-thead {
	display: grid;
	grid-template-columns: var(--tu-cols);
	gap: var(--tu-gap);
	align-items: center;
	padding: 0 var(--tu-pad-x) 12px;
	margin-bottom: 10px;
	border-bottom: 1px solid var(--tu-border-60);
	color: var(--tu-muted);
	font-size: var(--tu-s2);
	font-weight: 600;
	letter-spacing: .02em;
}

.tu-th {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.tu-th__icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	color: var(--tu-brand);
}

.tu-th span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tu-th__caret {
	display: none;
}

/* ---------------------------------------------------------------------
 * Baris
 * ------------------------------------------------------------------ */

.tu-tbody {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tu-row {
	position: relative;
	background: var(--tu-surface-2);
	border: 1px solid var(--tu-border-60);
	border-radius: calc(var(--tu-radius) * .8);
	overflow: clip;
	transition: transform .35s cubic-bezier(.34, 1.4, .64, 1),
		box-shadow .35s ease,
		border-color .25s ease;
}

.tu-row--featured {
	border-color: var(--tu-brand-35);
	background: linear-gradient(180deg, var(--tu-brand-8), transparent 60%), var(--tu-surface-2);
}

.tu-row__grid {
	display: grid;
	grid-template-columns: var(--tu-cols);
	gap: var(--tu-gap);
	align-items: center;
	padding: var(--tu-pad-y) var(--tu-pad-x);
}

.tu-row__fold,
.tu-row__fold-in {
	display: contents;
}

.tu-row__toggle {
	display: none;
}

.tu-row__note {
	margin: 0;
	padding: 8px var(--tu-pad-x) 12px;
	color: var(--tu-muted);
	font-size: var(--tu-s2);
	border-top: 1px dashed var(--tu-border-60);
}

/* ---------------------------------------------------------------------
 * Sel
 * ------------------------------------------------------------------ */

.tu-cell {
	min-width: 0;
}

.tu-cell__label {
	display: none;
}

.tu-cell__in {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tu-cell--rute .tu-cell__in {
	align-items: center;
}

.tu-cell--cta .tu-cell__in {
	align-items: flex-start;
}

/* Tanggal + ikon */

.tu-date {
	color: var(--tu-brand);
	font-size: var(--tu-s4);
	font-weight: 650;
	white-space: nowrap;
}

.tu-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.tu-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--tu-icon);
	height: var(--tu-icon);
	color: var(--tu-muted);
	border-radius: 7px;
	transition: transform .25s cubic-bezier(.34, 1.4, .64, 1);
}

.tu-ico--wide {
	width: calc(var(--tu-icon) * 1.7);
}

.tu-ico--chip {
	background: #fff;
	padding: 3px 5px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.tu-ico img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
}

.tu-ico--chip img {
	filter: none;
}

.tu-ico--svg {
	color: var(--tu-brand);
	background: var(--tu-brand-12);
	border: 1px solid var(--tu-brand-20);
	padding: 5px;
}

.tu-ico--svg .tu-svg {
	width: 100%;
	height: 100%;
}

.tu-row:hover .tu-ico {
	transform: translateY(-1px) scale(1.04);
}

/* Badge paket */

.tu-badge {
	display: inline-block;
	max-width: 100%;
	padding: 5px 12px;
	color: var(--tu-badge-fg, var(--tu-brand));
	background: var(--tu-badge-bg, var(--tu-brand-12));
	border: 1px solid var(--tu-badge-bd, var(--tu-brand-20));
	border-radius: 999px;
	font-size: var(--tu-s2);
	font-weight: 600;
	line-height: 1.35;
}

/* Baris teks berikon */

.tu-line {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	min-width: 0;
	color: var(--tu-text);
	font-size: var(--tu-s3);
}

.tu-line__icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin-top: 2px;
	color: var(--tu-muted);
}

.tu-line__icon--brand {
	color: var(--tu-brand);
}

.tu-line__icon--accent {
	color: var(--tu-accent);
}

.tu-line > span:last-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Rute */

.tu-route {
	display: inline-block;
	padding: 5px 9px;
	color: var(--tu-text);
	background: var(--tu-bg);
	border: 1px solid var(--tu-border);
	border-radius: 7px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: var(--tu-s1);
	letter-spacing: .04em;
	white-space: nowrap;
}

/* Bonus */

.tu-bonus {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	font-size: var(--tu-s2);
	color: var(--tu-text);
	line-height: 1.35;
}

/* Sisa seat */

.tu-seat {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--tu-text);
	font-size: var(--tu-s3);
	font-weight: 600;
}

/* Harga */

.tu-prices {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-variant-numeric: tabular-nums;
}

.tu-price {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: var(--tu-s2);
}

.tu-price__key {
	flex: 0 0 auto;
	width: 20px;
	padding: 2px 0;
	text-align: center;
	color: var(--tu-muted);
	background: var(--tu-bg);
	border: 1px solid var(--tu-border);
	border-radius: 5px;
	font-size: var(--tu-s1);
	font-weight: 700;
	line-height: 1.2;
}

.tu-price__val {
	color: var(--tu-text);
	font-weight: 550;
	white-space: nowrap;
}

.tu-price--accent .tu-price__key {
	color: var(--tu-brand);
	background: var(--tu-brand-12);
	border-color: var(--tu-brand-20);
}

.tu-price--accent .tu-price__val {
	color: var(--tu-brand);
	font-weight: 700;
}

/* Tombol */

.tu-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	color: var(--tu-on-brand);
	background: var(--tu-brand);
	border-radius: 9px;
	font-size: var(--tu-s2);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: filter .2s ease, transform .2s ease;
}

.tu-btn:hover,
.tu-btn:focus {
	color: var(--tu-on-brand);
	filter: brightness(1.08);
	transform: translateY(-1px);
	text-decoration: none;
}

.tu-btn__icon {
	width: 14px;
	height: 14px;
}

/* ---------------------------------------------------------------------
 * Hover baris (hanya di perangkat berpenunjuk halus)
 * ------------------------------------------------------------------ */

@media (hover: hover) and (pointer: fine) {
	.tu-row:hover {
		z-index: 2;
		border-color: var(--tu-brand-35);
		box-shadow: 0 18px 30px -14px var(--tu-brand-glow);
		transform: translateY(-2px);
	}
}

/* ---------------------------------------------------------------------
 * Layar sedang: rapatkan sedikit agar kolom yang banyak tetap terbaca
 * ------------------------------------------------------------------ */

@media (min-width: 901px) and (max-width: 1180px) {

	.tu {
		--tu-gap: 9px;
		--tu-pad-x: 12px;
	}

	.tu-line > span:last-child,
	.tu-bonus > span:last-child {
		font-size: var(--tu-s2);
	}
}

/* ---------------------------------------------------------------------
 * Mode mobile: 3 kolom + lipatan
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {

	.tu-thead {
		display: flex;
		gap: 0;
		padding: 0 0 10px;
		font-size: var(--tu-s1);
	}

	.tu-th:not([data-m]) {
		display: none;
	}

	.tu-th[data-m] {
		flex: var(--tu-grow, 1) 1 0;
		padding: 0 8px;
	}

	.tu-th[data-m]:first-child {
		padding-left: 13px;
	}

	.tu-th__icon {
		display: none;
	}

	.tu-th__caret {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 34px;
		color: var(--tu-muted);
	}

	.tu-th__caret .tu-svg {
		width: 13px;
		height: 13px;
	}

	.tu-row__grid {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
		gap: 0;
		padding: 0;
	}

	.tu-row--fold .tu-row__grid {
		cursor: pointer;
	}

	.tu-row__grid > .tu-cell[data-m] {
		flex: var(--tu-grow, 1) 1 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 12px 8px;
	}

	.tu-row__grid > .tu-cell[data-m] + .tu-cell[data-m] {
		border-left: 1px solid var(--tu-border-60);
	}

	.tu-row__grid > .tu-cell[data-m]:first-child {
		padding-left: 12px;
	}

	.tu-row__toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 34px;
		appearance: none;
		margin: 0;
		padding: 0;
		color: var(--tu-muted);
		background: none;
		border: 0;
		cursor: pointer;
	}

	.tu-row__toggle .tu-svg {
		width: 16px;
		height: 16px;
		transition: transform .3s cubic-bezier(.16, 1, .3, 1);
	}

	.tu-row.is-open .tu-row__toggle {
		color: var(--tu-brand);
	}

	.tu-row.is-open .tu-row__toggle .tu-svg {
		transform: rotate(180deg);
	}

	.tu-row.is-open {
		border-color: var(--tu-brand-35);
	}

	/* Lipatan */

	.tu-row__fold {
		flex: 0 0 100%;
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows .32s cubic-bezier(.16, 1, .3, 1);
	}

	.tu-row.is-open .tu-row__fold {
		grid-template-rows: 1fr;
	}

	.tu-row__fold-in {
		display: block;
		min-height: 0;
		overflow: hidden;
		overflow: clip;
	}

	.tu-row.is-open .tu-row__fold-in {
		border-top: 1px solid var(--tu-border-60);
		background: var(--tu-surface);
	}

	.tu-row__fold-in .tu-cell {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 14px;
		padding: 11px 12px;
		border-bottom: 1px solid var(--tu-border-60);
	}

	.tu-row__fold-in .tu-cell:last-child {
		border-bottom: 0;
	}

	.tu-row__fold-in .tu-cell__label {
		display: block;
		flex: 0 0 auto;
		padding-top: 2px;
		color: var(--tu-muted);
		font-size: var(--tu-s1);
		font-weight: 600;
		letter-spacing: .02em;
	}

	.tu-row__fold-in .tu-cell__in {
		flex: 1 1 auto;
		align-items: flex-end;
		text-align: right;
	}

	.tu-row__fold-in .tu-line {
		justify-content: flex-end;
	}

	.tu-row__fold-in .tu-line > span:last-child {
		white-space: normal;
	}

	.tu-row__fold-in .tu-bonus {
		justify-content: flex-end;
		text-align: right;
	}

	.tu-row__fold-in .tu-prices {
		align-items: flex-end;
	}

	/* Kolom yang tetap tampil di mobile */

	.tu-row__grid > .tu-cell--tanggal .tu-date {
		font-size: var(--tu-s3);
	}

	.tu-row__grid > .tu-cell .tu-ico {
		width: var(--tu-icon-m);
		height: var(--tu-icon-m);
	}

	.tu-row__grid > .tu-cell .tu-ico--wide {
		width: calc(var(--tu-icon-m) * 1.7);
	}

	.tu-row__grid > .tu-cell--harga .tu-price__key {
		width: 17px;
	}

	.tu-group {
		padding: 14px 10px;
	}

	.tu-group__tag {
		display: none;
	}
}

@media (max-width: 480px) {
	.tu-row__grid > .tu-cell[data-m] {
		padding: 10px 6px;
	}

	.tu-badge {
		padding: 4px 9px;
	}
}

/* ---------------------------------------------------------------------
 * Aksesibilitas & animasi
 * ------------------------------------------------------------------ */

.tu :focus-visible {
	outline: 2px solid var(--tu-brand);
	outline-offset: 2px;
	border-radius: 6px;
}

.tu .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.tu-notice {
	padding: 12px 16px;
	color: #7c2d12;
	background: #fff7ed;
	border: 1px solid #fdba74;
	border-radius: 8px;
	font-size: 14px;
}

@keyframes tu-fade-up {
	from {
		opacity: 0;
		transform: translateY(18px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.tu--animate .tu-row {
	opacity: 0;
	animation: tu-fade-up .6s cubic-bezier(.16, 1, .3, 1) forwards;
	animation-delay: calc(var(--tu-i, 1) * 45ms);
}

@media (prefers-reduced-motion: reduce) {

	.tu--animate .tu-row {
		opacity: 1;
		animation: none;
	}

	.tu-row,
	.tu-ico,
	.tu-btn,
	.tu-row__fold,
	.tu-row__toggle .tu-svg {
		transition: none !important;
	}
}

/* ---------------------------------------------------------------------
 * Cetak
 * ------------------------------------------------------------------ */

@media print {

	.tu {
		padding: 0;
		color: #000;
		background: none;
	}

	.tu--animate .tu-row {
		opacity: 1;
		animation: none;
	}

	.tu__filter,
	.tu-row__toggle,
	.tu-th__caret,
	.tu-thead {
		display: none !important;
	}

	/* Cetak sebagai daftar label/nilai supaya terbaca di kertas. */
	.tu-row__grid {
		display: block !important;
		padding: 8px 10px !important;
	}

	.tu-row__fold,
	.tu-row__fold-in {
		display: block !important;
		grid-template-rows: none !important;
		overflow: visible !important;
	}

	.tu-cell {
		display: flex !important;
		justify-content: space-between;
		gap: 14px;
		padding: 3px 0 !important;
		border: 0 !important;
	}

	.tu-cell__label {
		display: block !important;
		flex: 0 0 auto;
		font-weight: 600;
	}

	.tu-cell__in {
		align-items: flex-end;
		text-align: right;
	}

	.tu-row,
	.tu-group {
		break-inside: avoid;
		box-shadow: none;
	}
}
