/**
 * Car Dealer Suite — Public Styles
 * Theme-agnostic, scoped to .cds-* classes only
 */

:root {
	--cds-gold: #d4a548;
	--cds-gold-dark: #b8902e;
	--cds-dark: #0a0a0c;
	--cds-text: #1a1a1e;
	--cds-muted: #6b6b6e;
	--cds-border: #e5e5e7;
	--cds-bg: #ffffff;
	--cds-bg-alt: #f7f7f8;
	--cds-radius: 12px;
	--cds-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   Reset for our scoped components
   ============================================================ */
.cds-cars-grid,
.cds-loan-calc,
.cds-compare,
.cds-promo-banner,
.cds-testimonials,
.cds-form-wrap,
.cds-chatbot,
.cds-floating-wa { box-sizing: border-box; }

.cds-cars-grid *,
.cds-loan-calc *,
.cds-compare *,
.cds-promo-banner *,
.cds-testimonials *,
.cds-form-wrap *,
.cds-chatbot *,
.cds-floating-wa * { box-sizing: border-box; }

/* ============================================================
   Buttons
   ============================================================ */
.cds-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.02em;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
	font-family: inherit;
}
.cds-btn-primary {
	background: var(--cds-gold);
	color: #fff;
}
.cds-btn-primary:hover {
	background: var(--cds-gold-dark);
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(212, 165, 72, 0.3);
}
.cds-btn-wa {
	background: #25d366;
	color: #fff;
}
.cds-btn-wa:hover {
	background: #1eb854;
	transform: translateY(-1px);
}

/* ============================================================
   Car Models Grid
   ============================================================ */
.cds-cars-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}
.cds-car-card {
	display: block;
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: var(--cds-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s, box-shadow 0.2s;
}
.cds-car-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--cds-shadow);
}
.cds-car-image {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--cds-bg-alt);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.cds-car-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 20px;
}
.cds-car-body { padding: 18px 20px; }
.cds-car-brand {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--cds-gold);
	margin-bottom: 4px;
}
.cds-car-name {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--cds-text);
}
.cds-car-tagline {
	font-size: 12px;
	color: var(--cds-muted);
	margin-bottom: 14px;
}
.cds-car-meta {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	padding-top: 14px;
	border-top: 1px solid var(--cds-border);
}
.cds-car-price-label {
	font-size: 10px;
	color: var(--cds-muted);
	letter-spacing: 0.08em;
	margin-bottom: 2px;
}
.cds-car-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--cds-text);
}
.cds-car-monthly {
	font-size: 13px;
	color: var(--cds-gold);
	font-weight: 600;
}

/* ============================================================
   Stock Badges
   ============================================================ */
.cds-stock-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 100px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	backdrop-filter: blur(4px);
	z-index: 2;
}
.cds-stock-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #888;
}
.cds-stock-available .cds-stock-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); animation: cds-pulse 2s infinite; }
.cds-stock-limited   .cds-stock-dot { background: #f59e0b; }
.cds-stock-preorder  .cds-stock-dot { background: #3b82f6; }
.cds-stock-sold-out  { color: #b91c1c; }
.cds-stock-sold-out .cds-stock-dot { background: #b91c1c; }

@keyframes cds-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
	50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ============================================================
   Forms (lead, trade-in)
   ============================================================ */
.cds-form-wrap {
	max-width: 640px;
	margin: 24px 0;
	padding: 28px;
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: var(--cds-radius);
}
.cds-form-title {
	margin: 0 0 18px;
	font-size: 22px;
	font-weight: 700;
}
.cds-form-section {
	margin: 22px 0 12px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--cds-gold);
	padding-top: 16px;
	border-top: 1px solid var(--cds-border);
}
.cds-field { margin-bottom: 14px; }
.cds-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--cds-text);
	margin-bottom: 6px;
	letter-spacing: 0.02em;
}
.cds-field input,
.cds-field select,
.cds-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--cds-border);
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	background: var(--cds-bg);
	color: var(--cds-text);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.cds-field input:focus,
.cds-field select:focus,
.cds-field textarea:focus {
	outline: none;
	border-color: var(--cds-gold);
	box-shadow: 0 0 0 3px rgba(212, 165, 72, 0.15);
}
.cds-field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 14px;
}
.cds-field-row .cds-field { margin-bottom: 0; }
.cds-pdpa-notice {
	font-size: 11px;
	color: var(--cds-muted);
	line-height: 1.5;
	margin: 14px 0;
}
.cds-form-status {
	margin-top: 14px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
}
.cds-form-status.ok    { background: #d4f4dd; color: #0a6b1f; }
.cds-form-status.error { background: #fee; color: #b32d2e; }

/* ============================================================
   Loan Calculator
   ============================================================ */
.cds-loan-calc {
	max-width: 720px;
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: var(--cds-radius);
	padding: 28px;
	margin: 24px 0;
}
.cds-loan-result {
	margin-top: 24px;
	padding: 24px;
	background: linear-gradient(135deg, var(--cds-dark) 0%, #1a1a20 100%);
	border-radius: var(--cds-radius);
	color: #fff;
	text-align: center;
}
.cds-loan-result-label {
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cds-gold);
	margin-bottom: 8px;
}
.cds-loan-result-value {
	font-size: 44px;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 8px;
	color: #fff;
}
.cds-loan-result-detail {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 16px;
}
.cds-loan-result .cds-btn { width: 100%; max-width: 280px; }

/* ============================================================
   Comparison
   ============================================================ */
.cds-compare { margin: 24px 0; }
.cds-compare-head { text-align: center; margin-bottom: 20px; }
.cds-compare-head h3 { font-size: 26px; margin: 0 0 6px; }
.cds-compare-head p { color: var(--cds-muted); margin: 0; }

.cds-compare-pickers {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}
@media (max-width: 700px) { .cds-compare-pickers { grid-template-columns: 1fr; } }
.cds-compare-select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--cds-border);
	border-radius: 8px;
	font-size: 14px;
	background: var(--cds-bg);
}

.cds-compare-table {
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: var(--cds-radius);
	overflow-x: auto;
}
.cds-compare-table table {
	width: 100%;
	border-collapse: collapse;
}
.cds-compare-table th,
.cds-compare-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--cds-border);
	font-size: 13px;
}
.cds-compare-table th {
	background: var(--cds-bg-alt);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cds-muted);
}
.cds-compare-table tr.cds-row-header td { font-weight: 700; padding-top: 18px; }
.cds-compare-img {
	width: 100%;
	max-width: 180px;
	height: 100px;
	object-fit: contain;
	background: var(--cds-bg-alt);
	border-radius: 8px;
	padding: 8px;
}

/* ============================================================
   Promotion Banner
   ============================================================ */
.cds-promo-banner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 18px;
	margin: 24px 0;
}
.cds-promo-card {
	display: block;
	padding: 24px;
	background: linear-gradient(135deg, var(--cds-dark) 0%, #1a1a20 100%);
	border: 1px solid rgba(212, 165, 72, 0.3);
	border-radius: var(--cds-radius);
	color: #fff;
	text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s;
}
.cds-promo-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(212, 165, 72, 0.2);
}
.cds-promo-amount {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--cds-gold);
	margin-bottom: 10px;
}
.cds-promo-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #fff;
	line-height: 1.3;
}
.cds-promo-end {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 14px;
}
.cds-promo-cta {
	font-size: 13px;
	font-weight: 700;
	color: var(--cds-gold);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* ============================================================
   Testimonials
   ============================================================ */
.cds-testimonials {
	display: grid;
	gap: 20px;
	margin: 24px 0;
}
.cds-testi {
	padding: 24px;
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: var(--cds-radius);
}
.cds-testi-stars { margin-bottom: 12px; }
.cds-testi-stars span { color: #d8d8d8; font-size: 16px; }
.cds-testi-stars span.on { color: var(--cds-gold); }
.cds-testi-quote {
	font-size: 14px;
	line-height: 1.6;
	color: var(--cds-text);
	margin-bottom: 16px;
}
.cds-testi-meta {
	display: flex;
	gap: 12px;
	align-items: center;
	padding-top: 16px;
	border-top: 1px solid var(--cds-border);
}
.cds-testi-photo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--cds-bg-alt);
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cds-testi-photo img { width: 100%; height: 100%; object-fit: cover; }
.cds-testi-initial {
	background: var(--cds-gold);
	color: #fff;
	font-weight: 700;
	font-size: 18px;
}
.cds-testi-name { font-weight: 700; font-size: 14px; }
.cds-testi-role { font-size: 12px; color: var(--cds-muted); }
.cds-testi-model { font-size: 11px; color: var(--cds-gold); margin-top: 2px; }

/* ============================================================
   Floating WhatsApp Button
   ============================================================ */
.cds-floating-wa {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 60px;
	height: 60px;
	background: #25d366;
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
	z-index: 9998;
	text-decoration: none;
	transition: transform 0.2s;
}
.cds-floating-wa:hover { transform: scale(1.08); }
.cds-floating-wa-pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #25d366;
	animation: cds-wa-pulse 2.4s infinite;
	z-index: -1;
}
@keyframes cds-wa-pulse {
	0%   { transform: scale(1);   opacity: 0.6; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   Chatbot
   ============================================================ */
.cds-chatbot {
	position: fixed;
	bottom: 100px;
	right: 24px;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.cds-chatbot-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px 12px 14px;
	background: var(--cds-dark);
	color: #fff;
	border: 1px solid rgba(212, 165, 72, 0.4);
	border-radius: 100px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	transition: transform 0.2s;
}
.cds-chatbot-launcher:hover { transform: translateY(-2px); }
.cds-chatbot-bubble {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: var(--cds-gold);
	border-radius: 50%;
	color: #fff;
}

.cds-chatbot.is-open .cds-chatbot-launcher { display: none; }

.cds-chatbot-window {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 140px);
	background: var(--cds-bg);
	border: 1px solid var(--cds-border);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.cds-chatbot-window[hidden] { display: none; }

.cds-chatbot-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--cds-dark);
	color: #fff;
	flex-shrink: 0;
}
.cds-chatbot-avatar {
	width: 36px;
	height: 36px;
	background: var(--cds-gold);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
}
.cds-chatbot-title { font-size: 14px; font-weight: 700; }
.cds-chatbot-status {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	gap: 4px;
}
.cds-chatbot-dot {
	width: 7px; height: 7px;
	background: #22c55e;
	border-radius: 50%;
	display: inline-block;
}
.cds-chatbot-close {
	margin-left: auto;
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	transition: background 0.15s;
}
.cds-chatbot-close:hover { background: rgba(255, 255, 255, 0.1); }

.cds-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafafb;
}
.cds-chat-msg {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.5;
	animation: cds-fade-in 0.25s;
}
.cds-chat-msg.bot {
	background: #fff;
	border: 1px solid var(--cds-border);
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}
.cds-chat-msg.user {
	background: var(--cds-gold);
	color: #fff;
	border-bottom-right-radius: 4px;
	align-self: flex-end;
}
.cds-chat-msg.typing { color: var(--cds-muted); font-style: italic; }
@keyframes cds-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

.cds-chatbot-quickreplies {
	padding: 0 16px 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	background: #fafafb;
}
.cds-chatbot-quickreply {
	background: #fff;
	border: 1px solid var(--cds-gold);
	color: var(--cds-gold);
	padding: 6px 12px;
	border-radius: 100px;
	font-size: 12px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, color 0.15s;
}
.cds-chatbot-quickreply:hover { background: var(--cds-gold); color: #fff; }

.cds-chatbot-input-form {
	display: flex;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--cds-border);
	background: #fff;
	flex-shrink: 0;
}
.cds-chatbot-input-form input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--cds-border);
	border-radius: 100px;
	font-size: 13px;
	font-family: inherit;
}
.cds-chatbot-input-form input:focus {
	outline: none;
	border-color: var(--cds-gold);
}
.cds-chatbot-input-form button {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--cds-gold);
	color: #fff;
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}
.cds-chatbot-input-form button:hover { background: var(--cds-gold-dark); }

/* Mobile adjustments */
@media (max-width: 480px) {
	.cds-chatbot { bottom: 90px; right: 12px; }
	.cds-chatbot-window {
		width: calc(100vw - 24px);
		height: calc(100vh - 130px);
		bottom: 0;
	}
	.cds-floating-wa { bottom: 16px; right: 16px; width: 54px; height: 54px; }
}
