/* CatCredit — Lender (single-offer) detail page CSS. */

.ld-page { background: var(--bg-warm); min-height: 100vh; padding-bottom: 80px; overflow-x: hidden; }
.ld-back-row { padding: 18px 0 0; }
.ld-back-row .reg-back {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 14px;
	font-size: 13px; font-weight: 500;
	color: var(--ink-2);
	border-radius: var(--radius-sm);
	transition: background 0.15s ease;
}
.ld-back-row .reg-back:hover { background: var(--bg); }

.ld-grid {
	display: grid;
	/* minmax(0, 1fr) prevents grid column from expanding to fit content (e.g. wide table). */
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	margin-top: 32px;
}
@media (min-width: 1000px) { .ld-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; } }

.ld-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* Hero */
.ld-hero {
	background: var(--bg);
	border: 0.5px solid var(--line);
	border-radius: var(--radius-xl);
	padding: 32px 24px;
}
@media (min-width: 768px) { .ld-hero { padding: 40px; } }
.ld-hero-top { display: flex; flex-direction: column; gap: 20px; }
.ld-brand { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ld-logo {
	width: 72px; height: 72px; border-radius: 18px;
	display: grid; place-items: center;
	font-family: var(--font-display); font-weight: 800; font-size: 24px;
	flex-shrink: 0;
	overflow: hidden;
}
.ld-logo.is-initials { background: var(--yellow); color: var(--ink); }
.ld-logo.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-brand-info { min-width: 0; flex: 1 1 100%; }
@media (min-width: 600px) { .ld-brand-info { flex: 1; } }
.ld-brand-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-brand-name h1 { font-size: clamp(24px, 5.5vw, 36px); margin: 0; letter-spacing: -0.03em; }
.ld-brand-name .verified { color: var(--green); font-size: 18px; }
.ld-brand-sub { font-size: 14px; color: var(--ink-3); margin-top: 4px; }
.ld-brand-rating { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.ld-brand-rating .stars { color: var(--yellow); font-size: 14px; letter-spacing: 1px; }
.ld-brand-rating .num { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 15px; }
.ld-brand-rating .sep { opacity: 0.4; }
.ld-brand-meta { display: flex; gap: 10px 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--ink-3); word-break: break-word; }
.ld-brand-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }

.ld-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ld-tag {
	padding: 4px 10px; border-radius: 999px;
	background: var(--bg-dim); color: var(--ink-2);
	font-size: 11px; font-weight: 600;
}
.ld-tag.good { background: rgba(31, 138, 91, 0.12); color: var(--green); }
.ld-tag.fire { background: rgba(255, 107, 53, 0.14); color: var(--orange); }
.ld-tag.sky { background: rgba(0, 104, 255, 0.12); color: #0068FF; }

.ld-hero-legal {
	margin-top: 24px;
	padding: 14px 18px;
	background: var(--bg-warm);
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
	display: flex; gap: 12px; align-items: flex-start;
	font-size: 13px; color: var(--ink-2);
	line-height: 1.55;
	word-break: break-word;
	overflow-wrap: anywhere;
}
.ld-hero-legal-ico { font-size: 18px; flex-shrink: 0; }
.ld-hero-legal strong { color: var(--ink); font-weight: 700; }

/* Sticky nav */
.ld-nav {
	position: sticky; top: 56px;
	background: color-mix(in oklab, var(--bg-warm) 90%, transparent);
	backdrop-filter: saturate(160%) blur(18px);
	margin: 0;
	z-index: 30;
	border-top: 0.5px solid var(--line);
	border-bottom: 0.5px solid var(--line);
	border-radius: var(--radius);
}
@media (min-width: 768px) { .ld-nav { margin: 0 -24px; border-radius: 0; } }
.ld-nav-inner {
	display: flex; gap: 4px; overflow-x: auto; padding: 12px 24px;
	scrollbar-width: none;
}
.ld-nav-inner::-webkit-scrollbar { display: none; }
.ld-nav a {
	flex-shrink: 0;
	padding: 8px 16px; border-radius: 999px;
	font-size: 13px; font-weight: 600;
	color: var(--ink-3);
	white-space: nowrap;
	transition: all 0.15s ease;
}
.ld-nav a:hover { color: var(--ink); background: var(--bg); }
.ld-nav a.active { background: var(--ink); color: var(--yellow); }

/* Sections */
.ld-section {
	background: var(--bg);
	border: 0.5px solid var(--line);
	border-radius: var(--radius-xl);
	padding: 24px 18px;
	scroll-margin-top: 120px;
	min-width: 0;
}
@media (min-width: 600px) { .ld-section { padding: 32px 24px; } }
@media (min-width: 768px) { .ld-section { padding: 40px; } }
.ld-section-head { margin-bottom: 24px; }
.ld-section-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); font-weight: 700; margin-bottom: 6px; }
.ld-section h2 { font-size: clamp(22px, 2.8vw, 28px); margin-bottom: 10px; }
.ld-section p { color: var(--ink-3); font-size: 14px; max-width: 56ch; }
.ld-h3 { margin-top: 28px; margin-bottom: 14px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; color: var(--ink); }

.ld-kv {
	display: grid; grid-template-columns: 1fr 1fr;
	gap: 10px;
}
@media (min-width: 768px) { .ld-kv { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.ld-kv-row {
	padding: 12px 14px;
	background: var(--bg-warm);
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
	min-width: 0;
}
@media (min-width: 480px) { .ld-kv-row { padding: 14px 16px; } }
.ld-kv-row .k { font-size: 11px; color: var(--ink-3); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (min-width: 480px) { .ld-kv-row .k { font-size: 12px; } }
.ld-kv-row .v { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; word-break: break-word; }
@media (min-width: 480px) { .ld-kv-row .v { font-size: 16px; margin-top: 6px; } }
.ld-kv-row .v.highlight { color: var(--orange); }

.ld-cost {
	background: var(--bg-warm);
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 22px;
}
.ld-cost-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 0.5px solid var(--line); font-size: 14px; }
.ld-cost-row:first-child { border-top: 0; padding-top: 0; }
.ld-cost-row .k { color: var(--ink-3); }
.ld-cost-row .v { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ld-cost-row.total { margin-top: 6px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.ld-cost-row.total .k { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.ld-cost-row.total .v { font-size: 18px; color: var(--orange); }
.ld-cost-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-4); }

.ld-perks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ld-perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.ld-perks .check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 1px; }
.ld-perks strong { color: var(--ink); font-weight: 700; }

/* Schedule table — desktop default, mobile stacks as cards */
.ld-table-wrap {
	overflow-x: auto;
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
	-webkit-overflow-scrolling: touch;
}
.ld-table {
	width: 100%; border-collapse: collapse;
	font-size: 13px;
}
.ld-table thead {
	background: var(--bg-warm);
	font-family: var(--font-display);
	font-weight: 700; font-size: 12px;
	letter-spacing: 0.04em; text-transform: uppercase;
	color: var(--ink-3);
}
.ld-table th, .ld-table td { padding: 12px 14px; text-align: left; border-bottom: 0.5px solid var(--line); white-space: nowrap; }
.ld-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ld-table tr:last-child td { border-bottom: 0; }
.ld-table tr:hover td { background: var(--bg-warm); }

/* Mobile <600px: stack rows as cards instead of horizontal scroll */
@media (max-width: 599px) {
	.ld-table-wrap { border: 0; overflow: visible; }
	.ld-table, .ld-table thead, .ld-table tbody, .ld-table tr, .ld-table th, .ld-table td { display: block; }
	.ld-table thead { display: none; }
	.ld-table tr {
		background: var(--bg-warm);
		border: 0.5px solid var(--line);
		border-radius: var(--radius);
		padding: 12px 14px;
		margin-bottom: 10px;
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 6px 12px;
	}
	.ld-table tr:last-child { margin-bottom: 0; }
	.ld-table td {
		padding: 4px 0;
		border-bottom: 0;
		white-space: normal;
		text-align: right;
		display: flex; justify-content: space-between; align-items: center;
		grid-column: 1 / -1;
	}
	.ld-table td::before {
		content: attr(data-label);
		font-family: var(--font-display);
		font-weight: 700; font-size: 11px;
		letter-spacing: 0.04em; text-transform: uppercase;
		color: var(--ink-3);
		margin-right: 12px;
	}
	.ld-table td:first-child {
		grid-column: 1 / -1;
		padding-bottom: 8px;
		margin-bottom: 4px;
		border-bottom: 0.5px solid var(--line);
		justify-content: flex-start;
	}
	.ld-table td:first-child::before {
		content: "Kỳ ";
	}
	.ld-table td:first-child::after {
		content: " / " attr(data-total);
		color: var(--ink-3);
		margin-left: 4px;
	}
}

/* Requirements */
.ld-checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .ld-checklist { grid-template-columns: 1fr 1fr; } }
.ld-checklist li {
	display: flex; gap: 12px; align-items: center;
	padding: 14px 16px;
	background: var(--bg-warm);
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
	font-size: 14px; color: var(--ink-2);
}
.ld-checklist .check { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }

/* Process */
.ld-process { display: flex; flex-direction: column; gap: 14px; }
.ld-process-step {
	display: flex; gap: 16px; align-items: flex-start;
	padding: 18px 20px;
	background: var(--bg-warm);
	border: 0.5px solid var(--line);
	border-radius: var(--radius);
}
.ld-process-step .step-n {
	width: 36px; height: 36px; border-radius: 50%;
	background: var(--ink); color: var(--yellow);
	display: grid; place-items: center;
	font-family: var(--font-display); font-weight: 800; font-size: 15px;
	flex-shrink: 0;
}
.ld-process-step h4 { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0 0 4px; letter-spacing: -0.01em; }
.ld-process-step p { font-size: 13.5px; color: var(--ink-3); margin: 0; line-height: 1.55; }

/* Reviews — grid card đánh giá khách hàng */
.ld-reviews {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
@media (max-width: 719px) { .ld-reviews { grid-template-columns: 1fr; } }
.ld-review {
	display: flex; flex-direction: column; gap: 12px;
	padding: 20px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-1);
}
.ld-review-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ld-review .stars { color: var(--yellow); font-size: 14px; letter-spacing: 2px; }
.ld-review .stars .off { color: var(--line-2); }
.ld-review-time { font-size: 12px; color: var(--ink-4); }
.ld-review-quote { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; flex: 1; }
.ld-review-who { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 0.5px solid var(--line); }
.ld-review-avatar {
	width: 36px; height: 36px; flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	background: var(--yellow-tint);
	border: 1px solid var(--yellow-soft);
	border-radius: 50%;
	font-family: var(--font-display); font-weight: 700; font-size: 12px;
	color: var(--ink);
}
.ld-review-name { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; }
.ld-review-meta { font-size: 12px; color: var(--ink-3); }

/* Form "Viết đánh giá" */
.ld-review-form {
	margin-top: 20px;
	padding: 24px;
	background: var(--bg-warm);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.ld-review-form h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 0 4px; letter-spacing: -0.01em; }
.ld-review-form-sub { font-size: 13.5px; color: var(--ink-3); margin: 0 0 16px; }
.ld-review-notice {
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	font-size: 13.5px; font-weight: 500;
	margin-bottom: 16px;
}
.ld-review-notice.ok { background: var(--yellow-tint); border: 1px solid var(--yellow-soft); color: var(--ink); }
.ld-review-notice.err { background: rgba(255, 107, 53, 0.08); border: 1px solid rgba(255, 107, 53, 0.3); color: var(--ink); }
.ld-review-form .vm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ld-review-form-row { margin-bottom: 14px; }
.ld-review-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 719px) { .ld-review-form-grid { grid-template-columns: 1fr; } }
.ld-review-form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.ld-review-form-label .req { color: var(--orange); }
.ld-review-form input[type="text"],
.ld-review-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--line-2);
	border-radius: var(--radius-sm);
	background: var(--bg);
	font-family: var(--font-body); font-size: 14px;
	color: var(--ink);
	transition: border-color 0.15s ease;
}
.ld-review-form input[type="text"]:focus,
.ld-review-form textarea:focus { outline: 0; border-color: var(--ink); }
.ld-review-form textarea { resize: vertical; min-height: 88px; }

/* Star picker — render 5→1, row-reverse để :checked ~ label tô các sao bên trái */
.vm-star-pick {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 2px;
}
.vm-star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vm-star-pick label {
	font-size: 26px;
	line-height: 1;
	color: var(--line-2);
	cursor: pointer;
	transition: color 0.1s ease, transform 0.1s ease;
	padding: 2px;
}
.vm-star-pick label:hover { transform: scale(1.12); }
.vm-star-pick input:checked ~ label,
.vm-star-pick input:checked + label,
.vm-star-pick label:hover,
.vm-star-pick label:hover ~ label { color: var(--yellow); }
.vm-star-pick input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* Sidebar */
.ld-aside { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1000px) { .ld-aside { position: sticky; top: 120px; } }

.ld-summary {
	background: var(--ink); color: #fff;
	border-radius: var(--radius-lg);
	padding: 26px 24px;
	position: relative; overflow: hidden;
}
.ld-summary::before {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(50% 50% at 100% 0%, var(--yellow) 0%, transparent 60%);
	opacity: 0.15;
}
.ld-summary > * { position: relative; }
.ld-summary-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); }
.ld-summary-amount {
	font-family: var(--font-display); font-weight: 700;
	font-size: clamp(32px, 4.4vw, 40px);
	letter-spacing: -0.03em; color: #fff;
	margin: 6px 0 16px; font-variant-numeric: tabular-nums;
}
.ld-summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 0.5px solid rgba(255,255,255,0.1); }
.ld-summary-row .k { font-size: 12px; color: rgba(255,255,255,0.6); }
.ld-summary-row .v { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.ld-summary-row .v.hl { color: var(--yellow); font-size: 16px; }
.ld-summary .btn { margin-top: 18px; }

.ld-help {
	display: flex; flex-direction: column; align-items: center; text-align: center;
	padding: 22px 20px;
	background: var(--bg);
	border: 0.5px solid var(--line);
	border-radius: var(--radius-lg);
	gap: 10px;
}
.ld-help h4 { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 4px 0 2px; }
.ld-help p { font-size: 13px; color: var(--ink-3); margin: 0 0 8px; }
.ld-help .btn { width: 100%; }

/* ─── Thanh CTA gim đáy (chỉ mobile, aside trôi xuống dưới) ─── */
.ld-sticky-cta {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 50;
	display: flex; align-items: center; gap: 14px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	background: color-mix(in oklab, var(--bg) 88%, transparent);
	backdrop-filter: saturate(160%) blur(18px);
	-webkit-backdrop-filter: saturate(160%) blur(18px);
	border-top: 0.5px solid var(--line);
	box-shadow: 0 -8px 24px -16px rgba(10,10,10,0.28);
}
.ld-sticky-info { display: flex; flex-direction: column; line-height: 1.15; flex-shrink: 0; }
.ld-sticky-label { font-size: 11px; color: var(--ink-3); }
.ld-sticky-amount { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--orange); }
.ld-sticky-cta .btn { flex: 1; }
/* Chừa chỗ để thanh không che nội dung cuối trang (mobile) */
.ld-grid { padding-bottom: 84px; }
@media (min-width: 1000px) {
	.ld-sticky-cta { display: none; }
	.ld-grid { padding-bottom: 0; }
}
