/* =================================================================
   American-Auto — arkusz stylów
   Paleta: granat / czerwień / biel (z logo)
   ================================================================= */

:root {
    --navy: #0a1f44;
    --navy-700: #122a55;
    --navy-600: #1c3a6e;
    --red: #c8102e;
    --red-dark: #a50d25;
    --steel: #3f6db5;
    --steel-light: #6f9bd8;
    --bg: #f5f7fb;
    --bg-soft: #eef2f8;
    --white: #ffffff;
    --text: #1a2435;
    --text-soft: #5a6678;
    --border: #e2e8f2;
    --shadow-sm: 0 2px 8px rgba(10, 31, 68, 0.06);
    --shadow: 0 8px 30px rgba(10, 31, 68, 0.10);
    --shadow-lg: 0 20px 50px rgba(10, 31, 68, 0.16);
    --radius: 14px;
    --radius-lg: 22px;
    --maxw: 1180px;
    --header-h: 76px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--steel); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--red); }

h1, h2, h3 { line-height: 1.18; color: var(--navy); font-weight: 800; letter-spacing: -0.01em; }

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

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
    padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Przyciski ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    font-weight: 600; font-size: 1rem; padding: 13px 26px; border-radius: 999px;
    border: 2px solid transparent; cursor: pointer; transition: all .25s var(--ease);
    white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(200,16,46,.28); }
.btn-primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(200,16,46,.36); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-outline:hover { color: var(--red); border-color: var(--red); transform: translateY(-2px); }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }

/* ---------- Nagłówek / nawigacja ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
    transition: box-shadow .3s var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 18px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 52px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: 26px; }
.primary-nav ul { display: flex; list-style: none; gap: 4px; align-items: center; }
.primary-nav a {
    display: block; color: var(--navy); font-weight: 600; font-size: .98rem;
    padding: 9px 14px; border-radius: 9px; position: relative;
}
.primary-nav a:hover { color: var(--red); background: var(--bg-soft); }
.primary-nav a.is-active { color: var(--red); }
.primary-nav a.is-active::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
    background: var(--red); border-radius: 2px;
}
.nav-cta .btn-phone {
    background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 999px;
    font-weight: 700; font-size: .95rem;
}
.nav-cta .btn-phone:hover { background: var(--red); color: #fff; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--navy); border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Sekcje ogólne ---------- */
section { padding: 76px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section-head .eyebrow {
    display: inline-block; color: var(--red); font-weight: 700; font-size: .82rem;
    letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.section-head p { color: var(--text-soft); font-size: 1.08rem; margin-top: 14px; }

.bg-soft { background: var(--bg-soft); }
.bg-navy { background: var(--navy); color: #fff; }
.bg-navy h2, .bg-navy h3 { color: #fff; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; padding: 0;
    background: radial-gradient(1200px 600px at 75% -10%, var(--navy-600), var(--navy) 55%);
    color: #fff;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px);
    pointer-events: none;
}
.hero-inner {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
    min-height: calc(88vh - var(--header-h)); padding: 60px 0;
}
.hero-content { position: relative; z-index: 2; }
.hero-flag {
    display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18); padding: 7px 16px; border-radius: 999px;
    font-weight: 600; font-size: .85rem; letter-spacing: .04em; margin-bottom: 22px;
}
.hero h1 {
    color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08;
    margin-bottom: 20px; letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--steel-light); }
.hero p.lead { font-size: 1.18rem; color: rgba(255,255,255,.85); max-width: 560px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-brands {
    display: flex; gap: 26px; margin-top: 40px; padding-top: 26px;
    border-top: 1px solid rgba(255,255,255,.14); flex-wrap: wrap;
}
.hero-brands .b { font-family: 'Oswald', sans-serif; font-size: 1.35rem; letter-spacing: .06em; color: rgba(255,255,255,.7); text-transform: uppercase; }

.hero-visual { position: relative; z-index: 2; }
.hero-card {
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-lg);
    backdrop-filter: blur(4px);
}
.hero-card img { border-radius: 16px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.hero-card .placeholder {
    border-radius: 16px; aspect-ratio: 4/3; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--navy-600), var(--navy-700));
    color: rgba(255,255,255,.5); text-align: center; padding: 24px;
}
.hero-card .placeholder img { width: 78%; aspect-ratio: auto; object-fit: contain; opacity: 1; }

/* ---------- Karty cech ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feature {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 34px 28px; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature .fi {
    width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--steel), var(--navy)); color: #fff;
    font-size: 1.6rem; margin-bottom: 20px;
}
.feature h3 { font-size: 1.25rem; margin-bottom: 10px; }
.feature p { color: var(--text-soft); }

/* ---------- Bloki ofertowe (split) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split.reverse .split-media { order: 2; }
.split-media img, .split-media .ph {
    border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%;
    aspect-ratio: 16/11; object-fit: cover;
}
.split-media .ph {
    display: grid; place-items: center; background: linear-gradient(135deg, var(--bg-soft), #dde6f3);
    color: var(--steel);
}
.split-media .ph img { width: 55%; aspect-ratio: auto; box-shadow: none; opacity: .8; }
.split-body h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 18px; }
.split-body p { color: var(--text-soft); margin-bottom: 14px; }
.check-list { list-style: none; margin: 22px 0 28px; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; color: var(--text); }
.check-list li::before {
    content: "✓"; flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--red);
    color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; margin-top: 2px;
}

/* ---------- Marki zamienników ---------- */
.brands-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 10px; }
.brand-chip {
    background: #fff; border: 1px solid var(--border); border-radius: 999px;
    padding: 10px 22px; font-family: 'Oswald', sans-serif; letter-spacing: .05em;
    color: var(--navy); font-size: 1.05rem; box-shadow: var(--shadow-sm);
}

/* ---------- Ogłoszenia: siatka kart ---------- */
.listings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.listing-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
    display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.listing-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-soft); }
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.listing-card:hover .listing-thumb img { transform: scale(1.05); }
.listing-thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--steel-light); }
.listing-thumb .ph img { width: 50%; opacity: .55; }
.listing-badge {
    position: absolute; top: 12px; left: 12px; background: var(--red); color: #fff;
    padding: 5px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700;
    letter-spacing: .03em; text-transform: uppercase;
}
.listing-photos-count {
    position: absolute; bottom: 12px; right: 12px; background: rgba(10,31,68,.82); color: #fff;
    padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.listing-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.listing-body h3 { font-size: 1.22rem; margin-bottom: 8px; }
.listing-body .excerpt { color: var(--text-soft); font-size: .96rem; margin-bottom: 18px; flex: 1; }
.listing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.listing-price { font-family: 'Oswald', sans-serif; font-size: 1.5rem; color: var(--red); font-weight: 700; }
.listing-foot .btn { padding: 10px 18px; font-size: .9rem; }

/* Pusty stan */
.empty-state {
    text-align: center; padding: 70px 24px; background: #fff; border: 1px dashed var(--border);
    border-radius: var(--radius-lg); color: var(--text-soft);
}
.empty-state .ico { font-size: 3rem; margin-bottom: 14px; }

/* ---------- Pojedyncze ogłoszenie ---------- */
.listing-detail { display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: start; }
.gallery-main {
    border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
    aspect-ratio: 4/3; background: var(--bg-soft); cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--steel-light); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumbs button {
    border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer;
    padding: 0; background: var(--bg-soft); aspect-ratio: 1; transition: border-color .2s var(--ease);
}
.gallery-thumbs button.active { border-color: var(--red); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-panel {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 32px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 20px);
}
.detail-panel h1 { font-size: 1.9rem; margin-bottom: 14px; }
.detail-price {
    font-family: 'Oswald', sans-serif; font-size: 2.4rem; color: var(--red); font-weight: 700;
    margin-bottom: 6px;
}
.detail-meta { color: var(--text-soft); font-size: .9rem; margin-bottom: 22px; }
.detail-desc { color: var(--text); white-space: pre-line; margin-bottom: 26px; line-height: 1.7; }
.detail-actions { display: grid; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-weight: 600; margin-bottom: 24px; }
.back-link:hover { color: var(--red); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; background: rgba(8, 18, 40, .94); z-index: 2000;
    display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-close { position: absolute; top: 20px; right: 26px; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; }
.lightbox-nav:hover { background: var(--red); }
.lightbox-prev { left: 22px; } .lightbox-next { right: 22px; }

/* ---------- Strony treściowe ---------- */
.page-hero {
    background: linear-gradient(120deg, var(--navy), var(--navy-600));
    color: #fff; padding: 60px 0; text-align: center; position: relative; overflow: hidden;
}
.page-hero::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 24px);
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); position: relative; }
.page-hero p { color: rgba(255,255,255,.82); max-width: 640px; margin: 14px auto 0; position: relative; font-size: 1.1rem; }
.breadcrumb { position: relative; color: rgba(255,255,255,.6); font-size: .88rem; margin-bottom: 14px; }
.breadcrumb a { color: rgba(255,255,255,.8); }

.prose { max-width: 820px; margin: 0 auto; }
.prose p { color: var(--text); margin-bottom: 18px; font-size: 1.06rem; }
.prose h2 { font-size: 1.6rem; margin: 32px 0 14px; }

/* ---------- Pasek statystyk ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat .num { font-family: 'Oswald', sans-serif; font-size: 2.6rem; color: var(--red); font-weight: 700; line-height: 1; }
.stat .lab { color: var(--text-soft); margin-top: 8px; font-weight: 500; }
.bg-navy .stat .lab { color: rgba(255,255,255,.7); }
.bg-navy .stat .num { color: var(--steel-light); }

/* ---------- CTA ---------- */
.cta-band { background: linear-gradient(120deg, var(--red), var(--red-dark)); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 600px; margin: 0 auto 28px; font-size: 1.1rem; }
.cta-band .btn-outline { background: #fff; color: var(--red); }
.cta-band .btn-outline:hover { background: var(--navy); color: #fff; }

/* ---------- Kontakt ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: start; }
.contact-cards { display: grid; gap: 16px; }
.contact-card {
    display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.contact-card .ci {
    flex: 0 0 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--steel), var(--navy)); color: #fff; font-size: 1.4rem;
}
.contact-card .lbl { color: var(--text-soft); font-size: .85rem; }
.contact-card .val { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.contact-card a.val:hover { color: var(--red); }

.contact-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 7px; color: var(--navy); font-size: .95rem; }
.form-row input, .form-row textarea, .form-row select {
    width: 100%; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 11px;
    font: inherit; color: var(--text); background: var(--bg); transition: border-color .2s, box-shadow .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none; border-color: var(--steel); background: #fff; box-shadow: 0 0 0 4px rgba(63,109,181,.12);
}
.form-row textarea { resize: vertical; min-height: 130px; }
.honeypot { position: absolute; left: -9999px; }
.alert { padding: 14px 18px; border-radius: 11px; margin-bottom: 20px; font-weight: 500; }
.alert-ok { background: #e8f7ee; color: #1c7a44; border: 1px solid #b6e6c8; }
.alert-err { background: #fdeaec; color: #b3162c; border: 1px solid #f5c2ca; }

.map-embed { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); margin-top: 22px; border: 1px solid var(--border); }
.map-embed iframe { width: 100%; height: 320px; border: 0; display: block; }

/* ---------- Stopka ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.78); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; padding: 56px 0 40px; }
.footer-logo { height: 50px; margin-bottom: 18px; }
.footer-about { font-size: .95rem; max-width: 320px; }
.footer-col h3 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; }
.footer-links, .footer-contact { list-style: none; display: grid; gap: 11px; }
.footer-links a { color: rgba(255,255,255,.78); }
.footer-links a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 14px; align-items: center; }
.footer-contact .ico {
    color: var(--steel-light); font-size: 1.45rem; line-height: 1;
    flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center;
}
.footer-contact a { color: rgba(255,255,255,.9); }
.footer-contact a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.10); }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; flex-wrap: wrap; gap: 10px; }
.footer-bottom p { font-size: .85rem; color: rgba(255,255,255,.55); }
.footer-admin { color: rgba(255,255,255,.55); }
.footer-admin:hover { color: #fff; }

/* ---------- Animacje wejścia ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =================================================================
   RESPONSYWNOŚĆ
   ================================================================= */
@media (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; gap: 30px; min-height: 0; padding: 50px 0; }
    .hero-visual { max-width: 480px; }
    .split { grid-template-columns: 1fr; gap: 30px; }
    .split.reverse .split-media { order: 0; }
    .listing-detail { grid-template-columns: 1fr; gap: 26px; }
    .detail-panel { position: static; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}

@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        position: fixed; inset: var(--header-h) 0 auto 0; background: #fff;
        flex-direction: column; align-items: stretch; gap: 0; padding: 14px 18px 24px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
        transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .28s var(--ease);
        max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    }
    .primary-nav.open { transform: none; opacity: 1; pointer-events: auto; }
    .primary-nav ul { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
    .primary-nav a { padding: 14px 12px; font-size: 1.05rem; border-radius: 10px; }
    .primary-nav a.is-active::after { display: none; }
    .primary-nav a.is-active { background: var(--bg-soft); }
    .nav-cta { margin-top: 12px; }
    .nav-cta .btn-phone { display: block; text-align: center; }

    section { padding: 56px 0; }
    .features { grid-template-columns: 1fr; }
    .listings-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 560px) and (max-width: 760px) {
    .listings-grid { grid-template-columns: repeat(2, 1fr); }
}
