/* ==========================================================================
   Půjčovna auta — veřejná část
   ========================================================================== */

:root {
  --ink:        #16191f;
  --ink-soft:   #5b6472;
  --line:       #e3e6ea;
  --bg:         #ffffff;
  --bg-soft:    #f5f6f8;
  --accent:     #1f6feb;
  --accent-ink: #ffffff;
  --ok:         #197f4b;
  --ok-bg:      #e7f6ee;
  --warn:       #9a6100;
  --warn-bg:    #fdf3e2;
  --err:        #b3261e;
  --err-bg:     #fdecea;
  --radius:     12px;
  --shadow:     0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --maxw:       1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

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

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --- Hlavička ------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); }
.brand span { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
.header-contact { display: flex; gap: 18px; align-items: center; font-size: .92rem; }
.header-contact a { text-decoration: none; white-space: nowrap; }
.header-city { color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 620px) { .header-contact .hide-sm { display: none; } }

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

.hero { padding: 44px 0 8px; }
.hero-grid { display: grid; gap: 28px; grid-template-columns: 1.15fr 1fr; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-photo {
  border-radius: var(--radius); overflow: hidden; background: var(--bg-soft);
  box-shadow: var(--shadow); aspect-ratio: 3 / 2;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo.is-empty {
  display: grid; place-items: center; color: var(--ink-soft); font-size: .9rem; text-align: center; padding: 20px;
}

.price-tag { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.price-tag strong { font-size: 2rem; letter-spacing: -.02em; }
.price-tag span { color: var(--ink-soft); }

.lead { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 20px; }

/* --- Tlačítka ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1a5fd0; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }

/* --- Galerie ------------------------------------------------------------- */

section { padding: 40px 0; }
section + section { border-top: 1px solid var(--line); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery button {
  padding: 0; border: 0; background: var(--bg-soft); border-radius: 10px; overflow: hidden;
  cursor: zoom-in; aspect-ratio: 4 / 3;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery button:hover img { transform: scale(1.04); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 16, .92);
  display: none; place-items: center; padding: 24px;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox .lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox button:hover { background: rgba(255, 255, 255, .24); }

/* --- Parametry ----------------------------------------------------------- */

.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 32px; margin: 0; }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--ink-soft); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }

/* --- Formulář ------------------------------------------------------------ */

.booking { background: var(--bg-soft); }
.booking-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .booking-grid { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field .hint { color: var(--ink-soft); font-size: .85rem; font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .15);
}
textarea { min-height: 96px; resize: vertical; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.field-error { color: var(--err); font-size: .85rem; margin-top: 5px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Souhrn ceny --------------------------------------------------------- */

.summary { position: sticky; top: 88px; }
.summary h3 { margin-bottom: 14px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .95rem; }
.summary-line.total {
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px;
  font-size: 1.25rem; font-weight: 700;
}
.summary-empty { color: var(--ink-soft); font-size: .95rem; }

/* --- Hlášky -------------------------------------------------------------- */

.alert { padding: 13px 16px; border-radius: 9px; margin-bottom: 18px; font-size: .95rem; }
.alert-error   { background: var(--err-bg);  color: var(--err); }
.alert-ok      { background: var(--ok-bg);   color: var(--ok); }
.alert-warn    { background: var(--warn-bg); color: var(--warn); }
.alert-info    { background: #e8f0fe;        color: #14449e; }
.alert:empty { display: none; }

/* --- Legenda kalendáře --------------------------------------------------- */

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }
.legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.legend .free  { background: #fff; border: 1px solid var(--line); }
.legend .taken { background: #efeff1; border: 1px solid #dcdde0; }
.legend .sel   { background: var(--accent); }

/* --- Flatpickr: obsazené dny mají být zjevně nedostupné ------------------ */

.flatpickr-calendar { box-shadow: var(--shadow); font-family: inherit; }
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  background: repeating-linear-gradient(-45deg, #f1f1f3, #f1f1f3 4px, #e6e6ea 4px, #e6e6ea 8px);
  color: #b3b7bf; text-decoration: line-through; cursor: not-allowed;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--accent); border-color: var(--accent);
}
.flatpickr-day.inRange { background: #e8f0fe; border-color: #e8f0fe; box-shadow: -5px 0 0 #e8f0fe, 5px 0 0 #e8f0fe; }
.calendar-inline { display: flex; justify-content: center; }
.calendar-inline .flatpickr-calendar { box-shadow: none; border: 1px solid var(--line); }

/* --- Terms / text blocks ------------------------------------------------- */

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.text-block { white-space: pre-line; }

/* --- Patička ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding: 32px 0; color: var(--ink-soft); font-size: .92rem; margin-top: 20px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }

/* --- Stavová stránka ----------------------------------------------------- */

.status-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
}
.status-pending   { background: var(--warn-bg); color: var(--warn); }
.status-confirmed { background: var(--ok-bg);   color: var(--ok); }
.status-rejected,
.status-cancelled { background: var(--err-bg);  color: var(--err); }

.detail-table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.detail-table th, .detail-table td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail-table th { color: var(--ink-soft); font-weight: 400; width: 40%; }
.detail-table td { font-weight: 600; }

.narrow { max-width: 620px; margin: 0 auto; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
