/*
Theme Name: The Auto Dealer
Theme URI: https://theautodealer.com
Author: The Auto Dealer
Description: Dedicated custom theme for The Auto Dealer. Presentation only — inventory, vehicle fields, gallery, lead forms, and dealer settings are provided by the TAD plugins.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: theautodealer
*/

:root {
  --blue: #4f78a8;
  --blue-dark: #324b6b;
  --blue-soft: #dfe7f0;
  --gray-900: #1f2937;
  --gray-700: #4b5563;
  --gray-600: #6b7280;
  --gray-500: #8b96a7;
  --gray-300: #d8dee6;
  --gray-200: #e9edf2;
  --gray-100: #f4f6f8;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--gray-900);
  background: var(--gray-100);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.top-bar {
  background: var(--gray-700);
  color: var(--white);
  font-size: 13px;
}
.top-bar-inner {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.top-bar-inner span {
  line-height: 1.4;
}

.site-nav {
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.nav-inner {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px 24px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  font-weight: 900;
  letter-spacing: -1px;
  flex-shrink: 0;
  overflow: hidden;
}
/* Brand logo: no box — just the logo image. The .site-nav prefix beats the
   compact-header sizing. */
.site-nav .brand-mark:has(img) {
  width: auto;
  min-width: 0;
  height: 64px;
  padding: 0;
  background: none;
  border-radius: 0;
}
.site-nav .brand-mark:has(img) img {
  width: auto;
  height: 64px;
  max-width: 360px;
  object-fit: contain;
  padding: 0;
}
.brand strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
  color: var(--gray-900);
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.nav-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-700);
}
.nav-links a {
  padding: 6px 0;
}
.nav-links a:hover {
  color: var(--blue-dark);
}
.nav-call {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 900;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero {
  min-height: 520px;
  display: flex;
  align-items: center;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(31,41,55,0.90), rgba(50,75,107,0.72), rgba(107,114,128,0.25)),
    url("https://images.unsplash.com/photo-1562141961-14d1d7dcaf02?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.hero-content { padding: 70px 0; }
.kicker {
  display: inline-flex;
  padding: 10px 14px;
  background: rgba(255,255,255,0.92);
  color: var(--gray-700);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.hero h1 {
  margin: 16px 0 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.06em;
  max-width: 760px;
}
.hero p {
  max-width: 660px;
  margin: 20px 0 0;
  font-size: 19px;
  line-height: 1.7;
  color: rgba(255,255,255,0.86);
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 900;
  border: 2px solid transparent;
  transition: 0.2s ease;
  text-align: center;
  cursor: pointer;
}
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-dark { background: var(--gray-900); color: var(--white); }
.btn-light { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-300); }
.btn-white { background: var(--white); color: var(--gray-700); }
.btn-outline-white { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.78); }

.strip {
  background: linear-gradient(90deg, var(--gray-700), var(--blue-dark));
  color: var(--white);
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.strip-grid div {
  padding: 24px;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.strip-grid strong {
  display: block;
  font-size: 18px;
}
.strip-grid span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,0.78);
  font-size: 14px;
}

.section {
  padding: 76px 0;
}
.section.white { background: var(--white); }
.section.gray { background: var(--gray-100); }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  margin-bottom: 28px;
}
.section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--gray-600);
  line-height: 1.7;
}
.section-head .eyebrow,
.detail-top .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card-link { display: block; }
.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-5px); }
.card-photo {
  position: relative;
}
.card-photo img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.badge, .click-badge {
  position: absolute;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
}
.badge {
  top: 14px;
  left: 14px;
  background: var(--blue-dark);
}
.click-badge {
  right: 14px;
  bottom: 14px;
  background: rgba(31,41,55,0.90);
}
.card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}
.card-top h3 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.15;
}
.status-pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.price {
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}
.specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 18px 0;
}
.specs span {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-700);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tags span {
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--gray-700);
  background: var(--white);
}
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.detail-page {
  padding: 34px 0 70px;
}
.breadcrumbs {
  margin-bottom: 18px;
  color: var(--gray-600);
  font-size: 14px;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 380px;
  gap: 28px;
  align-items: start;
}
.gallery-box,
.sidebar-box,
.info-box,
.description-box {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gallery-box { padding: 18px; }
.main-image {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}
.main-image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: 14px;
}
.image-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(31,41,55,0.90);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
}
.thumb-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.thumb {
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.thumb.active,
.thumb:hover {
  border-color: var(--blue);
}
.thumb img {
  width: 100%;
  height: 78px;
  object-fit: cover;
}
.thumb span {
  display: block;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-700);
  text-align: center;
  background: var(--gray-100);
}

.sidebar-box { padding: 22px; }
.sidebar-box h1 {
  margin: 10px 0 0;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.detail-price {
  margin: 14px 0 12px;
  color: var(--blue-dark);
  font-size: 40px;
  font-weight: 900;
}
.detail-summary {
  margin: 0 0 18px;
  color: var(--gray-600);
  line-height: 1.7;
}
.side-spec-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.side-spec {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--gray-100);
}
.side-spec strong {
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.side-spec span {
  color: var(--gray-900);
  font-weight: 900;
  text-align: right;
}
.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.sidebar-title {
  margin: 22px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 18px;
}
.enquiry-form {
  display: grid;
  gap: 10px;
}
.enquiry-form input,
.enquiry-form textarea,
.enquiry-form select {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 12px 13px;
  min-height: 46px;
  font: inherit;
  outline: none;
}
.enquiry-form textarea {
  min-height: 110px;
  resize: vertical;
}
.enquiry-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--gray-600);
}

.detail-lower {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.info-box,
.description-box {
  padding: 26px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.info-item {
  background: var(--gray-100);
  border-radius: 12px;
  padding: 14px;
}
.info-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
}
.info-item span {
  color: var(--gray-900);
  font-weight: 900;
}
.description-box p {
  margin: 16px 0 0;
  color: var(--gray-600);
  line-height: 1.8;
}
.feature-list {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--gray-600);
  line-height: 1.9;
}
.feature-list strong { color: var(--gray-900); }

.services-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px;
  display: flex;
  flex-direction: column;
}
/* Push each service button to the bottom so all three line up. */
.service-card .btn {
  margin-top: auto;
  align-self: flex-start;
}
.service-card.featured {
  background: linear-gradient(135deg, var(--gray-700), var(--blue-dark));
  color: var(--white);
}
.service-card.featured h3,
.service-card.featured p {
  color: var(--white);
}
.service-number {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 900;
  margin-bottom: 18px;
}
.service-card.featured .service-number {
  background: rgba(255,255,255,0.96);
}
.service-card h3 {
  margin: 0;
  font-size: 30px;
}
.service-card p {
  margin: 16px 0 22px;
  color: var(--gray-600);
  line-height: 1.8;
}

.contact-panel {
  padding: 76px 0;
  background: linear-gradient(135deg, var(--gray-700), var(--blue-dark));
}
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  align-items: start;
}
.contact-copy,
.contact-copy h2,
.contact-copy .eyebrow {
  color: var(--white);
}
.contact-copy p {
  color: rgba(255,255,255,0.84);
  font-size: 18px;
  line-height: 1.8;
}
.contact-methods {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.contact-methods a,
.contact-methods span {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 15px;
  color: var(--white);
  font-weight: 900;
}
.lead-form {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 12px 13px;
  min-height: 46px;
  font: inherit;
}
.lead-form textarea { min-height: 120px; resize: vertical; }
.form-note { margin: 0; color: var(--gray-600); font-size: 12px; }

/* Branded login portal ([tad_login_portal]). */
.portal-section { display: flex; align-items: center; min-height: 70vh; }
.portal-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
}
.portal-logo { display: block; max-height: 60px; width: auto; margin: 0 auto 22px; }
.portal-title { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.02em; color: var(--gray-900); }
.tad-portal-msg { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-weight: 700; font-size: 14px; }
.tad-portal-msg--ok { background: #e6f4ea; color: #1e7a3c; border: 1px solid #b7e0c4; }
.tad-portal-msg--err { background: #fdecec; color: #b32d2e; border: 1px solid #f3c2c2; }
.portal-back { text-align: center; margin: 18px 0 0; }
.portal-back a { color: var(--gray-600); font-weight: 700; font-size: 14px; }
.portal-back a:hover { color: var(--blue-dark); }
.tad-portal { max-width: 420px; margin: 0 auto; }
.tad-portal form,
.tad-portal #loginform { display: grid; gap: 12px; }
.tad-portal label { font-weight: 800; color: var(--gray-700); display: block; }
.tad-portal input[type="text"],
.tad-portal input[type="password"] {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  box-sizing: border-box;
}
.tad-portal input[type="text"]:focus,
.tad-portal input[type="password"]:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(79,120,168,0.2);
}
.tad-portal #wp-submit,
.tad-portal .button-primary {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 900;
  cursor: pointer;
  width: 100%;
}
.tad-portal #wp-submit:hover { background: var(--blue-dark); }
.tad-portal .login-remember { font-weight: 600; color: var(--gray-700); }
.tad-portal .tad-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  background: #fff;
  color: var(--gray-900);
  text-decoration: none;
}
.tad-portal .tad-google-btn:hover { border-color: var(--blue); background: var(--gray-100); }
.tad-portal .tad-google-btn svg { width: 18px; height: 18px; }
.tad-portal .tad-or {
  text-align: center;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14px 0;
}
.tad-portal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tad-portal-lost { margin-top: 6px; }
.tad-portal-lost a { color: var(--blue-dark); font-weight: 700; }
.tad-portal-note { color: var(--gray-600); }

/* Honeypot anti-spam field — hidden from real users. */
.tad-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* Lead form success / error banners (from the lead-forms plugin). */
.tad-form-notice {
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 800;
  margin-bottom: 4px;
}
.tad-form-notice--ok {
  background: #e6f4ea;
  color: #1e7a3c;
  border: 1px solid #b7e0c4;
}
.tad-form-notice--err {
  background: #fdecec;
  color: #b32d2e;
  border: 1px solid #f3c2c2;
}

.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-300);
  padding: 26px 0;
}
.footer-nav {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-200);
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
}
.footer-links li { margin: 0; }
.footer-links a {
  color: var(--gray-700);
  font-weight: 800;
  font-size: 14px;
}
.footer-links a:hover { color: var(--blue-dark); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--gray-600);
  font-size: 14px;
}

/* Compact dealership-style header */
.top-bar {
  background: #4b5563;
  color: #ffffff;
  font-size: 13px;
}
.top-bar-inner {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.top-bar-inner span {
  line-height: 1.2;
}
.nav-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 17px;
}
.brand strong {
  font-size: 21px;
  line-height: 1.05;
}
.brand small {
  margin-top: 3px;
  font-size: 12px;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  flex: 1;
  padding: 0;
  font-size: 14px;
}
.nav-links a {
  padding: 8px 0;
  white-space: nowrap;
}
.nav-call {
  width: auto;
  min-width: auto;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1;
  background: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .inventory-grid,
  .services-grid,
  .contact-grid,
  .detail-layout,
  .info-grid {
    grid-template-columns: 1fr;
  }
  .thumb-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1050px) {
  .nav-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand call"
      "links links";
    min-height: auto;
    gap: 10px 16px;
    padding: 12px 0;
  }
  .brand {
    grid-area: brand;
  }
  .nav-call {
    grid-area: call;
    justify-self: end;
  }
  .nav-links {
    grid-area: links;
    justify-content: flex-start;
    gap: 18px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1200px); }
  .top-bar-inner,
  .section-head,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero { min-height: auto; }
  .strip-grid,
  .form-row,
  .card-actions,
  .specs {
    grid-template-columns: 1fr;
  }
  .strip-grid div {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.18);
  }
  .btn { width: 100%; }
  .card-top {
    display: grid;
    grid-template-columns: 1fr;
  }
  .price { white-space: normal; }
  .main-image img { height: 320px; }
  .thumb-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .top-bar-inner {
    gap: 6px;
    font-size: 12px;
  }
  .nav-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "call"
      "links";
  }
  .brand-mark {
    width: 42px;
    height: 42px;
  }
  .brand strong {
    font-size: 19px;
  }
  .nav-call {
    justify-self: start;
    width: auto;
    padding: 10px 14px;
  }
  .nav-links {
    justify-content: flex-start;
    gap: 14px;
    font-size: 13px;
  }
}
