/* ==========================================================================
   Jarząbek Auto — Samochody Ciężarowe (jarzabekauto.pl)
   Kolorystyka: głęboki antracyt + złoto/amber (#f5b400) + biel.
   Tryb ciemny oparty o prefers-color-scheme z ręcznym nadpisaniem w localStorage.
   ========================================================================== */

:root {
    /* Tryb jasny (gdy system preferuje jasny i użytkownik nie wybrał ciemnego) */
    --bg: #f4f6f9;
    --bg-elev: #ffffff;
    --bg-subtle: #eaeef4;
    --border: #d8dee8;
    --text: #111827;
    --text-muted: #526071;
    --accent: #e5a300;
    --accent-bright: #f5b400;
    --accent-hover: #d49400;
    --accent-ink: #111318;
    --hero-bg: #0c1016;
    --hero-surface: #151b24;
    --hero-text: #f8fafc;
    --hero-muted: #c2cbd6;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --container: 1240px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1117;
        --bg-elev: #161c24;
        --bg-subtle: #1d2530;
        --border: #2a3442;
        --text: #f3f6fa;
        --text-muted: #9aa7b8;
        --accent: #f5b400;
        --accent-bright: #ffc424;
        --accent-hover: #ffca3a;
        --accent-ink: #0d1117;
        --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.48);
    }
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --bg-elev: #161c24;
    --bg-subtle: #1d2530;
    --border: #2a3442;
    --text: #f3f6fa;
    --text-muted: #9aa7b8;
    --accent: #f5b400;
    --accent-bright: #ffc424;
    --accent-hover: #ffca3a;
    --accent-ink: #0d1117;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.48);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

a {
    color: inherit;
    text-decoration: none;
}

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

/* ---------- Header / Nawigacja ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 16, 22, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(245, 180, 0, 0.22);
    color: #f8fafc;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5b400, #c88600);
    color: #0c1016;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1.12rem;
    font-weight: 900;
    text-transform: uppercase;
}

.brand-title span {
    color: #f5b400;
}

.brand-sub {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    color: #b4c0cf;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    color: #dbe3ee;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(245, 180, 0, 0.14);
    color: #f5b400;
}

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

.phone-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5b400;
    color: #0c1016;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: transform 0.15s, background 0.15s;
}

.phone-pill:hover {
    background: #ffc424;
    transform: translateY(-1px);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.icon-btn:hover {
    background: rgba(245, 180, 0, 0.18);
    border-color: rgba(245, 180, 0, 0.5);
    color: #f5b400;
}

.mobile-menu-btn {
    display: none;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-dark-outline {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: #f8fafc;
}

.btn-dark-outline:hover {
    border-color: #f5b400;
    color: #f5b400;
}

.btn-lg {
    padding: 13px 26px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ---------- HERO (wierny grafice właściciela) ---------- */
.hero-section {
    background: var(--hero-bg);
    color: var(--hero-text);
    border-bottom: 2px solid rgba(245, 180, 0, 0.35);
}

.hero-visual-wrap {
    position: relative;
    overflow: hidden;
    background: #0a0d12;
}

.hero-banner-img {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: block;
    object-fit: cover;
}

.hero-cta-strip {
    background: linear-gradient(180deg, #121720 0%, #0c1016 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
}

.hero-cta-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-lead-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.hero-lead-title span {
    color: #f5b400;
}

.hero-lead-sub {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: #b7c3d3;
}

.hero-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 5 filarów zaufania z grafiki */
.pillars-bar {
    background: #141a23;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 18px 0;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.pillar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eef3f9;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pillar-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(245, 180, 0, 0.14);
    border: 1px solid rgba(245, 180, 0, 0.35);
    color: #f5b400;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* ---------- Sekcje i nagłówki ---------- */
.section {
    padding: 48px 0;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* ---------- Pasek szybkiego wyszukiwania / filtry ---------- */
.filter-box {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.filter-grid--compact {
    grid-template-columns: repeat(5, 1fr);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Siatka kart pojazdów (styl Otomoto Inventory) ---------- */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.vehicle-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(245, 180, 0, 0.55);
}

.vehicle-card--sold {
    opacity: 0.82;
}

.card-media {
    position: relative;
    aspect-ratio: 16 / 11;
    background: #141920;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .card-media img {
    transform: scale(1.03);
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--available {
    background: #15803d;
    color: #ffffff;
}

.badge--reserved {
    background: #f5b400;
    color: #0c1016;
}

.badge--sold {
    background: #dc2626;
    color: #ffffff;
}

.badge--hidden {
    background: #475569;
    color: #ffffff;
}

.badge--euro {
    background: rgba(12, 16, 22, 0.85);
    color: #f5b400;
    border: 1px solid rgba(245, 180, 0, 0.45);
}

.photo-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(12, 16, 22, 0.82);
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 4px;
}

.card-title {
    margin: 0 0 12px;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
}

.card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.card-specs strong {
    color: var(--text);
    font-weight: 700;
}

.card-price-row {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.price-main {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1.1;
}

.price-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-link-hint {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.vehicle-card:hover .card-link-hint {
    color: var(--accent);
}

/* ---------- Karta szczegółów pojazdu ---------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 28px;
    align-items: start;
}

.gallery-main {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0c1016;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(12, 16, 22, 0.72);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.gallery-nav:hover {
    background: #f5b400;
    color: #0c1016;
}

.gallery-nav--prev { left: 12px; }
.gallery-nav--next { right: 12px; }

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.thumb-btn {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    background: #0c1016;
}

.thumb-btn.active {
    border-color: var(--accent);
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.detail-sidebar {
    position: sticky;
    top: 88px;
}

.detail-price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1.1;
}

.detail-price-meta {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 18px;
}

.specs-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.94rem;
}

.spec-label {
    color: var(--text-muted);
}

.spec-value {
    font-weight: 700;
    text-align: right;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 600;
}

.feature-chip::before {
    content: "✓";
    color: var(--accent);
    font-weight: 900;
}

.description-body {
    white-space: pre-line;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(5, 8, 12, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

/* ---------- Alerty i puste stany ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(21, 128, 61, 0.14);
    border-color: rgba(21, 128, 61, 0.45);
    color: #22c55e;
}

.alert-error {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.45);
    color: #ef4444;
}

.empty-state {
    background: var(--bg-elev);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- Kontakt & Mapa ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 28px;
}

.hours-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hours-list li {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.map-frame {
    width: 100%;
    height: 320px;
    border: 0;
    border-radius: var(--radius);
    margin-top: 20px;
}

/* ---------- Stopka ---------- */
.site-footer {
    background: #0c1016;
    color: #cfd8e3;
    border-top: 2px solid rgba(245, 180, 0, 0.3);
    padding: 48px 0 24px;
    margin-top: 56px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 800;
    color: #f5b400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a:hover {
    color: #f5b400;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: #8b98a9;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- Responsywność ---------- */
@media (max-width: 1024px) {
    .vehicles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pillars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .filter-grid,
    .filter-grid--compact {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-layout,
    .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: #0c1016;
        border-bottom: 1px solid rgba(245, 180, 0, 0.3);
        padding: 14px 20px 20px;
        flex-direction: column;
        align-items: stretch;
    }
    .nav-links.open {
        display: flex;
    }
    .mobile-menu-btn {
        display: grid;
    }
    .phone-pill span {
        display: none;
    }
    .vehicles-grid,
    .filter-grid,
    .filter-grid--compact,
    .specs-table {
        grid-template-columns: 1fr;
    }
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
