/* =========================================================
   ATS Auto Truck Serwis – główny arkusz stylów
   Kolory: #011b34 (granat) | #9a1618 (czerwień) | #ffffff
   ========================================================= */

/* --- Zmienne --- */
:root {
    --navy:   #011b34;
    --red:    #9a1618;
    --red-dk: #7d1214;
    --white:  #ffffff;
    --light:  #f4f5f7;
    --gray:   #6c757d;
    --dark:   #1a1a2e;
    --font:   'Montserrat', 'Arial', sans-serif;
    --tr:     0.3s ease;
    --shadow: 0 4px 24px rgba(1, 27, 52, 0.12);
    --shadow-lg: 0 12px 48px rgba(1, 27, 52, 0.18);
    --radius: 8px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { font-family: var(--font); color: var(--dark); line-height: 1.65; font-size: 16px; }
a, button, [role="button"] { cursor: pointer; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
address { font-style: normal; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================
   HEADER
   ========================================================= */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--navy);
    transition: box-shadow var(--tr), background var(--tr);
}

#header.scrolled {
    background: rgba(1, 27, 52, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 24px rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(154, 22, 24, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 72px;
    transition: height var(--tr);
}

#header.scrolled .header-inner { height: 64px; }

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 64px;
    width: auto;
    display: block;
    transition: opacity var(--tr);
}

/* ciemne tło (header, footer) – czarne elementy → białe */
.logo-img--inv {
    filter: invert(1);
}

.logo:hover .logo-img--inv { opacity: 0.85; }

.footer-logo .logo-img { height: 58px; }

.contact-logo {
    margin-bottom: 40px;
}

.contact-logo .logo-img {
    height: 90px;
}

/* --- Nawigacja --- */
#nav { flex: 1; }

#nav ul {
    display: flex;
    gap: 2px;
    justify-content: center;
}

#nav a {
    display: block;
    padding: 8px 13px;
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px;
    transition: color var(--tr), background var(--tr);
}

#nav a:hover,
#nav a.active { color: var(--white); background: rgba(255,255,255,0.1); }

#nav a.active { color: var(--white); }

/* --- Przycisk call --- */
.btn-call {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--tr), transform var(--tr);
}

.btn-call:hover { background: var(--red-dk); transform: translateY(-1px); }

/* --- Hamburger --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform var(--tr), opacity var(--tr);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    transform: scale(1.06);
    transition: transform 8s ease-out;
    will-change: transform;
}

.hero-img.loaded { transform: scale(1); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(1, 27, 52, 0.93) 0%,
        rgba(1, 27, 52, 0.78) 55%,
        rgba(1, 27, 52, 0.45) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 140px 24px 80px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-tag::before {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--red);
    border-radius: 2px;
}

.hero-content h1 {
    font-size: clamp(30px, 5.5vw, 66px);
    font-weight: 900;
    color: var(--white);
    line-height: 1.08;
    margin-bottom: 20px;
    max-width: 920px;
}

.hero-content h1 .h1-sub {
    display: block;
    font-size: clamp(17px, 2.8vw, 36px);
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    line-height: 1.3;
    margin-top: 10px;
}

.hero-sub {
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 40px;
    max-width: 560px;
    line-height: 1.7;
    white-space: nowrap;
}

/* --- Przyciski hero --- */
.hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.btn-primary {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 15px 36px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
}

.btn-primary:hover {
    background: var(--red-dk);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(154, 22, 24, 0.45);
}

.btn-outline {
    display: inline-block;
    color: var(--white);
    padding: 14px 34px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 2px solid rgba(255,255,255,0.45);
    transition: border-color var(--tr), background var(--tr), transform var(--tr);
}

.btn-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* --- Statystyki hero --- */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 32px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat:not(:last-child) {
    padding-right: 32px;
    border-right: 1px solid rgba(255,255,255,0.12);
}

.stat-val {
    font-size: 26px;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
}

.stat-lab {
    font-size: 10.5px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.5;
}

/* =========================================================
   SEKCJE OGÓLNE
   ========================================================= */
.section { padding: 90px 0; }
.bg-light { background: var(--light); }
.bg-navy  { background: var(--navy); }

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: clamp(22px, 3.5vw, 38px);
    font-weight: 900;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.section-header.light h2 { color: var(--white); }

.section-line {
    width: 56px;
    height: 4px;
    background: var(--red);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.section-sub {
    color: var(--gray);
    max-width: 620px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.75;
}

/* =========================================================
   O NAS – WARTOŚCI
   ========================================================= */
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.value-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 28px 36px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--tr), box-shadow var(--tr);
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.value-icon {
    width: 68px;
    height: 68px;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    color: var(--white);
    font-size: 26px;
}

.value-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 12px;
}

.value-card p {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.75;
}

/* =========================================================
   USŁUGI
   ========================================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--tr), box-shadow var(--tr);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.service-card:hover .service-img img { transform: scale(1.06); }

.service-badge {
    position: absolute;
    bottom: -22px;
    left: 24px;
    width: 50px;
    height: 50px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 19px;
    box-shadow: 0 4px 16px rgba(154, 22, 24, 0.45);
}

.service-body {
    padding: 38px 24px 28px;
}

.service-body h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 16px;
    line-height: 1.3;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--gray);
    line-height: 1.55;
}

.service-list li i {
    color: var(--red);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 13px;
}

.scania-plans {
    display: flex;
    gap: 8px;
    margin-top: 22px;
}

.scania-plans span {
    width: 38px;
    height: 38px;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    border-radius: 5px;
    letter-spacing: 0;
}

/* =========================================================
   CENNIK
   ========================================================= */
.pricing-grid {
    display: flex;
    gap: 28px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.pricing-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 52px 52px 44px;
    text-align: center;
    color: var(--white);
    flex: 1;
    max-width: 400px;
    transition: background var(--tr), transform var(--tr);
}

.pricing-card:hover { background: rgba(255,255,255,0.09); transform: translateY(-4px); }

.pricing-card.featured {
    background: var(--red);
    border-color: transparent;
    box-shadow: 0 8px 36px rgba(154, 22, 24, 0.5);
}

.pricing-card.featured:hover { background: var(--red-dk); }

.pricing-icon {
    font-size: 44px;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.6);
}

.pricing-card.featured .pricing-icon { color: rgba(255,255,255,0.85); }

.pricing-card h3 {
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 28px;
    line-height: 1.5;
}

.price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.price .amount {
    font-size: 78px;
    font-weight: 900;
    line-height: 1;
    color: var(--white);
}

.price-info {
    display: flex;
    flex-direction: column;
    padding-top: 14px;
    align-items: flex-start;
    gap: 1px;
}

.price .currency {
    font-size: 26px;
    font-weight: 800;
    color: var(--white);
}

.price .net {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.price-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.pricing-note {
    text-align: center;
    color: rgba(255,255,255,0.38);
    font-size: 13px;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =========================================================
   GALERIA
   ========================================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    outline-offset: 3px;
}

.gallery-item:focus-visible { outline: 2px solid var(--red); }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(1, 27, 52, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 30px;
    opacity: 0;
    transition: opacity var(--tr);
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.07); }
.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay { opacity: 1; }

/* =========================================================
   KONTAKT
   ========================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 56px;
    align-items: start;
}

.contact-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 46px;
    height: 46px;
    background: var(--navy);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.contact-item strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--red);
    margin-bottom: 6px;
}

.contact-item p {
    font-size: 15px;
    color: var(--dark);
    line-height: 1.65;
    margin-bottom: 4px;
}

.contact-item p:last-child { margin-bottom: 0; }

.contact-item a {
    color: var(--navy);
    font-weight: 700;
    font-size: 17px;
    transition: color var(--tr);
}

.contact-item a:hover { color: var(--red); }

.contact-map {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 440px;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* =========================================================
   FOOTER
   ========================================================= */
#footer {
    background: var(--navy);
    padding-top: 52px;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
    padding-bottom: 44px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

.footer-nav {
    display: flex;
    gap: 8px 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: rgba(255,255,255,0.55);
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--tr);
}

.footer-nav a:hover { color: var(--white); }

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-contact a {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: color var(--tr);
}

.footer-contact a i { color: var(--red); font-size: 13px; }
.footer-contact a:hover { color: var(--white); }

.footer-bottom { padding: 20px 0; }

.footer-bottom p {
    text-align: center;
    color: rgba(255,255,255,0.28);
    font-size: 12px;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* [hidden] domyślnie ustawia display:none, ale display:flex powyżej go nadpisuje */
.lightbox[hidden] { display: none; }
.lightbox:not([hidden]) { opacity: 1; }

.lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lb-img-wrap img {
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lb-btn {
    position: fixed;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--white);
    cursor: pointer;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background var(--tr), border-color var(--tr);
}

.lb-btn:hover { background: var(--red); border-color: var(--red); }

.lb-close { top: 20px; right: 20px; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* =========================================================
   BACK TO TOP
   ========================================================= */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 28px;
    z-index: 800;
    width: 46px;
    height: 46px;
    background: var(--navy);
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--tr), transform var(--tr), background var(--tr);
}

.back-to-top[hidden]     { display: none; }
.back-to-top:not([hidden]) { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--red); border-color: var(--red); }

/* =========================================================
   ANIMACJE – fade-in przy scroll
   ========================================================= */
.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger dla kart w gridzie */
.values-grid   .value-card:nth-child(2)   { transition-delay: 0.1s; }
.values-grid   .value-card:nth-child(3)   { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.2s; }
.gallery-grid  .gallery-item:nth-child(2) { transition-delay: 0.05s; }
.gallery-grid  .gallery-item:nth-child(3) { transition-delay: 0.1s; }
.gallery-grid  .gallery-item:nth-child(4) { transition-delay: 0.15s; }
.gallery-grid  .gallery-item:nth-child(5) { transition-delay: 0.2s; }
.gallery-grid  .gallery-item:nth-child(6) { transition-delay: 0.25s; }
.gallery-grid  .gallery-item:nth-child(7) { transition-delay: 0.3s; }
.gallery-grid  .gallery-item:nth-child(8) { transition-delay: 0.35s; }
.gallery-grid  .gallery-item:nth-child(9) { transition-delay: 0.4s; }
.pricing-grid  .pricing-card:nth-child(2) { transition-delay: 0.12s; }

/* =========================================================
   RESPONSIVE – tablet (≤ 1024px)
   ========================================================= */
@media (max-width: 1024px) {
    .values-grid,
    .services-grid { grid-template-columns: 1fr 1fr; }

    .contact-grid { grid-template-columns: 1fr; gap: 36px; }
    .contact-map { height: 380px; }

    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   RESPONSIVE – mobil (≤ 768px)
   ========================================================= */
@media (max-width: 768px) {

    /* Header */
    #nav {
        position: fixed;
        top: 72px; left: 0; right: 0;
        background: rgba(1, 27, 52, 0.98);
        padding: 16px 20px 28px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--tr), opacity var(--tr);
        border-bottom: 2px solid var(--red);
    }

    #header.scrolled + * #nav,
    #nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    #nav ul { flex-direction: column; gap: 2px; }

    #nav a { font-size: 14px; padding: 11px 16px; }

    .hamburger { display: flex; }

    .btn-call span { display: none; }
    .btn-call { padding: 10px 14px; }

    /* Sections */
    .values-grid,
    .services-grid { grid-template-columns: 1fr; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    .pricing-grid { flex-direction: column; }
    .pricing-card { max-width: none; padding: 40px 32px 36px; }

    /* Hero */
    .hero-content { padding: 100px 24px 60px; }
    .hero-sub { white-space: normal; font-size: 13px; }
    .hero-stats { gap: 20px; }
    .stat:not(:last-child) { border-right: none; padding-right: 0; }

    /* Footer */
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
    .footer-logo { margin-right: 0; }

    /* Lightbox nav arrows */
    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }
}

/* =========================================================
   RESPONSIVE – małe mobile (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {
    .section { padding: 64px 0; }
    .gallery-grid { grid-template-columns: 1fr; }
    .hero-content { padding: 84px 20px 48px; }
    .hero-sub { font-size: 12px; }
    .hero-btns { flex-direction: column; }
    .btn-primary,
    .btn-outline { text-align: center; }
    .pricing-card { padding: 36px 24px 32px; }
    .price .amount { font-size: 60px; }
}
