/**
 * 3M&L Vehicle Features - front-end styles.
 * All selectors are namespaced with .threeml-* so they never touch the WP
 * admin, the Elementor editor chrome, or unrelated pages.
 */

:root {
	--3ml-bg: #020617;
	--3ml-bg-2: #071123;
	--3ml-card: #0A1528;
	--3ml-card-hover: #0D1C34;
	--3ml-green: #20E55A;
	--3ml-green-hover: #12C947;
	--3ml-text: #FFFFFF;
	--3ml-text-2: #A8B3C7;
	--3ml-muted: #728096;
	--3ml-border: rgba(255, 255, 255, 0.08);
	--3ml-green-border: rgba(32, 229, 90, 0.35);
	--3ml-radius: 16px;
	--3ml-radius-sm: 10px;
}

/* ---------- Filters ---------- */
.threeml-fleet {
	color: var(--3ml-text-2);
	font-family: inherit;
}
.threeml-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin: 0 0 34px;
}
.threeml-filter {
	appearance: none;
	cursor: pointer;
	border: 1px solid var(--3ml-border);
	background: var(--3ml-card);
	color: var(--3ml-text-2);
	padding: 10px 20px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
	transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.threeml-filter:hover { color: var(--3ml-text); border-color: var(--3ml-green-border); }
.threeml-filter.is-active {
	background: var(--3ml-green);
	color: #04160b;
	border-color: var(--3ml-green);
}

/* ---------- Grid ---------- */
.threeml-grid-vehicles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
@media (max-width: 1024px) { .threeml-grid-vehicles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .threeml-grid-vehicles { grid-template-columns: 1fr; } }

.threeml-card {
	background: var(--3ml-card);
	border: 1px solid var(--3ml-border);
	border-radius: var(--3ml-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.threeml-card.is-hidden { display: none; }

.threeml-card-media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--3ml-bg-2);
}
.threeml-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.threeml-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(2, 6, 23, 0.75);
	border: 1px solid var(--3ml-green-border);
	color: var(--3ml-green);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 999px;
}
.threeml-card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.threeml-card-title { color: var(--3ml-text); font-size: 20px; font-weight: 700; margin: 0; }
.threeml-card-specs { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.threeml-card-specs li { display: flex; flex-direction: column; font-size: 12px; }
.threeml-card-specs span { color: var(--3ml-muted); text-transform: uppercase; letter-spacing: .06em; }
.threeml-card-specs strong { color: var(--3ml-text); font-size: 14px; }
.threeml-card-price { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.threeml-from { color: var(--3ml-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.threeml-amount { color: var(--3ml-green); font-size: 24px; font-weight: 800; }
.threeml-per { color: var(--3ml-muted); font-size: 13px; }
.threeml-card-summary { color: var(--3ml-text-2); font-size: 14px; margin: 0; line-height: 1.5; }

.threeml-card-hover {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	font-size: 13px;
	color: var(--3ml-text-2);
	transition: max-height .3s ease, opacity .3s ease;
}
.threeml-card-hover strong { color: var(--3ml-green); }

.threeml-card-actions { display: flex; gap: 10px; margin-top: auto; }

/* Desktop hover behaviour */
@media (hover: hover) and (min-width: 768px) {
	.threeml-card:hover {
		transform: translateY(-6px);
		background: var(--3ml-card-hover);
		border-color: var(--3ml-green-border);
		box-shadow: 0 18px 50px -20px rgba(32, 229, 90, 0.35);
	}
	.threeml-card:hover .threeml-card-media img { transform: scale(1.06); }
	.threeml-card:hover .threeml-card-hover { max-height: 60px; opacity: 1; }
}

/* ---------- Buttons ---------- */
.threeml-btn {
	appearance: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1;
	text-align: center;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 16px;
	border-radius: var(--3ml-radius-sm);
	border: 1px solid transparent;
	transition: background .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
}
.threeml-btn:active { transform: translateY(1px); }
.threeml-btn-green { background: var(--3ml-green); color: #04160b; }
.threeml-btn-green:hover { background: var(--3ml-green-hover); color: #04160b; }
.threeml-btn-ghost { background: transparent; color: var(--3ml-text); border-color: var(--3ml-border); }
.threeml-btn-ghost:hover { border-color: var(--3ml-green-border); color: var(--3ml-green); }

/* ---------- Rate table ---------- */
.threeml-table-wrap { color: var(--3ml-text-2); }
.threeml-scroll-hint { display: none; color: var(--3ml-muted); font-size: 12px; margin: 0 0 8px; }
.threeml-rate-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--3ml-bg-2);
	border: 1px solid var(--3ml-border);
	border-radius: var(--3ml-radius);
	overflow: hidden;
	font-size: 14px;
}
.threeml-rate-table th,
.threeml-rate-table td {
	padding: 14px 16px;
	text-align: center;
	border-bottom: 1px solid var(--3ml-border);
	border-right: 1px solid var(--3ml-border);
	white-space: nowrap;
}
.threeml-rate-table thead th {
	background: var(--3ml-card);
	color: var(--3ml-text);
	text-transform: uppercase;
	letter-spacing: .05em;
	font-size: 12px;
	position: sticky;
	top: 0;
}
.threeml-rate-table td { color: var(--3ml-text-2); }
.threeml-rate-table td.threeml-hl { color: var(--3ml-green); font-weight: 700; }
.threeml-sticky-col { text-align: left !important; }
.threeml-sticky-col strong { display: block; color: var(--3ml-text); }
.threeml-sticky-col small { color: var(--3ml-muted); }
.threeml-table-note { color: var(--3ml-muted); font-size: 13px; margin: 14px 0 0; }

@media (max-width: 767px) {
	.threeml-scroll-hint { display: block; }
	.threeml-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.threeml-rate-table { min-width: 720px; }
	.threeml-sticky-col { position: sticky; left: 0; background: var(--3ml-bg-2); z-index: 1; }
}

/* ---------- Modal ---------- */
.threeml-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.threeml-modal[hidden] { display: none; }
.threeml-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, 0.8);
	backdrop-filter: blur(4px);
}
.threeml-modal-panel {
	position: relative;
	z-index: 1;
	width: min(720px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	background: var(--3ml-card);
	border: 1px solid var(--3ml-green-border);
	border-radius: var(--3ml-radius);
	box-shadow: 0 30px 80px -20px rgba(32, 229, 90, 0.3);
	animation: threeml-pop .25s ease;
}
@keyframes threeml-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.threeml-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--3ml-border);
	background: rgba(2, 6, 23, 0.7);
	color: var(--3ml-text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.threeml-modal-close:hover { color: var(--3ml-green); border-color: var(--3ml-green-border); }
.threeml-modal-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--3ml-bg-2); border-radius: var(--3ml-radius) var(--3ml-radius) 0 0; }
.threeml-modal-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.threeml-modal-content { padding: 24px; }
.threeml-modal-category { color: var(--3ml-green); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.threeml-modal-title { color: var(--3ml-text); font-size: 26px; font-weight: 800; margin: 6px 0 12px; }
.threeml-modal-meta { display: flex; gap: 20px; color: var(--3ml-text-2); font-size: 14px; margin-bottom: 18px; }
.threeml-modal-rates { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.threeml-modal-rates th, .threeml-modal-rates td { padding: 10px 12px; border-bottom: 1px solid var(--3ml-border); font-size: 14px; }
.threeml-modal-rates th { text-align: left; color: var(--3ml-text-2); font-weight: 500; }
.threeml-modal-rates td { text-align: right; color: var(--3ml-text); font-weight: 700; }
.threeml-modal-notes { color: var(--3ml-muted); font-size: 13px; margin: 0 0 18px; line-height: 1.5; }
.threeml-modal-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.threeml-modal-actions .threeml-btn { flex: 1 1 180px; }

/* ---------- Back to top ---------- */
.threeml-back-to-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 9998;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--3ml-green-border);
	background: var(--3ml-card);
	color: var(--3ml-green);
	font-size: 20px;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.threeml-back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
	.threeml-card,
	.threeml-card-media img,
	.threeml-card-hover,
	.threeml-modal-panel,
	.threeml-back-to-top { transition: none; animation: none; }
}

body.threeml-no-scroll { overflow: hidden; }
