/* Kereta Kawan — Site 1 (lite) public site styles */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --navy: #0A1F44;
  --blue: #1652F0;
  --orange: #FF7A1A;
  --orange-ink: #7A2E00; /* darkened for AA text-on-orange */
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --ink: #0E1726;
  --muted: #5B6780;
  --green: #12A150;
  --red: #E5484D;
  --border: #E3E8F2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.06), 0 1px 1px rgba(10, 31, 68, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 31, 68, 0.10);
  --shadow-lg: 0 20px 48px rgba(10, 31, 68, 0.16);
  --container: 1200px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --header-h: 72px;
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  color: var(--navy);
}
h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: clamp(20px, 2.4vw, 24px); }
p { margin: 0 0 var(--space-4); color: var(--muted); }
a { color: var(--blue); }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
section { padding: var(--space-9) 0; }
.section-head { max-width: 680px; margin: 0 0 var(--space-7); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: var(--space-2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 13px 24px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease;
  line-height: 1.2;
}
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.btn-primary { background: var(--orange); color: var(--navy); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--navy); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--navy); padding: 10px 14px; }
.btn-whatsapp { background: #25D366; color: #06210f; }
.btn-whatsapp:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(246, 248, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); flex-shrink: 0; }
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.main-nav { display: flex; align-items: center; gap: var(--space-6); }
.main-nav a { color: var(--navy); text-decoration: none; font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: var(--space-4); }
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }

.mobile-drawer {
  position: fixed; inset: 0; z-index: 90;
  display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer .drawer-backdrop { position: absolute; inset: 0; background: rgba(10,31,68,0.45); }
.mobile-drawer .drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: #fff; box-shadow: var(--shadow-lg);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2);
  transform: translateX(0);
}
.mobile-drawer .drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.mobile-drawer nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-drawer nav a { padding: 14px 6px; text-decoration: none; color: var(--navy); font-weight: 600; font-size: 17px; border-bottom: 1px solid var(--border); }
.mobile-drawer .drawer-actions { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.close-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.close-btn svg { width: 18px; height: 18px; }

/* Hero */
.hero { background: #fff; padding-top: var(--space-8); padding-bottom: var(--space-8); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-7); align-items: center; }
.hero-content { max-width: 560px; }
.hero-sub { font-size: 18px; max-width: 480px; }
.hero-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 3; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Form controls (shared) */
input, select, textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
label { font-weight: 600; font-size: 14px; color: var(--navy); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field-error { color: var(--red); font-size: 13px; margin: 4px 0 0; display: none; }
.field-error.is-visible { display: block; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input { width: 18px; height: 18px; margin-top: 2px; }
.checkbox-field label { font-weight: 500; }

.stat-label { color: rgba(255,255,255,0.75); font-size: 14px; margin: 0; }

/* Stock grid & filters */
.stock-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: end; margin-bottom: var(--space-5); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-5); }
.filter-chip {
  border: 1.5px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.filter-chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; flex: 1; }
.filters-row select { width: auto; min-width: 140px; }
.result-count { color: var(--muted); font-size: 14px; margin: 0; white-space: nowrap; }

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}
.car-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform 200ms ease, box-shadow 200ms ease;
  display: flex; flex-direction: column;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.car-media { position: relative; aspect-ratio: 4 / 3; background: var(--navy); overflow: hidden; }
.car-media img { width: 100%; height: 100%; object-fit: cover; }
.car-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; color: #fff;
}
.car-badge--new { background: var(--blue); }
.car-badge--price-drop { background: var(--orange); color: var(--navy); }
.car-badge--reserved { background: var(--muted); }
.car-badge--sold { background: var(--ink); }
.car-media.is-sold img { filter: grayscale(1); opacity: 0.6; }
.car-body { padding: var(--space-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.car-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy); margin: 0; }
.car-meta { color: var(--muted); font-size: 13px; margin: 0; }
.car-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.car-price { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--navy); }
.car-price-old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.car-monthly { color: var(--muted); font-size: 12px; margin: 0; }
.car-card-link { text-decoration: none; color: inherit; }

.empty-state { text-align: center; padding: var(--space-8) var(--space-4); color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; margin-bottom: var(--space-3); color: var(--border); }

/* Loan calculator (small panel, reused on car.html) */
.range-row { display: flex; align-items: center; gap: var(--space-3); }
.range-row input[type="range"] { width: 100%; accent-color: var(--orange); }
.range-value { font-weight: 700; color: var(--navy); min-width: 48px; text-align: right; }
.tenure-group { display: flex; gap: 8px; }
.tenure-btn { flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; }
.tenure-btn.is-active { border-color: var(--blue); background: rgba(22,82,240,0.08); color: var(--blue); }
.loan-result { background: var(--navy); border-radius: var(--radius); padding: var(--space-6); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.loan-result .big { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 4vw, 46px); color: var(--orange); margin: 8px 0; }
.loan-result-row { display: flex; justify-content: space-between; font-size: 14px; color: rgba(255,255,255,0.8); padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.15); }
.loan-disclaimer { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: var(--space-4); }

/* KK Promise */
.promise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.promise-card { background: #fff; border-radius: var(--radius); padding: var(--space-5); border: 1px solid var(--border); text-align: center; }
.promise-icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,122,26,0.12); color: var(--orange); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-3); }
.promise-icon svg { width: 28px; height: 28px; }

/* Sell strip (inside the KK Promise section) */
.sell-strip {
  margin-top: 32px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-5) var(--space-6); display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
}
.sell-strip h3 { margin-bottom: 4px; }
.sell-strip p { margin: 0; }

/* FAQ */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question { width: 100%; text-align: left; background: none; border: none; padding: var(--space-4) 4px; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 16px; color: var(--navy); }
.faq-question svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform 200ms ease; color: var(--muted); }
.faq-question[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 250ms ease; }
.faq-answer p { padding: 0 4px var(--space-4); margin: 0; }

/* Visit us */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: stretch; }
.visit-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 340px; }
.visit-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; }
.visit-info { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: var(--space-6); }
.visit-info dl { margin: 0; }
.visit-info dt { font-weight: 700; color: var(--navy); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: var(--space-4); }
.visit-info dd { margin: 4px 0 0; color: var(--muted); }
.visit-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.75); padding: var(--space-8) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-6); margin-bottom: var(--space-6); }
.footer-grid h4 { color: #fff; font-size: 14px; }
.footer-grid a { color: rgba(255,255,255,0.75); text-decoration: none; display: block; padding: 4px 0; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-3); }
.footer-brand .brand-word { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: var(--space-5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); font-size: 13px; }

/* Floating WhatsApp + mobile sticky bar */
.fab-whatsapp {
  position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 50;
  width: 58px; height: 58px; border-radius: 999px; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); text-decoration: none;
}
.fab-whatsapp svg { width: 28px; height: 28px; }
.mobile-sticky-bar { display: none; }

/* Toasts */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(90vw, 380px); }
.toast {
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); transition: opacity 200ms ease, transform 200ms ease;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green); }
.toast--error { background: var(--red); }

/* Demo note */
.demo-note { font-size: 12px; color: var(--muted); background: rgba(22,82,240,0.06); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: var(--space-5); }

/* Utility */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 10px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); z-index: 200; text-decoration: none; transition: top 150ms ease;
}
.skip-link:focus { top: 10px; }

/* Responsive */
@media (max-width: 1024px) {
  .promise-grid { grid-template-columns: repeat(2, 1fr); }
  .visit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
  .sell-strip { flex-direction: column; align-items: stretch; text-align: center; }
  section { padding: var(--space-8) 0; }
}
@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
  .promise-grid { grid-template-columns: 1fr; }
  .fab-whatsapp { bottom: 84px; right: var(--space-4); }
  /* The header can't fit logo + WhatsApp button + menu toggle at this width;
     WhatsApp stays reachable via the mobile drawer, the sticky bottom bar and the
     floating WhatsApp button, so drop it from the header itself. */
  .site-header .container { gap: var(--space-3); }
  #header-wa-link { display: none; }
  .mobile-sticky-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(10,31,68,0.08);
    padding: 10px var(--space-3); gap: 8px;
  }
  .mobile-sticky-bar a, .mobile-sticky-bar button { flex: 1; font-size: 13px; padding: 11px 8px; }
  body { padding-bottom: 74px; }
}

/* Photo band under the KK Promise */
.photo-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.photo-band figure { margin: 0; border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: 0 6px 20px rgba(10,31,68,0.08); }
.photo-band img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.photo-band figcaption { padding: 12px 16px; font-weight: 600; color: var(--navy); }
@media (max-width: 760px) { .photo-band { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .car-card { transition: none; }
  .car-card:hover { transform: none; }
}
