/* ==========================================================================
   Khairul Anuar Used Car Merbok - Stylesheet
   Lokasi: Merbok, Kedah | 019-511 1502
   ========================================================================== */

:root {
  --primary: #1e3a8a;          /* Automotive Blue */
  --primary-hover: #172554;
  --primary-light: #eff6ff;
  --accent: #2563eb;           /* Royal Blue */
  --accent-glow: rgba(37, 99, 235, 0.2);
  --success: #10b981;          /* Emerald Green for Available */
  --success-bg: #ecfdf5;
  --warning: #f59e0b;          /* Amber for Reserved */
  --warning-bg: #fffbeb;
  --danger: #ef4444;           /* Red for Sold / Alerts */
  --danger-bg: #fef2f2;
  --whatsapp: #25d366;         /* WhatsApp Green */
  --whatsapp-hover: #128c7e;

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;        /* Slate 900 */
  --text-muted: #64748b;       /* Slate 500 */
  --text-light: #94a3b8;       /* Slate 400 */
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.25s ease;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.custom-map-icon, .custom-nav-icon {
  display: inline-block;
  vertical-align: middle;
  color: #60a5fa;
  flex-shrink: 0;
}

/* Top Bar */
.top-bar {
  background-color: #0b1329;
  color: #cbd5e1;
  font-size: 0.84rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-bar-contacts {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #e2e8f0;
  transition: color var(--transition-fast);
}

.top-link:hover {
  color: #60a5fa;
}

.top-link.whatsapp-top {
  color: #4ade80;
  font-weight: 600;
}
.top-link.whatsapp-top:hover {
  color: #86efac;
}

/* Main Header */
.header-main {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-dark {
  background-color: #0f172a;
  color: #ffffff;
}
.btn-dark:hover {
  background-color: #1e293b;
  transform: translateY(-1px);
}

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-outline-primary {
  border: 1px solid #bfdbfe;
  background-color: #eff6ff;
  color: var(--accent);
}
.btn-outline-primary:hover {
  background-color: #dbeafe;
  border-color: #93c5fd;
}

.btn-dealer-badge {
  background-color: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-dealer-badge:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 65%, #1e3a8a 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 1rem;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-title span {
  color: #ffffff;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

.hero-subtitle {
  color: #cbd5e1;
  line-height: 1.6;
}

/* Inventory Section */
.inventory-section {
  padding: 3rem 0 4.5rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.section-title-wrap h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-title-wrap p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Status Tabs (All, Available, Reserved, Sold) */
.status-tabs-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f1f5f9;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-width: 100%;
}

.status-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.status-tab:hover {
  color: var(--text-main);
}

.status-tab.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.status-badge-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background-color: #e2e8f0;
  color: #475569;
}

.status-tab.active .status-badge-count {
  background-color: #dbeafe;
  color: var(--accent);
}

/* Car Cards Grid */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .cars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Car Card */
.car-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

.car-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #0f172a;
}

.car-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover .car-image {
  transform: scale(1.04);
}

.media-badges-top {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.status-badge {
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.status-badge.available {
  background-color: #10b981;
  color: #ffffff;
}

.status-badge.reserved {
  background-color: #f59e0b;
  color: #ffffff;
}

.status-badge.sold {
  background-color: #64748b;
  color: #ffffff;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-featured {
  background: rgba(15, 23, 42, 0.75);
  color: #fef08a;
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Card Body */
.car-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.car-stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stock-num {
  font-weight: 700;
  color: #475569;
}

.car-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.65rem;
}

.car-title a:hover {
  color: var(--accent);
}

/* Spec Chips */
.car-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.65rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.spec-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #475569;
}

.spec-chip svg {
  color: #64748b;
  flex-shrink: 0;
}

/* Card Price Row */
.car-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.price-main {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

/* Card Actions */
.car-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  grid-column: 1 / -1;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: #94a3b8;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 1.5rem;
  font-size: 0.92rem;
}

/* Floating WhatsApp Button */
.floating-whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: var(--whatsapp);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
  z-index: 45;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

.floating-whatsapp-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0);
}

.modal-dialog.modal-xl {
  max-width: 900px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background-color: var(--bg-surface);
  z-index: 10;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.25rem;
  transition: background 0.15s, color 0.15s;
}

.modal-close-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Detail Modal Layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.gallery-main {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background-color: #0f172a;
  margin-bottom: 0.75rem;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.gallery-thumb {
  width: 76px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb.active, .gallery-thumb:hover {
  opacity: 1;
  border-color: var(--accent);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.86rem;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-color);
}

.specs-table th {
  text-align: left;
  padding: 0.5rem 0;
  color: var(--text-muted);
  font-weight: 500;
  width: 42%;
}

.specs-table td {
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

.features-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.feature-tag {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.feature-tag svg {
  color: var(--accent);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Admin Styles */
.admin-tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.admin-nav-item {
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.admin-nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.admin-table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.admin-car-thumb {
  width: 60px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  transform: translateX(100%);
  animation: slideIn 0.25s forwards, fadeOut 0.3s 3.5s forwards;
  pointer-events: auto;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* Footer */
.footer-main {
  background-color: #0b1329;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.88rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
}

.tab-label-mobile { display: none; }

/* Mobile Quick Action Sticky Bar */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    z-index: 40;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);
  }

  body {
    padding-bottom: 60px;
  }

  .floating-whatsapp-btn {
    bottom: 4.8rem;
  }
}

/* Compact phone catalogue: two columns, with four listings in the first view. */
@media (max-width: 639px) {
  .top-bar { padding: 0; }
  .container { width: 100%; padding-left: 12px; padding-right: 12px; }
  .top-bar-inner { min-height: 30px; padding-top: 4px; padding-bottom: 4px; gap: 8px; }
  .top-bar-inner::before { content: 'Merbok, Kedah · Buka setiap hari'; font-size: 10px; color: #cbd5e1; }
  .top-bar-contacts { display: none; }
  .btn-dealer-badge { font-size: 10px; padding: 4px 8px; white-space: nowrap; }
  .header-main { position: relative; top: auto; }
  .header-inner { min-height: 64px; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .brand-logo { gap: 10px; min-width: 0; }
  .brand-icon-wrap { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; }
  .brand-text { min-width: 0; }
  .brand-text h1 { font-size: 15px; line-height: 1.25; margin: 0; }
  .brand-text span { font-size: 10px; line-height: 1.4; }
  .header-actions, .hero-section { display: none; }
  .inventory-section { padding: 12px 0 28px; scroll-margin-top: 8px; }
  .section-head { gap: 10px; margin-bottom: 12px !important; align-items: stretch; }
  .section-title-wrap { width: 100%; }
  .section-title-wrap h2 { font-size: 19px; line-height: 1.25; }
  .section-title-wrap p { font-size: 11px; line-height: 1.4; margin-top: 3px; }
  .status-tabs-container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 2px; padding: 3px; overflow: visible; }
  .status-tab { justify-content: center; padding: 8px 2px; min-height: 40px; gap: 4px; font-size: 10px; }
  .tab-label-full, .status-tab > .status-indicator-dot { display: none; }
  .tab-label-mobile { display: inline; }
  .status-badge-count { padding: 1px 4px; font-size: 10px; }
  .cars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .car-card { min-width: 0; border-radius: 12px; box-shadow: 0 2px 6px #0f172a08; }
  .car-card:hover { transform: none; }
  .car-media { aspect-ratio: 2.2; flex-shrink: 0; }
  .media-badges-top { top: 6px; left: 6px; right: 6px; }
  .badge-featured { display: none; }
  .status-badge { font-size: 0; gap: 0; padding: 4px 7px; letter-spacing: 0; }
  .status-badge::after { content: attr(data-mobile-label); font-size: 10px; }
  .status-badge .status-indicator-dot { display: none; }
  .car-body { padding: 7px; }
  .car-stock-row { display: none; }
  .car-title { font-size: 12px; line-height: 1.4; height: 34px; margin-bottom: 6px; }
  .car-title a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .car-specs-grid { display: flex; flex-wrap: wrap; gap: 3px 7px; padding: 0; background: none; margin-bottom: 8px; }
  .spec-chip { font-size: 10px; gap: 3px; }
  .spec-chip svg { width: 11px; height: 11px; }
  .spec-chip:nth-child(n+2) { display: none; }
  .car-price-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-top: 8px; margin-bottom: 0; }
  .price-main { font-size: 18px; }
  .car-price-row > div > div:last-child:not(.price-main) { display: none; }
  .car-price-row > button { width: 100%; min-height: 34px; padding: 6px 5px; font-size: 11px; border-color: #dbeafe; background: #eff6ff; color: #1e40af; }
  .car-actions-grid, .floating-whatsapp-btn { display: none; }
  .mobile-bottom-bar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .mobile-bottom-bar .btn { min-height: 40px; font-size: 12px; padding: 8px; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .footer-main { padding: 24px 0; }
}

@media (max-width: 639px) and (max-height: 740px) {
  .section-title-wrap p { display: none; }
  .header-inner { min-height: 58px; padding-top: 7px; padding-bottom: 7px; }
}

@media (max-width: 639px) and (max-height: 700px) {
  .car-media { aspect-ratio: auto; height: 70px; }
  .car-specs-grid { display: none; }
}
