:root {
    /* KOLORYSTYKA POBRANA Z LOGO OSP ŻYRARDÓW */
    --osp-yellow: #FFD700; /* Żółty z napisów "OSP ŻYRARDÓW" */
    --osp-red: #D2141C;    /* Czerwień z płomieni */
    --osp-bg: #01020a;     /* Bardzo ciemne tło */
    --text-white: #ffffff;
    --text-grey: #b0b0b0;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--osp-bg);
    color: var(--text-white);
}

h1, h2, h3, h4, h5 {
    font-family: 'Merriweather Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Nawigacja --- */
.navbar {
    background-color: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #222;
    padding: 10px 0;
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    height: 65px;
    margin-right: 15px;
}

.nav-link {
    color: var(--text-white) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-left: 20px;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--osp-yellow) !important;
}

/* Nieaktywny przycisk alarmowy (wygląd) */
.alarm-btn {
    background-color: transparent;
    color: var(--osp-red);
    border: 2px solid var(--osp-red);
    padding: 8px 20px;
    font-weight: 800;
    border-radius: 5px;
    text-decoration: none;
    cursor: default;
    display: inline-block;
}

.alarm-btn:hover {
    background-color: transparent;
    color: var(--osp-red);
}

/* --- Hero Section --- */
.hero-section {
    padding: 140px 0;
    text-align: center;
    background: linear-gradient(to bottom, rgba(1, 2, 10, 0.7), rgba(1, 2, 10, 0.9)), url('../images/background.jpeg');
    background-size: cover;
    background-position: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--osp-yellow);
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.btn-cta {
    background-color: var(--osp-red);
    color: white;
    border: none;
    padding: 15px 40px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1rem;
    border-radius: 4px;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-cta:hover {
    background-color: #a80f15;
    transform: translateY(-3px);
    color: white;
}

/* --- Sekcje Tekstowe i Kafelki --- */
.section-padding {
    padding: 80px 0;
}

.section-header h2 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--osp-yellow);
    font-weight: 400;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Karty obracane */
.flip-card {
    background-color: transparent;
    height: 320px;
    perspective: 1000px;
    margin-bottom: 30px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border: 1px solid #222;
}

.flip-card-front {
    background-color: #050a14;
    color: white;
    border-bottom: 4px solid var(--osp-yellow);
}

.flip-card-back {
    background-color: var(--osp-red);
    color: white;
    transform: rotateY(180deg);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: var(--osp-yellow);
}

/* --- STOPKA --- */
footer {
    background-color: #000000;
    padding: 80px 0 40px;
    font-size: 0.9rem;
    border-top: 1px solid #1a1a1a;
}

.footer-logo-container {
    text-align: center;
}

.footer-logo {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.1));
}

.footer-section-title {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.visit-us-label {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: block;
}

/* --- IKONY SPOŁECZNOŚCIOWE (NAPRAWA SKALOWANIA) --- */
.social-icons {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
    overflow: visible;
}

.social-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 42px; /* Stały rozmiar */
    height: 42px;
    background-color: var(--osp-yellow);
    color: black !important;
    border-radius: 50%;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1.1rem;
    position: relative;
    flex-shrink: 0; /* TO ROZWIĄZUJE PROBLEM: ikona nie zniknie (nie skurczy się do 0px) */
}

/* Fix dla napisu MDP, żeby nie rozwalał koła */
.mdp-label {
    position: absolute;
    bottom: -5px;
    right: -5px;
    z-index: 5;
}

/* Poprawka dla kontenerów w stopce na mobile */
@media (max-width: 768px) {
    .footer-section-title {
        text-align: center;
        margin-top: 30px;
    }
    
    .social-icons {
        justify-content: center; /* Na telefonie lepiej wyglądają wyśrodkowane */
    }
    
    /* Jeśli stopka "ucieka", upewnij się, że kolumny mają 100% szerokości */
    .footer-logo-container {
        margin-bottom: 40px;
    }
}

/* Usuwamy margines z ostatniej ikony, żeby całość była idealnie na środku */
.social-circle:last-child {
    margin-right: 0;
}

.social-circle:hover {
    background-color: white;
    color: black;
}

/* --- IKONA MDP (Etykietka) --- */
.mdp-label {
    position: absolute;
    bottom: -4px;
    right: -6px;
    background-color: var(--osp-red);
    color: white;
    font-size: 0.55rem; /* Bardzo mała czcionka */
    font-weight: 900;
    padding: 2px 3px;
    border-radius: 3px;
    line-height: 1;
    box-shadow: 0 0 0 1px #000; /* Czarna obwódka dla kontrastu */
    z-index: 10; /* Zawsze na wierzchu */
    pointer-events: none; /* Żeby kliknięcie w napis też klikało w link */
}

/* Dane kontaktowe */
.contact-highlight {
    color: var(--osp-yellow);
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
    text-decoration: none;
    cursor: default;
}

a.contact-highlight {
    cursor: pointer;
}

a.contact-highlight:hover {
    color: white;
}

.unit-name {
    text-transform: uppercase;
    margin-top: 25px;
    margin-bottom: 15px;
    display: block;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.address-block {
    color: var(--text-white);
    margin-bottom: 20px;
    line-height: 1.6;
}

.meta-data {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* --- DYNAMICZNY NUMER KONTA (NAPRAWA DLA iPHONE) --- */
.bank-details .d-block.mt-1 {
    display: block;
    width: 100%;
    /* white-space: nowrap; usuwamy to, jeśli chcemy pozwolić na bardzo mały font, 
       ale lepiej użyć poniższego: */
    
    /* Font będzie miał od 0.8rem do 1.1rem w zależności od szerokości ekranu */
    font-size: clamp(0.75rem, 3.2vw, 1.0rem) !important;
    
    font-family: monospace;
    letter-spacing: -0.5px; /* Lekkie ścieśnienie liter pomaga na iOS */
    word-spacing: -1px;
    color: white;
    text-align: left;
}

/* Dodatkowe zabezpieczenie dla bardzo wąskich ekranów (poniżej 380px) */
@media (max-width: 380px) {
    .bank-details .d-block.mt-1 {
        letter-spacing: -1px; /* Jeszcze mocniejsze ścieśnienie na małych iPhoneach */
        font-size: 0.75rem !important;
    }
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 15px;
}

.footer-menu a {
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.footer-menu a:hover {
    color: var(--osp-yellow);
}

/* --- MODAL i FORMULARZE (Inputy oraz Selecty) --- */
.modal-content {
    background-color: #111;
    color: white;
    border: 1px solid #333;
}

.form-control,
.form-select {
    background-color: #222;
    border: 1px solid #333;
    color: white;
}

.form-control:focus,
.form-select:focus {
    background-color: #222;
    color: white;
    border-color: var(--osp-yellow);
    box-shadow: 0 0 0 0.25rem rgba(255, 215, 0, 0.25);
    outline: none;
}

.form-select option {
    background-color: #000;
    color: white;
    padding: 10px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* --- Dodatki do Polityki Prywatności --- */
.btn-back {
    color: white;
    border: 1px solid var(--osp-yellow);
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-back:hover {
    background-color: var(--osp-yellow);
    color: black;
}

/* POPRAWIONA SEKCJA KONTEKSTOWA */
.policy-content {
    padding: 60px 20px; /* 60px góra/dół, 20px LEWO/PRAWO - to naprawia błąd kolegi */
    max-width: 900px;
    margin: 0 auto;
    width: 100%; /* Zapewnia, że na mobile zajmie całą dostępną szerokość minus padding */
    box-sizing: border-box; /* Gwarantuje, że padding nie "rozpcha" strony poza ekran */
}

.policy-content h1,
.policy-content h3 {
    color: var(--osp-yellow);
    margin-top: 40px;
    margin-bottom: 20px;
    word-wrap: break-word; /* Zabezpieczenie przed długimi tytułami */
}

.policy-content p {
    color: #ddd;
    margin-bottom: 15px;
    font-weight: 300;
    line-height: 1.6; /* Poprawia czytelność na telefonie */
}

.policy-content ul {
    color: #ddd;
    list-style-type: square;
    margin-bottom: 30px;
    padding-left: 20px;
}

.policy-content li {
    margin-bottom: 8px;
    word-wrap: break-word; /* Zabezpieczenie dla długich adresów e-mail/URL */
}

/* --- Podstrona Wsparcie 1.5% --- */
.krs-box {
    background-color: rgba(255, 215, 0, 0.1);
    border: 2px dashed var(--osp-yellow);
    color: var(--osp-yellow);
    font-size: 2.5rem;
    font-weight: 800;
    padding: 20px 40px;
    display: inline-block;
    margin: 20px 0;
    border-radius: 10px;
    letter-spacing: 2px;
}

.video-wrapper {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.gallery-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image-wrapper {
    overflow: hidden;
    border-radius: 8px;
}

.image-wrapper:hover .gallery-img {
    transform: scale(1.05);
    filter: brightness(1.1);
    border-color: var(--osp-yellow);
}

@media (max-width: 768px) {
    .krs-box {
        font-size: 1.8rem;
        padding: 15px 20px;
    }

    .gallery-img {
        height: 250px;
    }
}

/* --- Podstrona SPRZĘT --- */
.page-header {
    padding: 100px 0 60px;
    background: linear-gradient(to bottom, #000, var(--osp-bg));
}

.equipment-nav .nav-link {
    color: #ccc;
    background-color: #111;
    border: 1px solid #222;
    margin-bottom: 10px;
    text-align: left;
    padding: 15px 20px;
    text-transform: uppercase;
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.equipment-nav .nav-link:hover {
    color: white;
    background-color: #1a1a1a;
    border-color: #333;
    padding-left: 25px;
}

.equipment-nav .nav-link.active {
    background-color: #222;
    color: var(--osp-yellow);
    border-left: 5px solid var(--osp-yellow);
}

.equipment-nav .nav-link i {
    width: 25px;
    text-align: center;
    color: var(--osp-red);
}

.equipment-card {
    background-color: #050a14;
    border: 1px solid #222;
    padding: 30px;
    border-radius: 5px;
    animation: fadeIn 0.5s ease-in-out;
}

.specs-list {
    list-style: none;
    padding: 0;
    color: #ddd;
}

.specs-list li {
    padding: 10px 0;
    border-bottom: 1px solid #222;
}

.specs-list li:last-child {
    border-bottom: none;
}

.specs-list strong {
    color: var(--osp-yellow);
    margin-right: 10px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Podstrona O NAS (Historia) --- */
.history-year {
    color: #888;
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Merriweather Sans', sans-serif;
    opacity: 0.3;
    line-height: 1;
}

.modern-year {
    color: var(--osp-yellow);
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Merriweather Sans', sans-serif;
    line-height: 1;
}

.history-img-wrapper {
    padding: 10px;
    background-color: #f4ecd8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: rotate(-2deg);
    transition: transform 0.3s;
}

.history-img-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
    z-index: 2;
}

.history-sepia {
    filter: sepia(0.8) contrast(1.2) brightness(0.9);
    width: 100%;
    display: block;
}

.img-caption {
    display: block;
    text-align: center;
    color: #5a4a3a;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: bold;
}

/* Stylizacja zdjęcia nowoczesnego (ZMODYFIKOWANA - POCHYLONA) */
.modern-img-wrapper {
    /* Usunięcie starej czerwonej ramki */
    border: none;
    border-radius: 8px;
    overflow: hidden;
    
    /* Cień zamiast czerwonej poświaty */
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5);
    
    /* KLUCZOWA ZMIANA: Pochylenie zdjęcia o -2 stopnie (tak jak historyczne) */
    transform: rotate(-2deg);
    
    /* Płynne animacje */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efekt po najechaniu myszką: zdjęcie się prostuje i lekko powiększa */
.modern-img-wrapper:hover {
    transform: rotate(0deg) scale(1.02); /* Wyprostowanie */
    z-index: 2;
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.6);
}

.modern-img {
    width: 100%;
    display: block;
    transition: transform 0.5s;
}

/* Lekki zoom samego zdjęcia wewnątrz ramki */
.modern-img-wrapper:hover .modern-img {
    transform: scale(1.03); 
}

.sepia-filter {
    filter: sepia(0.6) grayscale(0.4);
}

/* --- Poprawka dla nagłówka na podstronie O Nas (Historia) --- */
#history-header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(1, 2, 10, 1)), url('../images/zdjecia/o_nas/6.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding-top: 150px;
    padding-bottom: 80px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    #history-header {
        padding-top: 200px !important;
        padding-bottom: 60px;
        background-position: center top !important;
        background-size: cover !important;
        min-height: 50vh;
    }

    #history-header h1 {
        font-size: 2rem;
        margin-top: 20px;
    }
}

/* --- GALERIA "POLAROID" - RESPONSYWNA --- */
.swiper {
    width: 100%;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* --- STYL DLA TELEFONÓW (Sztywne, mniejsze wymiary) --- */
.swiper-slide {
    background-color: #fff;
    padding: 6px 6px 25px 6px; /* Biała ramka */
    
    /* TU JEST ROZWIĄZANIE PROBLEMU GIGANTÓW: */
    width: 240px !important;  /* Stała szerokość */
    height: 320px !important; /* Stała wysokość */
    
    /* Mniejszy, lżejszy cień */
box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
/* Dodaj to dla płynności: */
will-change: transform;
    border-radius: 3px;
    overflow: hidden;
    transform: rotate(0deg); /* Na telefonie proste kafelki */
}

/* Zdjęcie wewnątrz ramki */
.swiper-slide img {
    display: block;
    width: 100% !important;
    height: 100% !important; /* Wypełnia całą ramkę */
    object-fit: cover; /* KLUCZOWE: przycina zdjęcie do ramki, nie rozciąga go */
    border: 1px solid #eee;
}

/* Kolory nawigacji */
.swiper-pagination-bullet-active {
    background-color: var(--osp-yellow) !important;
}
.swiper-button-next,
.swiper-button-prev {
    color: var(--osp-yellow) !important;
}

/* --- STYL DLA KOMPUTERÓW I TABLETÓW (Ekrany powyżej 768px) --- */
@media (min-width: 768px) {
    .swiper {
        padding-top: 60px;
    }

    .swiper-slide {
        width: 280px !important; /* Nieco szersze na PC */
        height: 360px !important; /* Wyższe na PC */
        padding: 10px 10px 35px 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        overflow: visible; /* Pozwala na efekt powiększenia */
        transition: all 0.4s ease;
    }

    /* Losowe obroty (tylko na dużym ekranie) */
    .swiper-slide:nth-child(odd) { transform: rotate(2deg); }
    .swiper-slide:nth-child(even) { transform: rotate(-2deg); }
    .swiper-slide:nth-child(3n) { transform: rotate(1.5deg); }
    .swiper-slide:nth-child(5n) { transform: rotate(-1.5deg); }

    /* Efekt po najechaniu myszką */
    .swiper-slide:hover {
        transform: scale(1.1) rotate(0deg) !important;
        z-index: 20;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }
}
/* --- POPRAWKA DAT NA TELEFONIE --- */
@media (max-width: 768px) {
    .history-year, 
    .modern-year {
        font-size: 2rem; /* Zmniejszamy z 3rem na 2rem */
        text-align: center; /* Wyśrodkowujemy napis */
        margin-top: 20px; /* Odstęp od zdjęcia */
        margin-bottom: 10px; /* Odstęp od tytułu poniżej */
        width: 100%; /* Pewność, że zajmuje całą szerokość */
        display: block;
    }
    
    /* Dodatkowo poprawiamy nagłówki pod datą, żeby też były na środku */
    .text-section h3 {
        text-align: center;
        font-size: 1.5rem;
    }
    
    .text-section p {
        text-align: justify; /* Tekst akapitów wyjustowany (ładniej wygląda) */
    }
}
/* Poprawka dla widgetu Siepomaga, żeby nie zasłaniał treści na mobile */
#sp-widget-container {
    bottom: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
}
