/* === USTAWIENIA GŁÓWNE I KOLORY === */
:root {
    --primary-color: #2E8B57; /* Zieleń (zaufanie, ogród) */
    --primary-color-dark: #27794C; /* Ciemniejsza zieleń do gradientu */
    --action-color: #FF6B35;  /* Pomarańcz (wezwanie do akcji) */
    --action-color-dark: #F75C27; /* Ciemniejszy pomarańcz do gradientu */
    --whatsapp-color: #25D366;/* Zieleń WhatsApp */
    --dark-text: #212529;     /* Ciemny tekst (czytelność) */
    --light-bg: #f8f9fa;      /* Jasne tło */
    --white: #ffffff;
    /* === KOLORY DLA USŁUG === */
    --color-grass: #E4F5E9;   /* Jasnozielony dla trawy */
    --color-paint: #FEF2E5;   /* Brzoskwiniowy dla farby */
    --color-garden: #EBF5FF;  /* Błękitny dla ogrodu/nieba */
    --color-house: #F4E8D1;   /* Piaskowy dla domu */
    --color-mail: #DDE3E8;    /* Szary dla ulotek */
    --color-other: #EAEAEA;   /* Neutralny szary dla reszty */
}

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

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: var(--white); /* === NOWE === */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0; /* === ZMODYFIKOWANE (więcej przestrzeni) === */
    overflow-x: hidden; /* === NOWE (zapobiega poziomemu scrollowi przy animacjach) === */
}

h1, h2 {
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px; /* === ZMODYFIKOWANE === */
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; color: var(--primary-color); }
p { font-size: 1.1rem; }

/* === NOWE ANIMACJE WEJŚCIA === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === PRZYCISKI (BUTTONS) - ZMODYFIKOWANE === */
.btn {
    display: inline-block;
    padding: 15px 30px; /* Większe, wygodniejsze przyciski */
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Płynne przejścia */
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Delikatny cień */
}
.btn:hover {
    transform: translateY(-5px); /* Efekt uniesienia */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Mocniejszy cień na hover */
}
.btn-primary { 
    background: linear-gradient(135deg, var(--action-color), var(--action-color-dark)); /* Gradient */
    color: var(--white);
}
.btn-secondary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark)); /* Gradient */
    color: var(--white);
}
.btn-whatsapp { background: var(--whatsapp-color); color: var(--white); }

/* Dodatkowe style dla przycisków w Hero */
.hero-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start; /* Wyrównanie do lewej strony w widoku web */
    margin-top: 40px; /* Zamiast marginesu na .subtitle */
}
.hero-buttons .btn {
    padding: 15px 25px; /* Możemy je trochę zmniejszyć, jeśli potrzeba */
}

/* Specjalny hover dla przycisków hero - łączy uniesienie z powiększeniem ikony */
.hero-buttons .btn:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}
/* Usuń margines dolny z .subtitle, bo jest teraz na .hero-buttons */
.hero-section .subtitle {
    margin: 20px 0 0 0;
}

/* Na telefonach przyciski powinny być pod sobą */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column; /* Jeden pod drugim */
        align-items: center; /* Wyśrodkowanie w osi */
        justify-content: center; /* Wyśrodkowanie w poziomie na mobile */
    }
    .hero-buttons .btn {
        width: 80%; /* Przyciski zajmują większość szerokości */
        text-align: center;
    }
}


/* === SEKCJA HERO - ZMODYFIKOWANE === */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url('../img/maks-hero.webp') center/cover no-repeat;
    color: var(--white);
    text-align: left;
    padding-top: 200px;
    padding-bottom: 20px;
    min-height: 100vh; /* Minimalna wysokość sekcji */
    position: relative;
}

/* Numer telefonu w prawym górnym rogu */
.hero-phone-number {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
}

.hero-phone-number .phone-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-phone-number .phone-link:hover {
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
}

.hero-phone-number .phone-link i {
    font-size: 1.2rem;
    animation: gentleShake 3s ease-in-out infinite;
    animation-delay: 1s;
    display: inline-block;
}

.hero-phone-number .phone-link:hover i {
    animation-play-state: paused;
    transform: scale(1.2);
}

/* Dla ekranów średnich - lepsze dopasowanie */
@media (min-width: 1200px) and (max-width: 1399px) {
    .hero-section {
        background-size: cover;
        background-position: left center;
        min-height: 60vh;
        padding: 100px 0;
    }
}

/* Dla bardzo szerokich ekranów - zapewniamy pełną widoczność zdjęcia */
@media (min-width: 1400px) {
    .hero-section {
        background-size: cover;
        background-position: left center;
        background-repeat: no-repeat;
        min-height: 80vh; /* Wysokość 80% viewport */
        padding: 80px 0;
    }
}
.hero-section h1 { 
    margin-top: 150px;
    animation: fadeIn 1s ease-out;
    text-align: left;
}
.hero-section .subtitle {
    max-width: 600px;
    margin: 20px 0 40px 0;
    font-size: 1.2rem;
    animation: fadeIn 1s ease-out 0.3s; /* Opóźniona animacja */
    animation-fill-mode: both;
}
.hero-section .btn {
    animation: slideInUp 0.8s ease-out 0.6s;
    animation-fill-mode: both;
}


/* === SEKCJA O MNIE - ZMODYFIKOWANE === */
.about-section { background-color: var(--white); }
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
}
.about-image img {
    max-width: 320px;
    border-radius: 50%;
    border: 7px solid var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Cień pod zdjęciem */
    animation: fadeIn 1.2s;
}
.about-text { animation: slideInUp 1s 0.2s; animation-fill-mode: both; }
.about-text h2 { text-align: left; }
.counter-box {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-left: 5px solid var(--action-color);
}
.counter-box h3 { font-size: 1.5rem; }

/* === SEKCJA USŁUGI - ZMODYFIKOWANE Z NOWYMI KARTAMI === */
.services-section { background-color: var(--light-bg); }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}
.service-item {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideInUp 0.8s;
    animation-fill-mode: both;
}
.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.service-icon-background {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.service-item:hover .service-icon-background {
    transform: scale(1.1);
}
.service-item i {
    font-size: 2.5rem;
    color: var(--dark-text); /* Ikona będzie teraz czarna dla kontrastu */
}
.service-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
}
/* Aplikowanie kolorów tła dla ikon */
.service-item.grass .service-icon-background { background-color: var(--color-grass); }
.service-item.paint .service-icon-background { background-color: var(--color-paint); }
.service-item.garden .service-icon-background { background-color: var(--color-garden); }
.service-item.house .service-icon-background { background-color: var(--color-house); }
.service-item.mail .service-icon-background { background-color: var(--color-mail); }
.service-item.other .service-icon-background { background-color: var(--color-other); }

/* Opóźnienia animacji */
.service-item:nth-child(2) { animation-delay: 0.1s; }
.service-item:nth-child(3) { animation-delay: 0.2s; }
.service-item:nth-child(4) { animation-delay: 0.3s; }
.service-item:nth-child(5) { animation-delay: 0.4s; }
.service-item:nth-child(6) { animation-delay: 0.5s; }

.service-item:hover {
    transform: translateY(-8px); /* Efekt uniesienia */
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.service-item i {
    font-size: 2.5rem; /* Powiększone ikony */
    color: var(--action-color);
    display: block;
    margin-bottom: 15px;
}

/* === SEKCJA DLACZEGO WARTO === */
.why-me-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 kolumny na desktop */
    gap: 25px;
}

.why-me-item {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.why-me-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.why-me-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    transition: transform 0.3s ease;
}

.why-me-item:hover .why-me-icon {
    transform: scale(1.1);
}

.why-me-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.why-me-item h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.why-me-item p {
    font-size: 1rem;
    color: var(--dark-text);
}

/* Opóźnienia animacji */
.why-me-item:nth-child(1) { animation: slideInUp 0.8s; animation-fill-mode: both; }
.why-me-item:nth-child(2) { animation: slideInUp 0.8s 0.1s; animation-fill-mode: both; }
.why-me-item:nth-child(3) { animation: slideInUp 0.8s 0.2s; animation-fill-mode: both; }
.why-me-item:nth-child(4) { animation: slideInUp 0.8s 0.3s; animation-fill-mode: both; }

/* Responsywność dla sekcji Dlaczego warto */
@media (max-width: 768px) {
    .why-me-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* === SEKCJA MAPA === */
.map-section { text-align: center; background-color: var(--light-bg); }
.map-section p { max-width: 600px; margin: 0 auto 30px; }
.map-section img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s ease;
}
.map-section img:hover { transform: scale(1.03); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }

.map-container {
    position: relative;
    display: inline-block;
}

.map-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s ease;
    overflow: hidden;
}

.map-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.map-button i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.map-button-text {
    font-size: 0.7rem;
    color: var(--dark-text);
    text-align: center;
    padding: 0 5px;
    display: none; /* Domyślnie ukryty tekst */
}

/* Pokaż tekst na większych ekranach */
@media (min-width: 769px) {
    .map-button {
        width: auto;
        height: auto;
        padding: 15px;
    }
    
    .map-button i {
        margin-bottom: 10px;
    }
    
    .map-button-text {
        display: block;
    }
}

/* === SEKCJA KONTAKT - ZMODYFIKOWANE === */
.contact-section {
    background: linear-gradient(135deg, var(--primary-color-dark), var(--primary-color));
    color: var(--white);
    text-align: center;
}
.contact-section h2 { color: var(--white); }
.contact-section .phone-number { 
    font-size: 2rem; 
    font-weight: 700; 
    margin: 20px 0 30px;
    display: inline-block;
    color: var(--white);
}

.contact-section .phone-number a {
    color: var(--white);
    text-decoration: none;
}

.contact-section .phone-number a:hover,
.contact-section .phone-number a:visited {
    color: var(--white);
    text-decoration: none;
}
.contact-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.contact-buttons .btn { background: var(--white); color: var(--primary-color); }
.contact-buttons .btn:hover { background: var(--white); color: var(--primary-color); } /* Unikamy zmiany koloru */
.contact-buttons .btn-whatsapp { background: var(--whatsapp-color); color: var(--white); }
.promo-info { margin-top: 30px; font-style: italic; opacity: 0.9; }

/* === LIGHTBOX === */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    /* POPRAWIONE DLA MOBILE */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

#lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* POPRAWIONE DLA MOBILE */
    transform-origin: center center;
    -webkit-transform-origin: center center;
    touch-action: none; /* Zapobiega domyślnym gestom przeglądarki */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

#lightbox-image.zoomed {
    cursor: grab;
    transition: none; /* Usuń transition podczas zoomowania dla płynności */
    /* POPRAWIONE DLA MOBILE - wizualny wskaźnik zoomu */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

#lightbox-image.zoomed:active {
    cursor: grabbing;
    /* POPRAWIONE DLA MOBILE - feedback podczas przesuwania */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* Animacje dla lightbox */
.lightbox.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.lightbox.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Animacja potrząsania dla ikon CTA */
@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px) scale(1.1); }
    20%, 40%, 60%, 80% { transform: translateX(4px) scale(1.1); }
}

/* Animacja shake z rotacją i rzadszymi przerwami */
@keyframes gentleRotateShake {
    0%, 25% { transform: rotate(0deg) scale(1); }
    5% { transform: rotate(-2deg) scale(1.02); }
    10% { transform: rotate(2deg) scale(1.02); }
    30%, 55% { transform: rotate(0deg) scale(1); }
    35% { transform: rotate(-1deg) scale(1.02); }
    40% { transform: rotate(1deg) scale(1.02); }
    60%, 85% { transform: rotate(0deg) scale(1); }
    65% { transform: rotate(-2deg) scale(1.02); }
    70% { transform: rotate(2deg) scale(1.02); }
    90%, 100% { transform: rotate(0deg) scale(1); }
}

/* Delikatniejsza animacja dla numeru telefonu */
@keyframes gentleShake {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-1px) scale(1.02); }
    75% { transform: translateX(1px) scale(1.02); }
}

.hero-buttons .btn i {
    animation: gentleRotateShake 6s ease-in-out infinite !important;
    animation-delay: 1s !important; /* Opóźnienie startu animacji */
    transition: transform 0.3s ease;
    display: inline-block; /* Ważne dla animacji */
}

/* Różne opóźnienia dla różnych przycisków */
.hero-buttons .btn:nth-child(1) i {
    animation-delay: 1s !important;
}

.hero-buttons .btn:nth-child(2) i {
    animation-delay: 4s !important;
}

/* Efekty hover dla ikon */
.hero-buttons .btn:hover i {
    animation-play-state: paused !important;
    transform: scale(1.2) !important;
}

.contact-buttons .btn:hover i {
    animation-play-state: paused !important;
    transform: scale(1.2) !important;
}

/* Animacja dla przycisków w sekcji kontakt */
.contact-buttons .btn i {
    animation: gentleRotateShake 8s ease-in-out infinite !important;
    animation-delay: 2s !important; /* Dłuższe opóźnienie dla sekcji kontakt */
    transition: transform 0.3s ease;
    display: inline-block;
}

.contact-buttons .btn:nth-child(1) i {
    animation-delay: 2s !important;
}

.contact-buttons .btn:nth-child(2) i {
    animation-delay: 5s !important;
}

.contact-buttons .btn:nth-child(3) i {
    animation-delay: 8s !important;
}

.contact-buttons .btn:hover i {
    animation-play-state: paused;
}

/* === STOPKA === */
footer { background: var(--dark-text); color: var(--white); text-align: center; padding: 40px 0; }
footer .credits { margin-top: 20px; font-size: 0.9rem; opacity: 0.7; }

/* === RESPONSIVE DESIGN (MOBILE) === */
@media (max-width: 768px) {
    section { padding: 60px 0; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    
    .about-container { flex-direction: column; text-align: center; }
    .about-text h2 { text-align: center; }
    
    .contact-buttons { flex-direction: column; align-items: center; width: 80%; margin: 0 auto; }
    .contact-buttons .btn { width: 100%; }
    
    /* === SEKCJA HERO - ZMODYFIKOWANE Z MYŚLĄ O MOBILE === */
    .hero-section {
        /* Nadpisujemy style dla telefonów */
        background-image: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url('../img/maks-hero.webp');
        background-position: calc(100% - 25%) center; /* Przesunięcie o 25% w prawo */
        background-size: cover; /* Pełna wysokość */
        text-align: center; /* Wyśrodkowujemy CAŁY tekst */
        padding: 0; /* Usuwamy padding */
        min-height: 100vh; /* Pełna wysokość ekranu */
        display: flex;
        align-items: flex-end; /* Przesunięcie na dół */
        justify-content: center; /* Wyśrodkowanie w poziomie */
        padding-bottom: 100px; /* Dodajemy padding na dole */
    }
    
    .hero-section h1,
    .hero-section .subtitle {
        text-align: center; /* Dodatkowe upewnienie się, że tekst jest na środku */
        max-width: 100%; /* Tekst zajmuje całą dostępną szerokość */
    }
    
    .hero-section h1 {
        margin-top: 0; /* Usuwamy margines górny w widoku mobilnym */
    }
    
    /* Numer telefonu w widoku mobilnym */
    .hero-phone-number {
        top: 20px;
        right: 20px;
    }
    
    .hero-phone-number .phone-link {
        padding: 10px 16px;
        font-size: 1rem;
    }
    
    .hero-phone-number .phone-link span {
        display: none; /* Ukrywamy tekst na bardzo małych ekranach */
    }
    
    .hero-phone-number .phone-link i {
        font-size: 1.3rem;
    }
    
    .hero-section .subtitle {
        margin: 20px auto 40px auto; /* Wyśrodkowanie subtitle w widoku mobilnym */
    }
    
    /* === SEKCJA DLACZEGO WARTO - POPRAWA RESPONSYWNOŚCI === */
    .why-me-section li {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        margin-bottom: 30px; /* Większy odstęp między elementami */
    }
    
    .why-me-section i {
        margin-bottom: 10px;
    }
    
    .why-me-section strong {
        display: block; /* Wyśrodkowanie tytułu */
        margin-bottom: 5px;
    }

    /* POPRAWIONE DLA MOBILE - lepsze style dla lightbox */
    .lightbox-content {
        padding: 10px;
    }
    
    #lightbox-image {
        border-radius: 4px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
