/* ── AutoBazar — moderní čistý design ──────────────────────────── */
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --blue-light: #eff6ff;
  --ink: #0f172a; --gray: #64748b; --line: #e2e8f0; --bg: #f8fafc;
  --green: #16a34a; --red: #dc2626; --amber: #d97706; --purple: #7c3aed;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 16px rgba(15,23,42,.06);
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Hlavička */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 8px 0; gap: 8px 16px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .site-header { position: static; }
  .header-inner { justify-content: center; }
  .logo { justify-content: center; }
  .logo-claim { display: none; }
  .main-nav { width: 100%; justify-content: center; gap: 2px 4px; }
  .main-nav a { padding: 7px 9px; font-size: .95rem; }
  .nav-phone { flex-basis: 100%; text-align: center; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .detail-grid, .car-detail { grid-template-columns: 1fr; }
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.logo-img { max-height: 48px; width: auto; display: block; }
.logo-claim { font-weight: 500; font-size: .95rem; color: var(--gray); border-left: 2px solid var(--line);
  padding-left: 12px; line-height: 1.2; max-width: 220px; }
.main-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.main-nav a { padding: 8px 14px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.main-nav a:hover { background: var(--blue-light); }
.main-nav a.active { background: var(--blue-light); color: var(--blue); }
.nav-phone { color: var(--blue) !important; font-weight: 700 !important; }

/* Hero */
.hero { background: linear-gradient(135deg, #1e3a8a, var(--blue)); color: #fff; padding: 72px 0; }
.hero.has-photo { padding: 0; display: flex; align-items: center; }
.hero.has-photo .container { flex: 1; padding-top: 48px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; margin-bottom: 12px; }
.hero p { font-size: 1.15rem; opacity: .9; max-width: 560px; margin-bottom: 28px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* Tlačítka */
.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: 1rem;
  border: none; cursor: pointer; transition: .15s; text-align: center; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover { background: var(--blue-light); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.92); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-outline:hover { background: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .875rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Sekce */
.section { padding: 56px 0; }
.section h2 { font-size: 1.7rem; margin-bottom: 24px; }
.section-sub { color: var(--gray); margin: -16px 0 28px; }

/* Výhody */
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.benefit { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.benefit .icon { font-size: 1.8rem; margin-bottom: 10px; }
.benefit h3 { margin-bottom: 6px; font-size: 1.05rem; }
.benefit p { color: var(--gray); font-size: .95rem; }

/* Karty aut */
.car-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.car-filter select, .car-filter input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; min-width: 120px; flex: 1; }
.car-filter input { max-width: 130px; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.car-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: .15s; display: flex; flex-direction: column; }
.car-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.car-card .photo { aspect-ratio: 4/3; background: var(--line); object-fit: cover; width: 100%; position: relative; }
.car-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.car-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.car-card h3 { font-size: 1.1rem; margin-bottom: 4px; color: var(--ink); }
.car-card .meta { color: var(--gray); font-size: .9rem; margin-bottom: 12px; }
.car-card .price { margin-top: auto; font-size: 1.25rem; font-weight: 800; color: var(--blue); }
.sold-ribbon { position: absolute; top: 14px; left: -34px; background: var(--red); color: #fff;
  padding: 5px 40px; font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }
.car-card.is-sold .photo img { filter: grayscale(.55) opacity(.85); }
.car-card.is-sold .photo::after { content: "PRODÁNO"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.4rem;
  letter-spacing: .1em; background: rgba(15,23,42,.28); z-index: 1; }
.photo-placeholder { display:flex; align-items:center; justify-content:center; height:100%; color:var(--gray); font-size:2.5rem; }

/* Detail auta */
.car-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 800px) { .car-detail { grid-template-columns: 1fr; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--line); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.gallery-thumbs img { aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--blue); }
.spec-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.spec-table td:first-child { color: var(--gray); width: 45%; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--blue); }

/* Formuláře */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; max-width: 720px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.field .hint { font-size: .82rem; color: var(--gray); margin-top: 3px; }
fieldset { border: none; padding: 0; margin: 0 0 24px; }
legend { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.checkbox-row input { margin-top: 4px; width: auto; flex: 0 0 auto; }
.checkbox-row label { margin-bottom: 0; }

/* Náhledy fotek ve formuláři */
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-previews .thumb { position: relative; }
.photo-previews img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-previews button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.65); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; padding: 1px 7px; font-size: .8rem; }

/* Zprávy */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--blue-light); color: var(--blue-dark); border: 1px solid #bfdbfe; }

/* Badge */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: #f1f5f9; color: var(--gray); }
.badge-amber { background: #fffbeb; color: var(--amber); }
.badge-purple { background: #f5f3ff; color: var(--purple); }
.badge-green { background: #f0fdf4; color: var(--green); }
.badge-red { background: #fef2f2; color: var(--red); }

/* Patička */
.site-footer { background: var(--ink); color: #cbd5e1; margin-top: 64px; padding: 40px 0 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #cbd5e1; }
.footer-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid #334155; font-size: .85rem; color: #94a3b8; }

/* ── Admin ─────────────────────────────────────────────────────── */
.admin-header { background: var(--ink); color: #fff; }
.admin-header .header-inner { min-height: 56px; }
.admin-header a { color: #e2e8f0; }
.admin-header .main-nav a:hover, .admin-header .main-nav a.active { background: #1e293b; color: #fff; }
.admin-header .logo { color: #fff; font-size: 1rem; }
.notif-dot { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); }
.data-table th { text-align: left; padding: 12px 16px; background: #f1f5f9; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .03em; color: var(--gray); }
.data-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: #fafcff; }

.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 20px 0; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.admin-photos img { aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; }
.notif-list { list-style: none; padding: 0; }
.notif-list li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.notif-list li.unread { border-left: 4px solid var(--blue); }
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }

/* Cookie lišta */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(15,23,42,.15); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 900px; margin: 0 auto; }
.cookie-text { font-size: .9rem; color: var(--ink); flex: 1; min-width: 240px; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 600px) { .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1; } }
