:root {
  /* --- Modern Palette --- */
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --muted: #64748b;
  --primary: #0f172a;
  --primary-light: #334155;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --blue-vibrant: #2563eb;
  --maxw: 1000px;

  /* Status Colors */
  --red: #ef4444;
  --green: #10b981;
  --whatsapp: #25d366;

  /* UI Elements */
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg);
  color: #1e293b;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}

/* --- Layout --- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* --- Emergency Bar --- */
.emergency-bar {
  background: var(--red);
  color: white;
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.2);
}
.emergency-bar a {
  color: white;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.8);
}

/* --- Header & Nav --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 40px;
  z-index: 900;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.nav {
  display: flex;
  gap: 24px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}
.nav a:hover {
  color: var(--primary);
}

/* --- Hero Section --- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 30px 0;
}
.hero-media {
  margin-bottom: 10px;
}
.hero-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 350px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.trust-badge {
  margin-top: 16px;
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.hero-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.hero-card h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  margin: 0;
  color: var(--primary);
}
.lead {
  margin: 18px 0;
  line-height: 1.7;
  color: var(--muted);
  font-size: 1.05rem;
}

/* --- Services & Links (FIXED ALIGNMENT) --- */
.services {
  display: grid;
  /* Auto-fit creates columns that fill the space, preventing left-alignment gaps */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
  justify-content: center; /* Ensures content is centered if items are few */
}

a.card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-vibrant);
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  height: 100%; /* Ensures cards match height */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  margin-top: 0;
  color: var(--primary);
  font-weight: 700;
}

.card::after {
  content: "→";
  position: absolute;
  bottom: 15px;
  right: 20px;
  color: var(--border);
  font-weight: bold;
  transition: color 0.3s ease, transform 0.3s ease;
}

a.card:hover .card::after {
  color: var(--blue-vibrant);
  transform: translateX(4px);
}

.info-section a {
  color: var(--blue-vibrant);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid rgba(37, 99, 235, 0.1);
  transition: border-color 0.2s;
}

.info-section a:hover {
  border-color: var(--blue-vibrant);
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.gallery-grid img {
  width: 100%;
  border-radius: var(--radius);
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.gallery-grid img:hover {
  transform: scale(1.02);
}

/* --- Testimonials --- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.test-card {
  background: var(--bg-soft);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.quote {
  font-style: italic;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}
.author {
  margin-top: 12px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.author::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
}

/* --- Mobile Action Bar --- */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  padding: 12px 16px 20px 16px;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 2000;
  border-top: 1px solid var(--border);
}
.mobile-action-bar a {
  flex: 1;
  text-align: center;
  padding: 14px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}
.mobile-action-bar a:active {
  transform: scale(0.96);
}
.btn-call {
  background: linear-gradient(135deg, #10b981, #059669);
}
.btn-wa {
  background: linear-gradient(135deg, #25d366, #128c7e);
}

/* --- Footer --- */
.footer {
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 40px 20px;
  background: var(--bg-soft);
}
.footer-brand {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--primary);
}

/* --- Inner Page Styling --- */
.page-header {
  padding: 60px 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  text-align: center;
}
.page-title {
  margin: 0;
  color: var(--primary);
  font-size: 2.5rem;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.content-block {
  margin-bottom: 50px;
  line-height: 1.8;
}
.content-block h2 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 0;
  border-left: none;
}
.content-block h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* --- FIXED BUTTON SIZING (Inspection/Engine Page) --- */
/* This specific selector targets buttons anywhere in content blocks */
.content-block button,
.content-block .btn,
.content-block a.button,
.content-block input[type="submit"],
button[type="submit"] {
  display: inline-flex !important; /* Force inline layout */
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px; /* Modern Pill Shape */
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  max-width: 100%;
  width: auto !important; /* Forces button to shrink to text size */
  min-width: 140px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 8px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-block button:hover,
.content-block .btn:hover,
.content-block input[type="submit"]:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.2);
}

/* --- Responsive & Desktop Overrides --- */
@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1fr 400px;
    align-items: center;
  }
  .hero-media {
    order: 2;
  }
  .hero-img {
    max-height: 400px;
  }

  /* Removed fixed 3-column grid here to let auto-fit handle it better */

  .mobile-action-bar {
    display: none;
  }
  .footer {
    padding-bottom: 40px;
  }
  body {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 600px) {
  .hero-card h1 {
    font-size: 1.6rem;
  }
  .nav {
    display: none;
  }
  .page-title {
    font-size: 1.8rem;
  }
  body {
    padding-bottom: 90px;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}
.attention-shake {
  animation: shake 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  animation-iteration-count: 2;
  border: 2px solid gold !important;
}

.small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
