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

html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #ffffff;
    background-color: #f7dede;
    overflow-x: hidden;
}

/* Główne tło */
.site-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    position: relative;
    padding-bottom: 45px;
    background-color: #f7dede;
    background-image: url('assets/tlo.png'), url('assets/T%20O.png'), url('assets/tlo.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* 1. Górny biały pasek z logo */
.top-header {
    background: #ffffff;
    width: 100%;
    height: 83px;
    margin-top: 18px;
    padding: 0 45px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-out;
}

.header-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.logo-link {
    transition: transform 0.2s ease-out;
}

.site-logo {
    height: 56px;
    width: auto;
    display: block;
}

/* 2. Główna sekcja */
.main-stage {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 45px 10px 45px;
    overflow: hidden;
}

/* 3. Social Media & Kontakt - Domyślny styl bazowy (Desktop) */
.social-contact-wrapper {
    margin-left: 2vw;
    margin-top: 5px;
    z-index: 40;
    width: fit-content;
    max-width: 100%;
    transform: translate(var(--desktop-x, 0px), var(--desktop-y, 0px));
    transition: transform 0.2s ease-out;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.more-label {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.social-item {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-item:hover {
    transform: translateY(-2px);
    opacity: 0.88;
}

.social-item img {
    height: 38px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.mail-row {
    margin-top: 10px;
    text-align: right;
    width: 100%;
}

.mail-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    opacity: 0.95;
    transition: opacity 0.2s;
    word-break: break-all;
}

.mail-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* 4. Samochód */
.car-stage-area {
    position: relative;
    width: 100%;
    margin-left: -45px;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease-out;
}

.car-motion-container {
    display: inline-block;
    position: relative;
    transform: translateX(-120%);
    animation: carDriveIn 1.5s cubic-bezier(0.12, 0.85, 0.3, 1) forwards;
    z-index: 20;
}

.car-box {
    position: relative;
    display: inline-block;
    width: auto;
    height: auto;
    line-height: 0;
}

.car-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 85vw;
    max-height: 56vh;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.car-overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}

@keyframes carDriveIn {
    0% {
        transform: translateX(-120%) skewX(4deg);
    }
    75% {
        transform: translateX(2%) skewX(-2.5deg);
    }
    90% {
        transform: translateX(-0.5%) skewX(1deg);
    }
    100% {
        transform: translateX(0) skewX(0deg);
    }
}

.wheel-fade-layer {
    mix-blend-mode: overlay;
    animation: fadeWheelsOut 1.45s ease-out forwards;
}

@keyframes fadeWheelsOut {
    0% {
        opacity: 0.95;
    }
    75% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
    }
}

.glint-group {
    opacity: 0;
    animation: hoodGlintSvg 4.5s ease-in-out 2.8s infinite;
}

@keyframes hoodGlintSvg {
    0% {
        opacity: 0;
        transform: scale(0.1) rotate(0deg);
    }
    8% {
        opacity: 1;
        transform: scale(1.2) rotate(35deg);
    }
    16% {
        opacity: 0;
        transform: scale(0.2) rotate(70deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.1) rotate(70deg);
    }
}

/* Canvas kurzu */
.dust-canvas-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 15;
}

/* 5. Sub-footer */
.sub-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    z-index: 30;
}

.copyright-label {
    display: inline-block;
    color: #ffffff;
    font-weight: 500;
}

.footer-sep {
    margin: 0 6px;
    opacity: 0.7;
}

.sub-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.sub-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* 6. Pasek Cookies */
.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 40px;
    background: #d61827;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 30px;
    font-size: 0.88rem;
    z-index: 9999;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

.cookie-bar-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cookie-text-btn, .cookie-more-link {
    background: none;
    border: none;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0;
}

.cookie-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 14px;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.cookie-close-btn:hover {
    background: #ffffff;
    color: #d61827;
}

/* 7. Modal Cookies RODO */
.cookie-modal-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal-overlay.active {
    display: flex !important;
}

.cookie-modal-window {
    background: #ffffff;
    color: #222;
    max-width: 580px;
    width: 100%;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.4);
}

.cookie-modal-window h3 {
    margin-top: 0;
    color: #d61827;
    font-size: 1.35rem;
}

.modal-desc {
    font-size: 0.92rem;
    color: #555;
    margin-bottom: 20px;
}

.cookie-pref-item {
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fafafa;
}

.pref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.badge-required {
    font-size: 0.75rem;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 4px;
}

.pref-desc {
    font-size: 0.82rem;
    color: #666;
    margin-top: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-save-prefs, .btn-accept-all {
    padding: 9px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    font-family: inherit;
}

.btn-save-prefs {
    background: #e9ecef;
    color: #333;
}

.btn-accept-all {
    background: #d61827;
    color: #fff;
}

/* =============================================================
   TRYB 1: WĄSKI EKRAN PIONOWY (PORTRAIT) – JEDNO POD DRUGIM
============================================================= */
@media (max-width: 850px) and (orientation: portrait) {
    .site-body {
        height: auto;
        min-height: 100vh;
    }

    .top-header {
        margin-top: 10px;
        padding: 0 16px;
        height: 64px;
    }

    .site-logo {
        height: 42px;
    }

    .main-stage {
        padding: 15px 16px 20px 16px;
    }

    /* Układ w pionie: napis -> kolumna ikon -> e-mail */
    .social-contact-wrapper {
        margin-left: 0 !important;
        margin-top: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        display: block !important;
    }

    .social-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .more-label {
        font-size: 0.95rem;
        display: block;
    }

    .social-icons {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .social-item img {
        height: 32px;
        display: block;
    }

    .mail-row {
        text-align: left !important;
        margin-top: 12px !important;
    }

    .mail-link {
        font-size: 1.05rem;
    }

    .car-stage-area {
        margin-left: -16px;
        margin-top: 25px;
        margin-bottom: 25px;
    }

    .car-img {
        max-width: 140vw;
        max-height: 44vh;
    }

    .cookie-bar {
        padding: 8px 16px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .cookie-bar-content {
        justify-content: center;
        gap: 8px;
    }

    .cookie-close-btn {
        width: 100%;
        padding: 6px 12px;
    }
}

/* =============================================================
   TRYB 2: EKRAN POZIOMY (LANDSCAPE) – IKONY W JEDNEJ LINII
============================================================= */
@media (max-width: 950px) and (orientation: landscape) {
    .site-body {
        height: auto;
        min-height: 100vh;
    }

    .top-header {
        margin-top: 6px;
        padding: 0 20px;
        height: 52px;
    }

    .site-logo {
        height: 36px;
    }

    .main-stage {
        padding: 10px 20px 15px 20px;
    }

    /* Układ w poziomie: ikony w jednej linii, brak ucinania z prawej */
    .social-contact-wrapper {
        margin-left: 0 !important;
        margin-top: 2px !important;
        width: fit-content !important;
        max-width: 100% !important;
        transform: none !important;
    }

    .social-row {
        flex-direction: row !important;
        align-items: center !important;
        gap: 14px !important;
        flex-wrap: wrap !important;
    }

    .more-label {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .social-icons {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        flex-wrap: nowrap !important;
    }

    .social-item img {
        height: 28px !important;
    }

    .mail-row {
        text-align: left !important;
        margin-top: 5px !important;
    }

    .mail-link {
        font-size: 0.95rem;
    }

    .car-stage-area {
        margin-left: -20px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .car-img {
        max-width: 80vw;
        max-height: 52vh;
    }
}