:root {
  --navy: #0b2748;
  --navy-deep: #06182e;
  --navy-soft: #163a63;
  --apple: #c41e3a;
  --apple-soft: #e85a6b;
  --leaf: #2f8f4e;
  --ink: #152033;
  --muted: #5a6678;
  --line: rgba(11, 39, 72, 0.12);
  --paper: #f3f6fa;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(6, 24, 46, 0.12);
  --radius: 14px;
  --max: 1120px;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 30, 58, 0.08), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(47, 143, 78, 0.08), transparent 50%),
    linear-gradient(180deg, #eef3f9 0%, var(--paper) 35%, #e8eef6 100%);
  min-height: 100vh;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-soft); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--apple); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner,
.section-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
}

.brand img {
  width: min(260px, 58vw);
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .35rem 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-weight: 500;
  font-size: .95rem;
  color: var(--navy);
  text-decoration: none;
  position: relative;
  padding: .35rem 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--apple);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--navy);
}

.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--navy-deep);
  min-height: clamp(220px, 42vw, 460px);
}

.hero-slider .slides {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 220px;
  max-height: 520px;
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .9s ease;
}
.hero-slider .slide.is-active { opacity: 1; z-index: 1; }
.hero-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider .slider-nav {
  position: absolute;
  inset: auto 1rem 1rem auto;
  z-index: 2;
  display: flex;
  gap: .45rem;
}

.hero-slider .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  padding: 0;
}
.hero-slider .dot.is-active { background: #fff; }

.section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.section-kicker {
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--apple);
  font-weight: 600;
  margin: 0 0 .6rem;
}

.section h1,
.section h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  line-height: 1.15;
}

.section h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.about-copy {
  max-width: 68ch;
  font-size: 1.08rem;
  color: var(--ink);
}

.about-copy p { margin: 0 0 1.1rem; }
.about-copy p:last-child { margin-bottom: 0; }

.about-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--apple); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: rgba(11, 39, 72, 0.25);
  color: var(--navy);
}
.btn-ghost:hover { border-color: var(--apple); color: var(--apple); }

.page-hero {
  padding: 2.5rem 0 1rem;
}
.page-hero p {
  color: var(--muted);
  max-width: 50ch;
  margin: 0;
}

.filter-bar {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin: 1.5rem 0 1.75rem;
}
.filter-bar input {
  width: min(420px, 100%);
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  box-shadow: 0 8px 24px rgba(6, 24, 46, 0.04);
}
.filter-bar input:focus {
  outline: 2px solid rgba(196, 30, 58, 0.25);
  border-color: var(--apple-soft);
}

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.dealer-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem .9rem 1rem;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-height: 180px;
}
.dealer-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(196, 30, 58, 0.35);
  color: inherit;
}
.dealer-tile .logo-wrap {
  width: 100%;
  height: 96px;
  display: grid;
  place-items: center;
}
.dealer-tile img {
  max-height: 88px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.dealer-tile span {
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  color: var(--navy);
  line-height: 1.3;
}
.dealer-tile.is-hidden { display: none; }

.empty-filter {
  display: none;
  color: var(--muted);
  margin-top: 1rem;
}
.empty-filter.is-visible { display: block; }

.dealer-detail {
  display: grid;
  gap: 2rem;
}
@media (min-width: 860px) {
  .dealer-detail {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

.dealer-side {
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  position: sticky;
  top: 92px;
}
.dealer-side .logo-box {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin-bottom: 1rem;
  background:
    linear-gradient(180deg, rgba(243,246,250,.9), #fff);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 1rem;
}
.dealer-side img { max-height: 110px; width: auto; }
.dealer-side h1 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  margin: 0 0 .35rem;
  color: var(--navy);
}
.dealer-owners {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .98rem;
}
.meta-block { margin: 0 0 1rem; font-size: .95rem; }
.meta-block dt {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .2rem;
}
.meta-block dd { margin: 0 0 .85rem; line-height: 1.45; }
.meta-block dd.meta-address { white-space: pre-line; }
.meta-block a { word-break: break-word; }

.dealer-main h2 {
  font-family: var(--font-serif);
  color: var(--navy);
  font-size: 1.35rem;
  margin: 0 0 .75rem;
}
.dealer-main .panel {
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip-list li {
  background: rgba(11, 39, 72, 0.06);
  color: var(--navy);
  padding: .4rem .7rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
}
.show-list {
  margin: 0;
  padding-left: 1.1rem;
}
.show-list li { margin: .35rem 0; }

.contact-card {
  max-width: 520px;
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.contact-card h1 {
  font-family: var(--font-serif);
  color: var(--navy);
  margin: 0 0 1rem;
}
.contact-card address {
  font-style: normal;
  white-space: pre-line;
  margin-bottom: 1.25rem;
}
.contact-card a { font-weight: 600; }

.site-footer {
  margin-top: 2rem;
  background: linear-gradient(180deg, var(--navy-soft), var(--navy-deep));
  color: rgba(255,255,255,.88);
  padding: 2.5rem 0 2rem;
}
.footer-inner {
  display: grid;
  gap: 1.25rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.footer-brand img {
  width: 140px;
  filter: brightness(0) invert(1);
  opacity: .95;
}
.footer-brand p {
  margin: 0;
  font-weight: 600;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.25rem;
}
.footer-links a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy {
  margin: .5rem 0 0;
  font-size: .85rem;
  color: rgba(255,255,255,.65);
}

/* Admin */
.admin-body {
  background: #eef2f7;
}
.admin-wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 2rem auto;
}
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.admin-top h1 {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--navy);
  font-size: 1.8rem;
}
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(6,24,46,.06);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: .75rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-table img {
  width: 64px;
  height: 40px;
  object-fit: contain;
}
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-form label {
  display: block;
  font-weight: 600;
  margin: 0 0 .35rem;
  color: var(--navy);
}
.admin-form .field { margin-bottom: 1rem; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="url"],
.admin-form input[type="password"],
.admin-form textarea {
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.admin-form textarea { min-height: 110px; resize: vertical; }
.admin-form .grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .admin-form .grid-2 { grid-template-columns: 1fr 1fr; }
}
.flash {
  padding: .85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.flash-ok { background: #e8f7ee; color: #14532d; }
.flash-err { background: #fde8ea; color: #7f1d1d; }
.login-box {
  width: min(420px, calc(100% - 2rem));
  margin: 4rem auto;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + .35rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .75rem;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-header { position: relative; }
  .dealer-side { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
