/* Teguri Autoaed — light, calm, modern */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-soft: #f4efe6;
  --border: #e8e2d4;
  --text: #1f2430;
  --text-muted: #6b6f7a;
  --accent: #b45309;        /* warm amber */
  --accent-hover: #92400e;
  --accent-soft: #fef3c7;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(31, 36, 48, 0.04), 0 1px 1px rgba(31, 36, 48, 0.04);
  --shadow-md: 0 4px 16px rgba(31, 36, 48, 0.06), 0 2px 4px rgba(31, 36, 48, 0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3, h4 { color: var(--text); margin: 0 0 0.6em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

p { margin: 0 0 1em; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.site-main { flex: 1; }

/* ---- Header ---- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.92);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.brand--footer { font-size: 1.05rem; }

.nav {
  display: flex;
  gap: 24px;
  margin-left: 24px;
  flex: 1;
}
.nav a {
  color: var(--text);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--accent); }
.nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
}
.lang-switch a.is-active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* ---- Hero ---- */

.hero {
  background: linear-gradient(180deg, var(--surface-soft), var(--bg));
  padding: 64px 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.4em;
}
.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Sections ---- */

.section { padding: 56px 0; }
.section--narrow { max-width: 760px; margin: 0 auto; }
.section__title { font-size: 1.6rem; margin-bottom: 32px; }
.section__subtitle { font-size: 1.25rem; margin: 32px 0 16px; }

.lead { font-size: 1.125rem; color: var(--text-muted); }

.divider { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); }

/* ---- Car cards ---- */

.grid { display: grid; gap: 24px; }
.grid--cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.car-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--text);
}
.car-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.car-card.is-sold { opacity: 0.7; }
.car-card__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  position: relative;
  overflow: hidden;
}
.car-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.car-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.car-card__placeholder--large {
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  border-radius: var(--radius);
}
.car-card__body { padding: 18px 18px 20px; }
.car-card__title {
  font-size: 1.05rem;
  margin-bottom: 6px;
  font-weight: 600;
}
.car-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.car-card__specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.car-card__specs li {
  background: var(--surface-soft);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--text);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge--sold { background: var(--danger); }
.badge--large { font-size: 0.85rem; padding: 6px 14px; }

/* ---- Car detail ---- */

.car-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 880px) {
  .car-detail { grid-template-columns: 1fr; }
}

.gallery__main {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery__thumb {
  flex: 0 0 80px;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: none;
  padding: 0;
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--accent); }

.car-detail__title {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.car-detail__price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
}

.specs {
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.specs > div { display: flex; flex-direction: column; gap: 2px; }
.specs dt { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
.specs dd { margin: 0; font-weight: 500; }

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-box h3 { margin-bottom: 4px; }
.contact-box--inline {
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 24px;
}

.car-description {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.car-description p { white-space: pre-wrap; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-soft); color: var(--text); }
.btn--small { padding: 6px 12px; font-size: 0.85rem; }

.link-button {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
}
.link-button:hover { color: var(--accent); }

/* ---- Forms ---- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form--narrow { max-width: 420px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; }
.field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.field--checkbox input { width: auto; }

.form-actions { display: flex; gap: 12px; margin-top: 8px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.alert--error {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ---- Admin ---- */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th { background: var(--surface-soft); font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-sold { opacity: 0.55; }
.admin-table__thumb { width: 70px; }
.admin-table__thumb img { width: 60px; height: 45px; object-fit: cover; border-radius: 6px; }
.admin-table__order {
  width: 60px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}
.admin-table__order form { margin: 0; }
.admin-table__order .link {
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.admin-table__order .link:hover:not([disabled]) { background: var(--surface-soft); }
.admin-table__order .link[disabled] { opacity: 0.3; cursor: default; }
.admin-table__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.admin-table__actions form { display: inline; margin: 0; }

.link {
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.link:hover { color: var(--accent-hover); }
.link--danger { color: var(--danger); }
.link--danger:hover { color: #7f1d1d; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.image-grid__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.image-grid__item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
}
.image-grid__item form { margin: 0; }

/* ---- Contact ---- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-card h3 { margin-bottom: 8px; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.contact-card p { margin: 0 0 4px; }

.map-wrap { margin-top: 16px; }

/* ---- Footer ---- */

.site-footer {
  margin-top: 64px;
  padding: 48px 0 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

@media (max-width: 720px) {
  .site-header__inner { flex-wrap: wrap; gap: 16px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 16px; flex-wrap: wrap; }
  .lang-switch { margin-left: auto; }
  .hero { padding: 40px 0 32px; }
  .section { padding: 40px 0; }
  .car-detail__sidebar { order: -1; }
}
