/* === ZMIENNE I RESET (Kolorystyka ASFlex) === */
:root {
    /* Chłodny technologiczny szary z kroplą błękitu */
    --bg-color: #edf1f5; 
    
    /* ZMIENIONE: Miękki, czytelny grafit zamiast ostrej czerni (idealny do długiego czytania) */
    --text-main: #333333; 
    
    /* ZMIENIONE: Cieplejsza szarość dla tekstów pomocniczych i wstępów */
    --text-muted: #555555; 
    
    --brand-primary: #e60000; /* Twój czerwony - bez zmian */
    
    /* ZMIENIONE: Elegancki, głęboki granato-grafit (zamiast czerni) dla nagłówków H1/H2 */
    --brand-secondary: #2c3e50; 
    
    --cta-color: #e60000;
    --glass-bg: rgba(255, 255, 255, 0.95);
    /* Głębsze cienie do odcięcia kafelków od szarego tła */
    --shadow-soft: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-hover: 0 15px 30px rgba(230,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* KLASA POMOCNICZA DO BLOKOWANIA TŁA (Smart Body Freeze) */
.no-scroll {
    overflow: hidden;
    height: 100dvh;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7; /* Więcej oddechu globalnie */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Ostrzejsze, gładkie czcionki na ekranach Premium */
}

/* === ZABEZPIECZENIA FLUID MEDIA === */
img, 
video, 
iframe, 
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === KLASY POMOCNICZE === */
.brand-highlight {
    color: var(--brand-primary);
}

/* === POPRAWIONE INTRO === */
.intro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    font-size: 1.15rem; 
    color: var(--text-main); 
    font-weight: 400;
    line-height: 1.7; 
}

.footer-link-clean { 
    color: inherit; 
    text-decoration: none; 
    transition: var(--transition); /* Dodana płynność */
}

.footer-contact-info { 
    line-height: 1.8; 
}

.footer-disclaimer { 
    font-size: 12px; 
    margin-top: 20px; 
    opacity: 0.7; 
}

/* === SMART STICKY HEADER === */
#main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease-in-out;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

#main-header.scroll-up { 
    transform: translateY(0); 
}

#main-header.scroll-down { 
    transform: translateY(-100%); 
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 15px; /* Lekko zagęszczone dla smartfonów */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px; /* Safe-area: zapobiega nakładaniu się na bardzo wąskich ekranach */
}

/* Zmodyfikowana sekcja logo pod plik SVG */
.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* === NOWE: Obsługa logotypu SVG (Mobile First) === */
.brand-logo {
    width: auto;
    max-height: 32px; /* Zmniejszone z 38px dla oddania priorytetu CTA */
    display: block;
    transition: var(--transition);
}

/* === PRZYCISKI CTA (Nagłówek) === */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--cta-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 800; /* Pogrubione dla czytelności */
    transition: var(--transition);
    font-size: clamp(17px, 4.5vw, 19px); /* Powiększony font numeru */
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cta-icon-small { 
    width: 21px; /* Powiększona ikona słuchawki */
    height: 21px; 
}

/* === MICRO-PATCH: Czyszczenie przycisków w wymuszonym trybie ciemnym === */
.btn-cta, 
a.btn-cta {
    outline: none !important; 
    border: 1px solid transparent; 
    -webkit-appearance: none; 
    box-shadow: none; 
}

a, button {
    -webkit-tap-highlight-color: transparent; 
}

/* WERSJA MOBILE: Ukrywanie elementów desktopowych */
.desktop-right-wrapper { 
    display: none; 
}

.header-cta-mobile { 
    display: inline-flex; 
}

/* === HAMBURGER MENU (MOBILE) - Wersja Premium === */
.hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px; /* Powiększony, wygodny obszar kliknięcia dla touch-target */
    height: 44px; 
    position: relative;
    z-index: 1001;
    margin-left: 5px; /* Bezpieczny odstęp od przycisku CTA */
}

.hamburger-svg {
    display: block;
    width: 34px; /* Zwiększony wektor na prośbę */
    height: 34px;
    color: var(--brand-secondary);
    transition: color 0.3s ease;
}

.hamburger-svg .line {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform-origin: 12px 12px;
}

/* Perfekcyjna matematyczna symetria rotacji na środku osi X/Y */
.hamburger.active .line.top {
    transform: rotate(45deg) translate(0, 6px);
}

.hamburger.active .line.middle {
    opacity: 0;
}

.hamburger.active .line.bottom {
    transform: rotate(-45deg) translate(0, -6px);
}

/* === MENU MOBILNE (Premium Glass) === */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100dvh;
    background-color: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 20px 40px; 
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.4s ease, visibility 0.4s;
    z-index: 999;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
}

.mobile-menu.active {
    right: 0;
    opacity: 1;
    visibility: visible;
}

.mobile-menu ul { 
    list-style: none; 
    text-align: center; 
    width: 100%; 
}

.mobile-menu ul li { 
    margin-bottom: 30px; 
}

.mobile-menu ul li a {
    font-size: clamp(1.4rem, 6vw, 2.2rem); 
    font-weight: 700;
    color: var(--brand-secondary);
    text-decoration: none;
    display: block;
    padding: 10px;
    transition: opacity 0.2s ease;
}

/* Natywne przygaszenie linku przy dotyku (zamiast zmiany koloru) */
.mobile-menu ul li a:active {
    opacity: 0.5;
}

/* === GŁÓWNA ZAWARTOŚĆ === */
main {
    margin-top: 100px; 
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--brand-secondary);
    font-weight: 700;
}

/* === KAFELKI PRO-LEVEL === */
.services-grid {
    display: grid;
    /* OFICJALNY STANDARD V2.9: 280px dla lepszego RWD */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.service-tile {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
    border-top: 4px solid var(--brand-primary); 
    text-align: center;
    text-decoration: none; 
    color: inherit; 
    cursor: pointer;
}

.tile-icon-wrapper {
    background-color: rgba(26, 26, 26, 0.03);
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.tile-icon-wrapper svg {
    width: 64px;
    height: 64px;
    color: var(--brand-primary);
    transition: var(--transition);
}

.tile-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 30px 24px;
}

.tile-title {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: var(--brand-secondary);
    font-weight: 700;
}

.tile-desc {
    margin: 0 0 25px 0;
    font-size: 0.95rem;
    color: var(--text-main); 
    line-height: 1.6;
}

.btn-tile-link {
    margin-top: auto;
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--brand-secondary);
    color: #ffffff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === ŚRODKOWY PRZYCISK CTA === */
.cta-container { 
    display: flex; 
    justify-content: center; 
    margin-bottom: 60px; 
    margin-top: 40px; 
}

.cta-tile { 
    background-color: var(--cta-color); 
    color: #fff; 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    width: 100%; 
    border-radius: 8px; 
    text-decoration: none; 
    transition: var(--transition); 
    box-shadow: var(--shadow-soft); 
}

.cta-icon-large { 
    width: 64px; 
    height: 64px; 
    transition: transform 0.3s ease; 
}

.cta-text-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

@keyframes ringPhone {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(10deg); }
}

.cta-text-top { 
    font-size: clamp(1.2rem, 3vw, 1.8rem); 
    font-weight: 700; 
}

.cta-text-bottom { 
    font-size: clamp(1.5rem, 5vw, 2.5rem); 
    font-weight: 800; 
    letter-spacing: 2px; 
}

/* === MIKRO-INTERAKCJE DOTYKOWE (Pro-Level UX) === */
/* Natychmiastowa reakcja na nacisk - imitacja fizycznego przycisku */
.service-tile:active,
.cta-tile:active,
.btn-cta:active {
    transform: scale(0.98);
}

/* === IKONY FACEBOOK & EMAIL (BAZOWE STYLE) === */
.header-facebook {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--brand-secondary);
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.header-facebook svg {
    color: #ffffff;
}

.footer-facebook {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.footer-facebook svg {
    color: var(--brand-secondary);
    transition: var(--transition);
}

.email-footer-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.address-link {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    gap: 6px; /* Odstęp między ikonką a tekstem */
    color: inherit;
    text-decoration: none;
    padding: 4px 0;       
    margin: -4px 0;       
    transition: var(--transition);
}

.pin-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* === STOPKA GLOBALNA === */
footer { 
    background-color: var(--brand-secondary); 
    color: #fff; 
    padding: 40px 20px 20px; 
    text-align: center; 
    margin-top: 60px; 
}

.footer-content { 
    max-width: 1200px; 
    margin: 0 auto 30px; 
}

.social-icons { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin-bottom: 20px; 
}

.social-icons a { 
    color: #fff; 
    text-decoration: none; 
    font-weight: 600; 
    transition: var(--transition); 
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    opacity: 0.8;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom a { 
    color: #fff; 
    text-decoration: none; 
    transition: var(--transition); 
}

/* === MEDIA QUERIES - DESKTOP (>1024px) === */
@media (min-width: 1024px) {
    main { 
        margin-top: 160px; 
    } 
    
    .hamburger, 
    .mobile-menu, 
    .header-cta-mobile { 
        display: none !important; 
    }

    .header-container { 
        align-items: stretch; 
        padding: 10px 20px; 
        min-height: 130px; 
        gap: 0; 
    }

    .logo { 
        display: flex; 
        align-items: center; 
    }

    .brand-logo {
        max-height: 55px; 
    }

    .desktop-right-wrapper { 
        display: flex; 
        flex-direction: column; 
        flex-grow: 1; 
        margin-left: 40px; 
    }

    .top-bar-above { 
        display: flex; 
        justify-content: flex-end; 
        align-items: center; 
        flex: 1; 
        gap: 25px; 
        padding-bottom: 10px; 
    }

    .email-header { 
        font-weight: 600; 
        font-size: 14px; 
        color: var(--text-main); 
        text-decoration: none; 
        transition: color 0.3s ease; 
    }

    .desktop-line { 
        width: 100%; 
        height: 1px; 
        background-color: rgba(0,0,0,0.1); 
        flex: 0 0 1px; 
    }

    .desktop-nav-wrapper { 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        flex: 2; 
        padding-top: 10px; 
    }

    .desktop-nav { 
        display: flex; 
        justify-content: center; 
        gap: clamp(15px, 3vw, 40px); 
        list-style: none; 
    }

    .desktop-nav > li > a { 
        position: relative; 
        text-decoration: none; 
        color: var(--brand-secondary); 
        font-weight: 600; 
        white-space: nowrap; 
        font-size: clamp(15px, 1.5vw, 18px); 
        transition: color 0.2s ease; 
        padding-bottom: 4px; 
    }

    .cta-tile { 
        width: 60%; 
        flex-direction: row; 
        justify-content: center; 
        gap: 40px; 
    }
    
    .cta-text-wrapper { 
        align-items: flex-start; 
        text-align: left; 
    }

    .footer-bottom { 
        flex-direction: row; 
        justify-content: space-between; 
    }
}

/* === ZABEZPIECZENIE EFEKTÓW HOVER (Smartfony / Tablety) === */
/* Ta reguła sprawia, że zmiana koloru występuje TYLKO na urządzeniach z kursorem (myszką) */
@media (hover: hover) and (pointer: fine) {
    /* Przyciski CTA */
    .btn-cta:hover { 
        background-color: #b82d17; 
    }
    .cta-tile:hover { 
        background-color: #b82d17; 
        transform: translateY(-8px); 
        box-shadow: var(--shadow-hover); 
    }
    .cta-tile:hover .cta-icon-large { 
        animation: ringPhone 0.5s ease-in-out infinite alternate; 
    }

    /* Kafelki Główne Usług */
    .service-tile:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-hover);
        border-color: rgba(230, 0, 0, 0.1);
        border-top: 4px solid var(--brand-primary); 
    }
    /* Zabezpieczenie przed "skakaniem" kafelków przy klikaniu myszką */
    .service-tile:active:hover,
    .cta-tile:active:hover {
        transform: translateY(-8px) scale(0.98);
    }
    
    .service-tile:hover .tile-icon-wrapper {
        background-color: rgba(230, 0, 0, 0.05);
    }
    .service-tile:hover .tile-icon-wrapper svg {
        transform: scale(1.1);
    }
    .service-tile:hover .btn-tile-link {
        background-color: var(--brand-primary);
    }

    /* Ikony Facebook i E-mail (Nagłówek i Stopka) */
    .header-facebook:hover {
        background-color: var(--brand-primary);
    }
    .footer-facebook:hover {
        background-color: var(--brand-primary);
    }
    .footer-facebook:hover svg {
        color: #ffffff;
    }
    .email-footer-link:hover {
        color: var(--brand-primary);
    }
    .email-header:hover {
        color: var(--brand-primary); 
    }
    .footer-link-clean:hover {
        color: var(--brand-primary);
    }
    .address-link:hover {
        color: var(--brand-primary) !important;
    }

    /* Linki Tekstowe i Menu */
    .social-icons a:hover { 
        color: var(--brand-primary); 
    }
    .footer-bottom a:hover { 
        color: var(--brand-primary); 
    }
    .desktop-nav > li > a:hover { 
        color: var(--brand-primary); 
    }

    /* Animacja Linii w Menu Głównym na Desktop */
    .desktop-nav > li > a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: var(--brand-primary);
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.3s ease-in-out;
        will-change: transform;
    }
    .desktop-nav > li > a:hover::after {
        transform: scaleX(1);
    }
}

/* =========================================
   NOWE STYLE DLA SZEROKICH BLOKÓW (FILARY I STRONA GŁÓWNA)
   Zgodne z Instrukcją v2.8 - Zoptymalizowane RWD
   ========================================= */
.pillar-container {
    max-width: 900px;
    margin: 0 auto;
    /* Usunięte boczne 20px, ponieważ główny tag <main> już daje 20px marginesu */
    padding: 2rem 0; 
}

.intro-text-direct {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    color: var(--text-main);
}

.wide-block {
    background-color: #fcfcfc;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.wide-block.last-block {
    margin-bottom: 4rem;
}

.wide-block h2 {
    color: var(--brand-secondary);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.75rem;
}

.package-intro {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.block-content h3 {
    color: var(--brand-secondary); 
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.block-content p {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-main);
}

/* =========================================
   RESPONSYWNOŚĆ DLA SZEROKICH BLOKÓW (MOBILE FIRST)
   ========================================= */
@media (max-width: 768px) {
    .pillar-container {
        padding: 1rem 0;
    }

    .wide-block {
        /* Radykalne zmniejszenie marginesu wewnętrznego na telefonach! 
           Tekst będzie idealnie szeroki, bez "pudełka w pudełku" */
        padding: 1.5rem 1rem; 
        border-radius: 6px;
    }
    
    .wide-block h2 {
        font-size: 1.3rem;
    }
}

/* Style dla zdjęć pomiędzy blokami tekstowymi */
.content-image {
    display: block;
    width: 100%;
    max-width: 1000px; /* Trzyma zdjęcie w szerokości równej kafelkom tekstowym */
    height: auto;
    margin: 3rem auto; /* Utrzymuje równy odstęp od bloku górnego i dolnego */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* === DOSTĘPNOŚĆ - FOCUS VISIBLE (PROFESSIONAL 2026) === */
.btn-cta:focus-visible,
.cta-tile:focus-visible,
.desktop-nav > li > a:focus-visible {
    outline: 4px solid var(--brand-secondary) !important;
    outline-offset: 4px;
    border-radius: 6px;
}

.service-tile:focus-visible {
    outline: 4px solid var(--brand-primary);
    outline-offset: 4px;
    border-radius: 8px;
}