/*
 * Azeb Trucks — single truck page (template-parts/vehicles.php).
 * Loaded after refresh.css on single posts only. Uses its --az-* tokens.
 */

.tp {
	--tp-sunken: #eef0ea;
	--tp-line: #e3e6df;
	--tp-wa: #1f9d55;
	--tp-display: 'Barlow Semi Condensed', 'Arial Narrow', 'Inter', system-ui, sans-serif;
	clear: both; /* the header's Bootstrap columns are floated and not cleared */
	background: #f5f6f2;
	color: var(--az-ink);
	padding: 8px 0 72px;
	font-size: 15px;
	line-height: 1.6;
}
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp h1, .tp h2, .tp h3, .tp p, .tp dl, .tp dd { margin: 0; }

.tp-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tp-i-fill { fill: currentColor; stroke: none; }

/* ---------- Breadcrumb + title ---------- */

.tp-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 20px; font-size: 13px; color: var(--az-muted); }
.tp-crumbs a { color: var(--az-muted); }
.tp-crumbs a:hover { color: var(--az-ink); text-decoration: none; }
.tp-crumbs span[aria-hidden] { opacity: .5; }
.tp-crumbs > span:last-child { color: var(--az-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.tp-head { padding: 14px 0 24px; }
.tp .tp-head h1 {
	font: 700 clamp(28px, 3.6vw, 42px)/1.08 var(--tp-display);
	letter-spacing: -.005em;
	color: var(--az-ink);
	margin-top: 10px;
	text-wrap: balance;
	text-transform: none;
}

/* ---------- Layout ---------- */

.tp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.tp-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; container-type: inline-size; }

/* ---------- Gallery ---------- */

.tp-gallery { display: flex; flex-direction: column; gap: 10px; }
.tp-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--tp-sunken); }
.tp-stage .carousel-inner > .item > img,
.tp-stage .carousel-inner > .item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	max-width: 100%;
	/* 4:3 when there's room; on wide screens shorter (down to 16:10, trimming a little top and bottom) so the photo
	   and the thumbs row fit under the sticky header once scrolled to the gallery.
	   (100cqw - 70px) * 3 / 32 is the thumbs' height: eight 4:3 thumbs across .tp-main. */
	height: max(62.5cqw, min(75cqw, calc(100vh - var(--az-head-h, 76px) - (100cqw - 70px) * 3 / 32 - 40px)));
}
.tp-arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 44px; height: 44px; border-radius: 50%;
	display: grid; place-items: center;
	background: rgba(255, 255, 255, .85); color: #14191c;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	transition: background-color .15s ease, transform .15s ease;
}
.tp-arrow:hover, .tp-arrow:focus { background: #fff; color: #14191c; transform: translateY(-50%) scale(1.05); }
.tp-arrow .tp-i { width: 20px; height: 20px; stroke-width: 2; }
.tp-prev { left: 14px; }
.tp-next { right: 14px; }
.tp-counter {
	position: absolute; left: 14px; bottom: 14px; z-index: 2;
	font: 500 12.5px/1 var(--az-font); color: #fff; font-variant-numeric: tabular-nums;
	background: rgba(15, 20, 23, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	padding: 8px 12px; border-radius: 999px;
}

.tp-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 70px) / 8); gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
.tp-thumbs::-webkit-scrollbar { display: none; }
.tp-thumb {
	padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
	background: var(--tp-sunken); opacity: .7; transition: opacity .15s ease, box-shadow .15s ease;
}
.tp-thumb:hover { opacity: 1; }
.tp-thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px #f5f6f2, 0 0 0 4px var(--az-ink); }
.tp-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Key facts ---------- */

/* 1px gaps over a line-coloured background draw the dividers, however the items wrap */
.tp-facts { display: flex; flex-wrap: wrap; gap: 1px; background: var(--tp-line); border: 1px solid var(--tp-line); border-radius: 12px; overflow: hidden; }
.tp-facts > div { flex: 1 1 128px; padding: 16px 18px; min-width: 0; background: var(--az-surface); }
.tp-facts dt { font: 400 12px/1.3 var(--az-font); color: var(--az-muted); margin-bottom: 6px; }
.tp-facts dd { font: 600 18px/1.2 var(--tp-display); color: var(--az-ink); font-variant-numeric: tabular-nums; }

/* ---------- Panels ---------- */

.tp-panel { background: var(--az-surface); border: 1px solid var(--tp-line); border-radius: 12px; padding: 28px; }
.tp .tp-panel h2 { font: 600 22px/1.2 var(--tp-display); color: var(--az-ink); margin-bottom: 16px; text-transform: none; }

.tp-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.tp-specs > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tp-line); }
.tp-specs dt { font-weight: 400; color: var(--az-muted); font-size: 14px; }
.tp-specs dd { font-weight: 500; color: var(--az-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.tp-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; margin: 0; padding: 0; list-style: none; }
.tp-points li { display: flex; gap: 12px; align-items: flex-start; color: var(--az-ink); font-weight: 500; }
.tp-points li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--az-brand); }
@container (max-width: 560px) { .tp-points { grid-template-columns: minmax(0, 1fr); } }
.tp-content { color: var(--az-ink-2); }
.tp-content p { margin: 0 0 12px; }
.tp-content p:last-child { margin-bottom: 0; }

.tp-why { padding: 0; }
.tp .tp-why h2 { padding: 22px 28px 0; margin: 0; font: 600 12px/1 var(--az-font); letter-spacing: .12em; text-transform: uppercase; color: var(--az-muted); }
.tp-why dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 0 26px; }
.tp-why dl > div { padding: 4px 24px; min-width: 0; }
.tp-why dl > div + div { border-left: 1px solid var(--tp-line); }
.tp-why dt { font: 700 28px/1 var(--tp-display); color: var(--az-ink); margin-bottom: 8px; }
.tp-why dt sup { font-size: .55em; top: -.75em; color: var(--az-brand-hover); margin-left: 1px; }
.tp-why dd { font-size: 13.5px; line-height: 1.45; color: var(--az-ink-2); }
@container (max-width: 760px) {
	.tp-why dl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
	.tp-why dl > div:nth-child(3) { border-left: 0; }
}
@container (max-width: 560px) {
	.tp-specs { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Price + enquiry card ---------- */

.tp-side { position: sticky; top: calc(var(--az-head-h, 0px) + 20px); display: flex; flex-direction: column; gap: 16px; }
.admin-bar .tp-side { top: calc(var(--az-head-h, 0px) + 52px); }
.tp-buy { background: var(--az-surface); border: 1px solid var(--tp-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(20, 25, 28, .04), 0 8px 24px rgba(20, 25, 28, .06); overflow: hidden; }
.tp-buy-top { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.tp-price-label { font-size: 13px; color: var(--az-muted); }
.tp-price { font: 700 40px/1 var(--tp-display); color: var(--az-ink); font-variant-numeric: tabular-nums; margin-top: 6px; }
.tp-price-text { font-size: 26px; line-height: 1.15; }
.tp-actions { display: grid; gap: 10px; }
.tp-alt { font-size: 13px; color: var(--az-muted); text-align: center; }
.tp-alt a { color: var(--az-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.tp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font: 600 15px/1 var(--az-font); padding: 14px 18px; border-radius: 10px;
	border: 1px solid transparent; white-space: nowrap; text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
.tp-btn:hover, .tp-btn:focus { text-decoration: none; }
.tp-btn-primary, .tp-btn-primary:focus { background: var(--az-brand); color: #14191c; }
.tp-btn-primary:hover { background: var(--az-brand-hover); color: #14191c; }
.tp-btn-wa, .tp-btn-wa:focus { background: #fff; color: var(--tp-wa); border-color: rgba(31, 157, 85, .45); }
.tp-btn-wa:hover { background: rgba(31, 157, 85, .07); color: var(--tp-wa); }
.tp-btn-ghost, .tp-btn-ghost:focus { background: #fff; color: var(--az-ink); border-color: var(--tp-line); }
.tp-btn-ghost:hover { color: var(--az-ink); border-color: var(--az-muted); }

/* Contact Form 7 inside the card */
.tp-form { border-top: 1px solid var(--tp-line); padding: 22px 24px 24px; background: #fafbf8; }
.tp .tp-form h3 { font: 600 18px/1.2 var(--tp-display); color: var(--az-ink); margin-bottom: 14px; text-transform: none; }
.tp-form .sidebar-contact p { margin: 0 0 14px; }
.tp-form label { display: block; margin: 0; font: 500 13px/1.4 var(--az-font); color: var(--az-ink-2); }
.tp-form label br { display: none; }
.tp-form .wpcf7-form-control-wrap { display: block; margin-top: 6px; }
.tp-form input[type="text"],
.tp-form input[type="email"],
.tp-form input[type="tel"],
.tp-form textarea {
	display: block; width: 100%; max-width: 100%;
	font: 400 14.5px/1.4 var(--az-font); color: var(--az-ink);
	background: #fff; border: 1px solid var(--tp-line); border-radius: 8px;
	padding: 11px 12px; box-shadow: none; height: auto;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tp-form textarea { height: 110px; resize: vertical; }
.tp-form input:focus, .tp-form textarea:focus { outline: none; border-color: var(--az-brand-ink); box-shadow: 0 0 0 3px rgba(184, 193, 20, .3); }
.tp .tp-form input.wpcf7-submit {
	width: 100%; margin: 4px 0 0; padding: 14px 18px; height: auto;
	font: 600 15px/1 var(--az-font); color: #fff; background: var(--az-ink);
	border: 0; border-radius: 10px; cursor: pointer; transition: opacity .15s ease;
}
.tp .tp-form input.wpcf7-submit:hover { opacity: .9; }
.tp-form .sidebar-contact p:last-child { margin-bottom: 0; display: flex; flex-direction: column; align-items: center; }
.tp-form .wpcf7-not-valid-tip { font-size: 12.5px; margin-top: 4px; }
.tp-form .wpcf7-response-output { margin: 14px 0 0 !important; padding: 10px 12px !important; border-radius: 8px; font-size: 13.5px; }

/* Recently viewed */
.tp-recent { background: var(--az-surface); border: 1px solid var(--tp-line); border-radius: 12px; padding: 20px 24px; }
.tp .tp-recent h3 { font: 600 12px/1 var(--az-font); letter-spacing: .12em; text-transform: uppercase; color: var(--az-muted); margin-bottom: 14px; }
.tp-recent .recent_pro_box { float: none; width: auto; display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; align-items: start; padding: 0; margin: 0 0 14px; border: 0; background: none; }
.tp-recent .recent_pro_box:last-child { margin-bottom: 0; }
.tp-recent .recent_pro_box > a { grid-row: 1 / 3; }
.tp-recent .recent_pro_box img { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.tp-recent .recent_pro_box h2 { font: 500 14px/1.35 var(--az-font); margin: 0; text-transform: none; }
.tp-recent .recent_pro_box h2 a { color: var(--az-ink); }
.tp-recent .recent_pro_box h4 { font: 400 13px/1.4 var(--az-font); color: var(--az-muted); margin: 4px 0 0; text-transform: none; }
.tp-recent .recent_pro_box h4 span { float: none; color: var(--az-ink); font-weight: 600; margin-left: 4px; }

/* Phone action bar */
.tp-mbar { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.tp-grid { grid-template-columns: minmax(0, 1fr); }
	.tp-side { position: static; }
}

@media (max-width: 767px) {
	.tp { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
	.tp-thumbs { grid-auto-columns: 84px; }
	.tp-specs { grid-template-columns: minmax(0, 1fr); }
	.tp-panel { padding: 20px; }
	.tp .tp-why h2 { padding: 20px 20px 0; }
	.tp-why dl > div { padding: 4px 20px; }
	.tp-arrow { width: 38px; height: 38px; }
	.tp-mbar {
		display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
		background: #fff; border-top: 1px solid var(--tp-line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
		padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
	}
	.tp-mbar .tp-btn { padding: 12px 8px; font-size: 14px; }
	/* The action bar has its own WhatsApp button; the chat plugin's floating one would cover "Enquire" */
	body:has(.tp-mbar) .qlwapp { display: none !important; }
}

/* "Why buy" on a phone-width main column */
@container (max-width: 480px) {
	.tp .tp-why h2 { padding: 20px 16px 0; }
	.tp-why dl > div { padding: 4px 16px; }
	.tp-why dt { font-size: 22px; white-space: nowrap; }
	.tp-why dd { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.tp * { transition: none !important; }
}
