/* ===================================================================
   Well-Car - feuille de styles principale
   =================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --bg-dark: #16181c;
  --bg-dark-2: #1e2126;
  --red: #d91b1b;
  --red-dark: #ad1414;
  --text: #1b1d21;
  --text-muted: #5c6169;
  --text-on-dark: #eef0f2;
  --text-on-dark-muted: #a7acb4;
  --border: #e4e6ea;
  --border-dark: #2c2f35;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 14px rgba(20, 22, 26, 0.07);
  --shadow-lg: 0 18px 46px rgba(15, 16, 20, 0.18);
  --header-h: 104px;
  --container-w: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--red);
  display: inline-block;
}

.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section-dark p { color: var(--text-on-dark-muted); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-dark { background: var(--bg-dark); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-danger { background: #b3261e; color: #fff; }
.btn-danger:hover { background: #8f1e18; }
.btn-icon { padding: 8px; line-height: 0; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(20, 22, 26, .97);
  border-bottom: 1px solid var(--border-dark);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.28rem; color: #fff; flex-shrink: 0; }
.brand .brand-logo { height: 88px; width: auto; display: block; }
.footer-brand .brand-logo { height: 88px; }
.brand .brand-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center; color: var(--red);
  font-weight: 800; font-size: 1.05rem; position: relative; overflow: hidden;
}
.brand .brand-mark::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--red); }
.brand-name { white-space: nowrap; }
.brand-name b { color: var(--red); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: .93rem;
  color: var(--text-on-dark-muted); transition: color .15s ease, background .15s ease;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.main-nav a.active { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--border-dark);
  background: var(--bg-dark-2); flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.nav-toggle span { width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

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

.hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(10,11,13,.55), rgba(10,11,13,.82)), var(--hero-img, none) center/cover no-repeat;
  background-color: #101114;
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 640px; }
.hero .eyebrow { color: #ff5a5a; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero p.lead { color: #d7d9dd; font-size: 1.1rem; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats { display: flex; gap: 34px; margin-top: 46px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 1.6rem; color: #fff; }
.hero-stat span { font-size: .82rem; color: #b7bac0; }

.page-hero {
  padding: 60px 0 44px;
  background: var(--bg-dark);
  color: #fff;
  border-bottom: 4px solid var(--red);
}
.page-hero h1 { color: #fff; margin-bottom: 10px; }
.page-hero p { color: var(--text-on-dark-muted); max-width: 620px; margin-bottom: 0; }
.breadcrumb { font-size: .82rem; color: #90959d; margin-bottom: 14px; }
.breadcrumb a:hover { color: #fff; }

/* ---------------------------------- Services / features ---------------------------------- */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

.feature-card {
  background: var(--bg-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
}
.feature-icon {
  width: 46px; height: 46px; border-radius: 10px; background: rgba(217,27,27,.14);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--red);
}
.feature-card h3 { color: #fff; margin-bottom: 8px; font-size: 1.05rem; }
.feature-card p { color: var(--text-on-dark-muted); font-size: .92rem; margin: 0; }

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

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select, .filters input[type="text"] {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: .88rem; min-width: 150px;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.car-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.car-card .car-media { position: relative; aspect-ratio: 4 / 3; background: #eef0f2; overflow: hidden; cursor: pointer; }
.car-card .car-media img { width: 100%; height: 100%; object-fit: cover; }
.car-card .car-media .media-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #9aa0a8; background: linear-gradient(135deg, #eef0f2, #e2e5e9); gap: 6px; font-size: .8rem; font-weight: 600;
}
.car-card .media-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  background: rgba(15,16,20,.55); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .15s ease; font-size: .9rem;
}
.car-card .car-media:hover .media-nav { opacity: 1; }
.media-nav.prev { left: 8px; }
.media-nav.next { right: 8px; }
.media-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.media-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55); }
.media-dots span.active { background: #fff; width: 14px; border-radius: 3px; }

.car-tag {
  display: inline-block; background: var(--red); color: #fff; font-size: .72rem;
  font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(217,27,27,.35);
}
/* Sur une carte, le tag est place a l'interieur de .car-media (voir catalog.js) afin de
   toujours rester ancre sur la photo, meme quand une barre admin s'affiche au-dessus. */
.car-media .car-tag { position: absolute; top: 12px; right: 12px; z-index: 3; }

.car-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.car-title { font-size: 1.08rem; font-weight: 700; margin: 0; }
.car-subtitle { font-size: .85rem; color: var(--text-muted); margin: -6px 0 2px; }

.car-specs { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .8rem; color: var(--text-muted); margin: 2px 0 4px; }
.car-specs span { display: inline-flex; align-items: center; gap: 5px; }
.car-specs svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .8; }

.car-price-row { margin-top: auto; display: flex; align-items: baseline; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.car-price { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.car-price.has-discount { color: var(--red); }
.car-price-old { font-size: .92rem; color: #9aa0a8; text-decoration: line-through; }

.car-card-foot { display: flex; gap: 8px; padding: 0 20px 18px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 44px; }
.pagination button {
  min-width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-weight: 600; color: var(--text-muted);
}
.pagination button.active { background: var(--bg-dark); color: #fff; border-color: var(--bg-dark); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* --- admin ordering handles on cards --- */
.car-card.admin-editing { border-color: var(--red); }
.admin-card-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  background: var(--bg-dark); color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.admin-card-bar .drag-handle { cursor: grab; opacity: .8; letter-spacing: 2px; }
.admin-card-bar .admin-card-actions { display: flex; gap: 6px; }
.admin-card-bar button {
  background: rgba(255,255,255,.12); border: none; color: #fff; border-radius: 5px; padding: 5px 8px; cursor: pointer; font-size: .72rem;
}
.admin-card-bar button:hover { background: rgba(255,255,255,.24); }
.car-card.dragging { opacity: .35; }
.car-card.drop-target { outline: 2px dashed var(--red); outline-offset: 4px; }

.admin-add-tile {
  border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; color: var(--text-muted); min-height: 260px; cursor: pointer; background: var(--bg-alt);
  transition: border-color .15s ease, color .15s ease;
}
.admin-add-tile:hover { border-color: var(--red); color: var(--red); }
.admin-add-tile .plus { font-size: 2.4rem; line-height: 1; }

/* ---------------------------------- Lightbox / detail modal ---------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,11,13,.72); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.detail-modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 1040px; width: 100%; max-height: 92vh; overflow: auto;
  display: grid; grid-template-columns: 1.3fr 1fr; box-shadow: var(--shadow-lg); position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(20,22,26,.6); color: #fff; border: none; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.detail-gallery-col { display: flex; flex-direction: column; background: #101114; }
.detail-gallery { position: relative; background: #101114; display: flex; align-items: center; justify-content: center; min-height: 320px; flex: 1; }
.detail-gallery img { width: 100%; height: 100%; object-fit: contain; max-height: 560px; }
.detail-gallery .gallery-placeholder { color: #7c828b; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; }
.detail-gallery .media-nav { opacity: 1; background: rgba(255,255,255,.14); width: 40px; height: 40px; }
.detail-gallery .media-nav:hover { background: rgba(255,255,255,.26); }
.detail-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; background: #0c0d0f; }
.detail-thumbs img { width: 58px; height: 44px; object-fit: cover; border-radius: 6px; opacity: .55; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.detail-thumbs img.active { opacity: 1; border-color: var(--red); }

.detail-info { padding: 32px 30px; display: flex; flex-direction: column; }
.detail-info h2 { margin-bottom: 2px; }
.detail-info .car-subtitle { margin-bottom: 14px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 20px; }
.detail-price-row .car-price { font-size: 1.8rem; }
.detail-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 22px; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-spec-item { font-size: .85rem; }
.detail-spec-item .label { display: block; color: #9aa0a8; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.detail-description { font-size: .93rem; color: var(--text-muted); white-space: pre-line; margin-bottom: 22px; }
.detail-cta { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .detail-modal { grid-template-columns: 1fr; }
}

/* ---------------------------------- Testimonials ---------------------------------- */

.stars { color: var(--red); letter-spacing: 2px; font-size: .95rem; }
.review-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; height: 100%;
}
.review-card .review-text { font-size: .93rem; color: var(--text); margin: 0; }
.review-meta { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--text-muted); }
.review-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.review-head { display: flex; align-items: center; gap: 10px; }

.rating-summary { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rating-big { font-size: 2.6rem; font-weight: 800; }

/* ---------------------------------- About page ---------------------------------- */

.about-portrait { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.founder-card { display: flex; gap: 20px; align-items: center; background: var(--bg-alt); border-radius: var(--radius); padding: 20px; margin-top: 26px; }
.founder-card img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.founder-card b { display: block; }
.founder-card span { font-size: .85rem; color: var(--text-muted); }

.value-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.value-list li { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: var(--text-muted); }
.value-list .check { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: rgba(217,27,27,.12); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; }

.bg-banner {
  position: relative; padding: 110px 0; color: #fff; text-align: center;
  background: linear-gradient(180deg, rgba(9,10,12,.72), rgba(9,10,12,.86)), var(--banner-img, none) center/cover no-repeat;
}
.bg-banner h2 { color: #fff; }
.bg-banner p { color: #d7d9dd; max-width: 560px; margin: 0 auto 26px; }

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

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 44px; }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.contact-line { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.contact-line .icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(217,27,27,.1); color: var(--red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-line b { display: block; font-size: .95rem; }
.contact-line span, .contact-line a { font-size: .9rem; color: var(--text-muted); }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-top: 20px; }
.map-frame iframe { width: 100%; height: 240px; border: 0; display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: .82rem; font-weight: 700; color: var(--text); }
.form-field input, .form-field select, .form-field textarea {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: .92rem; font-family: inherit; background: #fff; color: var(--text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.form-field textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: .78rem; color: #9aa0a8; }
.form-error { font-size: .82rem; color: #b3261e; }
.form-note { display: none; }
.field-error-text { color: #b3261e; font-size: .78rem; min-height: 16px; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 18px; }
.alert-success { background: #e7f6ec; color: #1c7a35; border: 1px solid #bfe6cb; }
.alert-error { background: #fbe9e7; color: #b3261e; border: 1px solid #f3c6c0; }

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

.site-footer { background: var(--bg-dark); color: var(--text-on-dark-muted); padding: 60px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { max-width: 280px; font-size: .88rem; }
.footer-col h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.footer-col a, .footer-col span { display: block; font-size: .88rem; margin-bottom: 10px; color: var(--text-on-dark-muted); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--border-dark); padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .78rem; }

/* ---------------------------------- Admin: bar, login, forms ---------------------------------- */

.admin-bar {
  position: fixed; bottom: 18px; right: 18px; z-index: 800; background: var(--bg-dark); color: #fff; border-radius: 999px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-lg); font-size: .82rem;
}
.admin-bar b { color: #6fe08a; }
.admin-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #6fe08a; display: inline-block; margin-right: 4px; }
.admin-bar button { border-radius: 999px; }

.simple-modal {
  display: block; position: relative; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  grid-template-columns: none; max-width: 420px; width: 100%; padding: 34px 30px; max-height: 88vh; overflow-y: auto;
}
.hidden-login-modal .detail-modal { display: block; grid-template-columns: none; max-width: 420px; padding: 34px 30px; max-height: 88vh; overflow-y: auto; }
.simple-modal h2 { margin-bottom: 6px; }
.simple-modal .lead { font-size: .88rem; margin-bottom: 22px; }
.simple-modal.wide { max-width: 760px; }
.simple-modal.x-wide { max-width: 980px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.image-uploader { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; }
.image-uploader input[type="file"] { display: block; margin-bottom: 12px; font-size: .85rem; }
.image-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.image-preview-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; background: #eee; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(20,22,26,.75); color: #fff; cursor: pointer; font-size: .7rem; line-height: 1;
}

.tag-select { display: flex; gap: 10px; }
.tag-option { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.tag-option input { display: none; }
.tag-option.checked { border-color: var(--red); color: var(--red); background: rgba(217,27,27,.06); }

table.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.admin-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
table.admin-table tr.unread { background: rgba(217,27,27,.04); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-pending { background: #fff2d9; color: #8a5a00; }
.badge-ok { background: #e3f5e8; color: #1c7a35; }

.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.admin-tabs button { padding: 12px 18px; border: none; background: none; cursor: pointer; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.admin-tabs button.active { color: var(--red); border-color: var(--red); }
.admin-panel-section { display: none; }
.admin-panel-section.active { display: block; }

.confirm-box p { margin-bottom: 24px; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg-dark); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .88rem; max-width: 320px; }
.toast.error { background: #b3261e; }
.toast.success { background: #1c7a35; }

/* ---------------------------------- Misc ---------------------------------- */

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 10px 16px; z-index: 2000; }
.skip-link:focus { left: 10px; top: 10px; }

::selection { background: rgba(217,27,27,.2); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.muted { color: var(--text-muted); }

/* ---------------------------------- Responsive ---------------------------------- */

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .car-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --header-h: 78px; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--bg-dark); flex-direction: column;
    align-items: stretch; padding: 18px; gap: 4px; transform: translateX(100%); transition: transform .22s ease;
    overflow-y: auto; z-index: 400;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { padding: 14px 16px; font-size: 1rem; border-bottom: 1px solid var(--border-dark); }
  .nav-toggle { display: flex; }
  .brand .brand-logo { height: 62px; }
  .hero { min-height: 560px; text-align: left; }
  .hero-stats { gap: 22px; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .car-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .admin-bar { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
  .rating-summary { justify-content: center; text-align: center; }
}
