/* ============================================================
   otoauta.pl — wspólny system projektowy (design tokens + atomy)
   Marka: granat + pomarańcz. Typografia: Manrope (display) + Inter (UI)
   ============================================================ */

:root {
  /* Granat — kolor wiodący */
  --navy-950: #0a1a3c;
  --navy-900: #11295c;
  --navy-800: #1b3a78;
  --navy-700: #264C94;   /* primary — granat z logo */
  --navy-600: #305aa8;
  --navy-500: #3d6bc2;
  --navy-100: #e7edf8;
  --navy-50:  #f2f6fc;

  /* Pomarańcz — akcent / CTA */
  --orange-700: #c8470f;
  --orange-600: #e2541a;
  --orange-500: #f5631e;   /* accent */
  --orange-400: #ff7a33;
  --orange-100: #ffe9dc;

  /* Neutralne (chłodne, pod granat) */
  --ink:    #0e1320;
  --ink-2:  #2b3445;
  --muted:  #5e6a7d;
  --muted-2:#8b96a8;
  --line:   #e4e8f0;
  --line-2: #eef1f6;
  --bg:     #f3f6fb;
  --bg-2:   #eef2f9;
  --card:   #ffffff;

  /* Semantyka */
  --green-600:#1f8a52;
  --green-100:#dff3e8;
  --gold-600:#b7791f;
  --gold-100:#fbeecb;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(13,30,70,.06), 0 1px 3px rgba(13,30,70,.05);
  --shadow:    0 6px 18px rgba(13,30,70,.08), 0 2px 6px rgba(13,30,70,.05);
  --shadow-lg: 0 24px 60px rgba(8,22,52,.18), 0 8px 22px rgba(8,22,52,.10);

  --font-display: "Manrope", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,h5,.display, .oa-display {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  color: var(--ink);
}

a { text-decoration: none; }

/* Wąski kontener — łatwiej dopasować do urządzeń */
.oa-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
@media (max-width: 575.98px){ .oa-container { padding-inline: 12px; } }

/* ---------- Logo (rekonstrukcja: PL badge + OTOAUTA) ---------- */
.oa-logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); }
.oa-logo__pl {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(160deg, var(--navy-600), var(--navy-800));
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.oa-logo__word { font-weight: 800; font-size: 1.32rem; letter-spacing: -.03em; line-height: 1; }
.oa-logo__word .oto { color: var(--navy-700); }
.oa-logo__word .auta { color: var(--orange-500); }
.oa-logo--light .oa-logo__word .oto { color: #fff; }
.oa-logo--light .oa-logo__pl { background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* ---------- Przyciski ---------- */
.btn-oa {
  --_bg: var(--navy-700); --_fg:#fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 700; font-size: .92rem;
  padding: .62rem 1.15rem; border-radius: 11px; border: 0; cursor: pointer;
  background: var(--_bg); color: var(--_fg); line-height: 1.1;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.btn-oa:hover { filter: brightness(1.06); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-oa:active { transform: translateY(0); }
.btn-oa--accent { --_bg: var(--orange-500); box-shadow: 0 6px 16px rgba(245,99,30,.32); }
.btn-oa--accent:hover { box-shadow: 0 10px 22px rgba(245,99,30,.40); }
.btn-oa--ghost { --_bg: transparent; --_fg: var(--navy-700); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-oa--ghost:hover { --_bg: var(--navy-50); filter: none; }
.btn-oa--lg { padding: .9rem 1.6rem; font-size: 1rem; border-radius: 13px; }
.btn-oa--block { width: 100%; }

/* ---------- Plakietki / badge ---------- */
.oa-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: .68rem; letter-spacing: .02em; text-transform: uppercase;
  padding: .26rem .55rem; border-radius: 7px; line-height: 1;
}
.oa-badge--promo  { background: var(--orange-500); color:#fff; }
.oa-badge--wyr    { background: var(--gold-100); color: var(--gold-600); }
.oa-badge--lic    { background: var(--navy-700); color:#fff; }
.oa-badge--kup    { background: var(--green-100); color: var(--green-600); }
.oa-badge--ev     { background: #e3f6ee; color: var(--green-600); }
.oa-badge--soft   { background: var(--navy-100); color: var(--navy-700); }

/* ---------- Karta oferty (współdzielona) ---------- */
.car-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--navy-100); }
.car-card__media { position: relative; aspect-ratio: 16/11; overflow: hidden; background: var(--bg-2); }
.car-card__media img { width: 100%; height: 100%; object-fit: cover; display:block; transition: transform .4s ease; }
.car-card:hover .car-card__media img { transform: scale(1.045); }
.car-card__badges { position: absolute; top: 9px; left: 9px; display: flex; gap: 5px; flex-wrap: wrap; }
.car-card__fav {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer; padding: 0; line-height: 0;
  background: rgba(255,255,255,.45); color: var(--ink-2); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  box-shadow: 0 1px 5px rgba(8,22,52,.16); transition: background .15s, color .15s, transform .15s;
}
.car-card__fav i { font-size: .82rem; line-height: 1; display: block; }
.car-card__fav:hover { background: #fff; transform: scale(1.1); color: var(--orange-500); }
.car-card__fav.is-active { background: #fff; color: var(--orange-500); }
.car-card__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.car-card__title { font-family: var(--font-display); font-weight: 700; font-size: .98rem; line-height: 1.25; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car-card__specs { display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: .78rem; color: var(--muted); }
.car-card__specs span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.car-card__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.car-card__price { font-family: var(--font-display); font-weight: 800; font-size: 1.16rem; color: var(--navy-800); letter-spacing: -.02em; }
.car-card__price small { font-weight: 700; font-size: .68rem; color: var(--muted); }
.car-card__loc { font-size: .74rem; color: var(--muted-2); display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 400px){ .car-card__foot .btn-oa { display: none; } }

/* ---------- Mini-karta (przewijak 6 kolumn) ---------- */
.mini-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .16s ease, border-color .16s ease; height: 100%; }
.mini-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--navy-100); }
.mini-card__media { aspect-ratio: 16/11; position: relative; overflow: hidden; background: var(--bg-2); }
.mini-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mini-card:hover .mini-card__media img { transform: scale(1.05); }
.mini-card__b { padding: 8px 9px 10px; }
.mini-card__t { font-family: var(--font-display); font-weight: 700; font-size: .78rem; line-height: 1.2; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card__meta { font-size: .68rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card__price { font-family: var(--font-display); font-weight: 800; font-size: .92rem; color: var(--navy-800); margin-top: 4px; letter-spacing: -.02em; }
.mini-card__price small { font-weight: 700; font-size: .62rem; color: var(--muted); }

/* ---------- Chip marki ---------- */.brand-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: .5rem .85rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .85rem; color: var(--ink-2);
  white-space: nowrap; transition: .15s; cursor: pointer;
}
.brand-chip:hover { border-color: var(--navy-500); color: var(--navy-700); box-shadow: var(--shadow-sm); }
.brand-chip b { color: var(--muted-2); font-weight: 700; }

/* ---------- Znaczki zaufania ---------- */
.trust-item { display: flex; align-items: flex-start; gap: 11px; }
.trust-item__ic {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy-700); font-size: 1.15rem;
}
.trust-item__t { font-weight: 700; font-size: .9rem; color: var(--ink); line-height: 1.2; }
.trust-item__s { font-size: .8rem; color: var(--muted); }

/* ---------- Suwak typów pojazdów (ikony) ---------- */
.vtype {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px; border-radius: 13px; cursor: pointer; border: 1.5px solid transparent;
  background: transparent; transition: .15s; min-width: 84px; color: var(--muted);
}
.vtype:hover { background: var(--navy-50); color: var(--navy-700); }
.vtype.is-active { background: #fff; border-color: var(--navy-200, var(--navy-100)); color: var(--navy-700); box-shadow: var(--shadow-sm); }
.vtype.is-active .vtype__ic { color: var(--orange-500); }
.vtype__ic { width: 34px; height: 34px; }
.vtype__ic svg { width: 100%; height: 100%; }
.vtype__lbl { font-size: .76rem; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Pola formularza wyszukiwarki ---------- */
.oa-field { display: flex; flex-direction: column; gap: 5px; }
.oa-field > label { font-size: .74rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.oa-select, .oa-input {
  appearance: none; width: 100%; font-family: var(--font-ui); font-size: .9rem; font-weight: 600; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 11px; padding: .68rem .8rem; line-height: 1.2;
  transition: border-color .15s, box-shadow .15s;
}
.oa-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6a7d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2.1rem; cursor: pointer; }
.oa-select:focus, .oa-input:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(37,99,196,.14); }
.oa-input::placeholder { color: var(--muted-2); font-weight: 500; }

/* Segment switch (Kupno/Leasing, Pojazdy/Części) */
.oa-seg { display: inline-flex; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 2px; }
.oa-seg button {
  border: 0; background: transparent; font-family: var(--font-ui); font-weight: 700; font-size: .85rem; color: var(--muted);
  padding: .5rem .95rem; border-radius: 8px; cursor: pointer; transition: .15s; display:inline-flex; align-items:center; gap:6px;
}
.oa-seg button.is-active { background: #fff; color: var(--navy-700); box-shadow: var(--shadow-sm); }
.oa-seg--accent button.is-active { color: var(--orange-600); }

/* ---------- Sekcje ---------- */
.oa-section { padding: 36px 0; }
.oa-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.oa-section__title { font-size: clamp(1.25rem, 3.2vw, 1.7rem); font-weight: 800; }
.oa-section__title .accent { color: var(--orange-500); }
.oa-eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-600); }
.oa-link-more { font-weight: 700; font-size: .9rem; color: var(--navy-700); display: inline-flex; align-items: center; gap: 5px; }
.oa-link-more:hover { color: var(--orange-600); gap: 8px; }

/* ---------- Stopka ---------- */
.oa-footer { background: var(--navy-950); color: #c4cee0; padding: 48px 0 26px; font-size: .88rem; }
.oa-footer h6 { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.oa-footer a { color: #aab8d2; }
.oa-footer a:hover { color: #fff; }
.oa-footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.oa-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: #7f8db0; font-size: .82rem; }

/* Pasek SEO linków */
.seo-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.seo-cloud a { font-size: .82rem; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: .3rem .65rem; border-radius: 8px; }
.seo-cloud a:hover { border-color: var(--navy-500); color: var(--navy-700); }

/* Utility */
.oa-hide-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.oa-hide-scroll::-webkit-scrollbar { display: none; }
.oa-snap { scroll-snap-type: x mandatory; }
.oa-snap > * { scroll-snap-align: start; }

/* Pasek przełącznika wariantów (wspólny dla podglądu) */
.variant-switch {
  position: fixed; z-index: 1080; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; background: rgba(8,22,52,.92); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border-radius: 999px; padding: 5px; box-shadow: var(--shadow-lg);
}
.variant-switch a { font-size: .8rem; font-weight: 700; color: #c4cee0; padding: .42rem .8rem; border-radius: 999px; white-space: nowrap; }
.variant-switch a.is-active { background: var(--orange-500); color: #fff; }
.variant-switch a:hover:not(.is-active) { color:#fff; background: rgba(255,255,255,.1); }
@media (max-width: 420px){ .variant-switch a { padding: .4rem .6rem; font-size: .72rem; } }

/* ===== Logo w wersji białej (na ciemnym tle) — odwrócenie koloru filtrem ===== */
.logo-white { filter: brightness(0) invert(1); background: none !important; padding: 0 !important; border-radius: 0 !important; }

/* ikona 1G.pl w nagłówku */
.va-ico--1g i { color: #ff5a00; }
.va-ico--1g:hover { background: #fff3ec; color: #c8470f; }

/* ============ MOBILE HARDENING (iOS Safari / Chrome / Firefox / Opera) ============ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iOS zoomuje stronę przy focusie pola z fontem < 16px — wymuszamy 16px na dotyku */
@media (max-width: 991.98px) {
  input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
  input[type="number"], input[type="password"], input[type="url"],
  select, textarea, .oa-input, .oa-select { font-size: 16px !important; }
}
/* płynne przewijanie poziomych pasków na iOS */
.oa-hide-scroll, .va-mini, .op-similar, .kt-mobnav, .lst-offerbar, .subnav__in, .va-types__row { -webkit-overflow-scrolling: touch; }
/* notch / home-indicator (iPhone X+) */
@supports (padding: max(0px)) {
  .op-sticky { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .oa-chat-launch { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .oa-chat { max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)); }
  .variant-switch, .op-switch, .lst-switch { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
/* dvh zamiast vh — pasek adresu iOS nie ucina dołu */
@supports (height: 100dvh) {
  .oa-chat { max-height: calc(100dvh - 40px) !important; }
}
/* większe cele dotyku na ekranach dotykowych */
@media (pointer: coarse) {
  .car-card__fav { width: 38px; height: 38px; }
  .car-card__fav i { font-size: 1rem; }
  .subnav a { padding: 15px 16px 13px; }
}

/* ===== Załącznik w czacie ===== */
.chat-att { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.chat-att > i { font-size: 1.55rem; flex: none; }
.chat-att__b { flex: 1; min-width: 0; }
.chat-att__b b { display: block; font-size: .84rem; word-break: break-all; line-height: 1.25; }
.chat-att__b small { font-size: .72rem; opacity: .78; }
.chat-att__dl { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; flex: none; display: grid; place-items: center; font-size: 1rem; background: rgba(255,255,255,.28); color: inherit; transition: .15s; }
.chat-att__dl:hover { background: rgba(255,255,255,.45); transform: translateY(-1px); }
.chat-bub.in .chat-att__dl { background: var(--navy-50); color: var(--navy-700); }
.chat-bub.in .chat-att__dl:hover { background: var(--navy-100); }

/* szybkie odpowiedzi w czacie: wyłączone (zabierały miejsce) */
.chat-quick { display: none !important; }

/* ===== Blokowanie w czacie ===== */
.chat-block { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 9px; padding: .35rem .6rem; font-size: .76rem; font-weight: 700; cursor: pointer; margin-right: 8px; flex: none; transition: .15s; }
.chat-block:hover { border-color: #e23b3b; color: #e23b3b; }
.chat-block.on { background: #fde8e8; border-color: #e23b3b; color: #b42318; }
.chat-blocknote { background: #fde8e8; color: #b42318; font-size: .78rem; font-weight: 600; padding: .5rem .9rem; display: flex; gap: 8px; align-items: center; }
#chatText:disabled { background: var(--bg-2); cursor: not-allowed; }
@media (max-width: 575.98px){ .chat-block span { display: none; } }

/* ===== Emoji picker w czacie ===== */
.chat-input { position: relative; }
.chat-emo { position: absolute; bottom: calc(100% + 8px); right: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 40; animation: emoIn .16s ease; }
@keyframes emoIn { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.chat-emo button { border: 0; background: none; font-size: 1.2rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .12s; padding: 0; line-height: 1; }
.chat-emo button:hover { background: var(--navy-50); transform: scale(1.15); }
@media (max-width: 575.98px){ .chat-emo { grid-template-columns: repeat(6, 1fr); right: 4px; } }

/* ===== Czat: większe okno na desktopie (tu się zarabia!) ===== */
@media (min-width: 992px) {
  .oa-chat.open {
    width: min(1100px, calc(100vw - 48px)) !important;
    height: min(880px, calc(100vh - 48px)) !important;
    grid-template-columns: 320px 1fr !important;
  }
}
@supports (height: 100dvh) {
  @media (min-width: 992px) {
    .oa-chat.open { height: min(880px, calc(100dvh - 48px)) !important; }
  }
}

/* ===== Asystent AI w czacie ===== */
.chat-av--ai { background: linear-gradient(135deg, var(--orange-500), #7c5cff) !important; color: #fff; font-size: 1.05rem; }
.chat-conv.is-ai { background: linear-gradient(90deg, #fff7ef, #f5f2ff); box-shadow: inset 3px 0 0 #7c5cff; }
.chat-conv.is-ai:hover { background: linear-gradient(90deg, #ffefdf, #ece6ff); }
.chat-conv.is-ai.active { background: linear-gradient(90deg, #ffefdf, #ece6ff); box-shadow: inset 3px 0 0 var(--orange-500); }
.chat-conv.is-ai .chat-conv__name::after { content: "AI"; margin-left: 6px; font-size: .58rem; font-weight: 800; letter-spacing: .04em; background: linear-gradient(135deg, var(--orange-500), #7c5cff); color: #fff; padding: .12rem .38rem; border-radius: 5px; vertical-align: 2px; }
