/* ==========================================================================
   1. STYLE GLOBALNE, RESET I ZABEZPIECZENIA MOBILNE (iOS/Android)
   ========================================================================== */

/* Wersja 3.22: EKSPERYMENT WIZUALNY - Ostre Rogi. Wymuszenie braku zaokrągleń dla absolutnie wszystkich elementów (w tym stylów inline w HTML i JS) */
* {
    border-radius: 0 !important; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #e5e5e5;
    color: #1f2937;
    line-height: 1.6;
    padding: 20px;
    padding-bottom: 70px; /* v1.3.0: Zmniejszono martwą strefę pod odchudzony pasek nawigacyjny */
    margin: 0;
    /* Zabezpieczenie przed samoczynnym powiększaniem tekstów przez Safari na iOS */
    -webkit-text-size-adjust: 100%;
}

/* Wersja 3.20: Kontener druku domyślnie ukryty na ekranie przeglądarki */
.print-area {
    display: none;
}

.container {
    max-width: 1050px;
    margin: 0 auto;
    background: #4b5563; /* Ciemnoszare tło główne, do którego za chwilę nawiążemy w Etapie 6 i 8 */
    border-radius: 0; /* Wersja 3.22: Ostre rogi */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    box-sizing: border-box;
}

/* ==========================================================================
   2. SEKRETY WIZUALNE: LOGO, ANIMACJE I NAGŁÓWKI
   ========================================================================== */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* Wersja 3.22: Ostre rogi */
    margin-bottom: 25px;
    padding: 15px;
    border: 2px solid #9ca3af;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: linear-gradient(-45deg, #e5e7eb, #d1d5db, #9ca3af, #f3f4f6);
    background-size: 400% 400%;
    animation: gradientWaveGray 8s ease-in-out infinite;
}

@keyframes gradientWaveGray {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-section img {
    width: 100%;
    max-width: 450px;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.15));
}

.title-box {
    background: #ffffff;
    border: 3px solid #cbd5e1;
    border-radius: 0; /* Wersja 3.22: Ostre rogi */
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: center;
}

.title-box h1 {
    color: #1f2937;
    font-size: 1.9rem;
    font-weight: 900;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.15);
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.1);
    line-height: 1.25;
}

.subtitle-highlight {
    color: #ea580c;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    display: block;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(234,88,12,0.2);
}

.animated-stage-header {
    background: linear-gradient(-45deg, #900C3F, #C70039, #831843, #BE185D);
    background-size: 400% 400%;
    animation: gradientWave 8s ease-in-out infinite;
    color: #ffffff;
    text-align: center;
    padding: 18px 20px;
    border-radius: 0; /* Wersja 3.22: Ostre rogi */
    margin-bottom: 35px;
    margin-top: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(131,24,67,0.4);
    border: 2px solid #fbcfe8;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    letter-spacing: 0.5px;
}

.stage-desc {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 8px;
    color: #fbcfe8; 
    text-shadow: none;
    letter-spacing: normal;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .stage-desc {
        font-size: 0.85rem;
        margin-top: 6px;
    }
}

@keyframes gradientWave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stage {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.stage.active {
    display: block;
}

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

/* ==========================================================================
   3. STRUKTURA SIATKI (GRID) ORAZ KARTY WYBORU (CARDS)
   ========================================================================== */
.category-section {
    box-sizing: border-box;
    margin-bottom: 40px;
    padding: 30px 25px;
    border-radius: 0; /* Wersja 3.22: Ostre rogi */
    border: 3px solid #9ca3af;
    background-color: #d1d5db;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.category-section.alt-bg {
    background-color: #e5e7eb;
    border-color: #cbd5e1;
}

.category-section:last-of-type {
    margin-bottom: 10px;
}
.category-desc {
    font-size: 1.15rem;
    color: #1f2937;
    margin: 0 0 25px 0;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.stage7-header {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 0;
}

.grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: 1fr; }
}

.card {
    border: 2px solid #ffffff;
    border-radius: 0; /* v3.22: Ostre rogi */
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    -webkit-tap-highlight-color: transparent;
}

/* v3.10: Klasa dla kart pełniących rolę tła dla innych elementów */
.static-card {
    cursor: default;
}

/* ==========================================================================
   UX WERSJA 3.17: INTELIGENTNE PULSOWANIE I NOWY MOTYW ZAZNACZENIA
   ========================================================================== */
@keyframes pulseSelectAlert {
    0%   { box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
    50%  { box-shadow: 0 0 0 2px #1f2937, 0 8px 20px rgba(31, 41, 55, 0.25); }
    100% { box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
}

/* Inteligencja CSS: Kafelki w siatce migają na czarno wyłącznie wtedy, gdy żaden z nich nie został jeszcze kliknięty! */
.grid:not(:has(.selected)) .card:not(.static-card):not(.locked-card),
.grid-3:not(:has(.selected)) .card:not(.static-card):not(.locked-card) {
    animation: pulseSelectAlert 2.5s infinite ease-in-out;
}

@media (hover: hover) {
    /* Zatrzymujemy miganie po najechaniu, aby ustabilizować kartę pod kursorem myszy (na PC) */
    .grid:not(:has(.selected)) .card:not(.static-card):not(.locked-card):hover,
    .grid-3:not(:has(.selected)) .card:not(.static-card):not(.locked-card):hover {
        animation-play-state: paused;
    }

    /* Wersja 3.17: Zmiana koloru ramki przy najechaniu z jaskrawej zieleni na profesjonalny szary */
    .card:not(.static-card):not(.locked-card):hover {
        border-color: #6b7280;
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(31, 41, 55, 0.15);
    }
}

/* Gruby obrys wpadający w czerń z wielkim, rozproszonym cieniem i poszerzeniem bez ingerencji w flexbox */
.card.selected {
    border-color: #1f2937;
    background: #f9fafb;
    box-shadow: 0 0 0 2px #1f2937, 0 12px 25px rgba(31, 41, 55, 0.25);
    transform: translateY(-2px);
    z-index: 2;
}

.card h3 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 1.1rem;
    text-align: center;
    transition: color 0.2s;
}

/* ==========================================================================
   4. ELEMENTY DODATKOWE: ODZNAKI CENOWE ORAZ BLOKI PLUSÓW I MINUSÓW
   ========================================================================== */
.price-badge {
    display: inline-table;
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 0; /* v3.22: Ostre rogi dla plakietek */
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 15px;
    align-self: center;
}

.price-badge.warning {
    background: #fee2e2;
    color: #991b1b;
}

.price-badge.info {
    background: #e5e7eb;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.card p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
    flex-grow: 1;
    text-align: justify;
}

.badge-top {
    position: absolute;
    top: -12px;
    right: -10px;
    background: #15803d;
    color: white;
    padding: 4px 12px;
    border-radius: 0; /* v3.22: Ostre rogi powiadomień na krawędzi */
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.badge-top.danger { background: #ef4444; }
.badge-top.warning { background: #f59e0b; }
.badge-top.info { background: #4b5563; }

.pros-cons {
    margin-top: 15px;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pro-box, .con-box {
    padding: 10px 10px 10px 32px;
    border-radius: 0; /* v3.22: Ostre rogi pól tekstowych plusów i minusów */
    position: relative;
    text-align: left;
}

.pro-box {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.con-box {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.pro-box::before { content: "✅"; position: absolute; left: 8px; top: 10px; }
.con-box::before { content: "❌"; position: absolute; left: 8px; top: 10px; }

/* ==========================================================================
   5. SILNIK KARUZELI I GALERII (TOUCH SWIPE OPTIMIZED)
   ========================================================================== */
.card-gallery {
    position: relative;
    width: 100%;
    height: 225px;
    margin-bottom: 15px;
    border-radius: 0; /* v3.22: Usunięto zaokrąglenia kontenera zdjęć */
    overflow: hidden;
    background: #cbd5e1;
    border: 1px solid #e5e7eb;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.card-gallery:active {
    cursor: grabbing;
}

.card-gallery::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    pointer-events: none;
    z-index: 1;
}

.gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    pointer-events: none;
}

.gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}

.gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 0; /* v3.22: Ostre rogi (zmienia kropki w kwadraty) */
    background: rgba(255,255,255,0.4);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.gallery-dot.active {
    background: rgba(255,255,255,1);
    transform: scale(1.3);
}
/* ==========================================================================
   6. INTERFEJS AUDYTU OZC I CWU: SUWAKI, POPRAWKI I ODZNAKI WYBORU
   ========================================================================== */
#grid-standard, #grid-cwu-profil, #grid-cwu-cyrkulacja {
    gap: 10px;
}

#grid-standard .card, #grid-cwu-profil .card, #grid-cwu-cyrkulacja .card {
    padding: 12px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: unset;
    border-radius: 0; /* v3.22: Ostre rogi kart audytu */
}

/* Wymuszenie czystego, białego tekstu na ciemnoszarym tle z cieniem (Z Wersji 3.21) */
#grid-standard .card h3, #grid-cwu-profil .card h3, #grid-cwu-cyrkulacja .card h3 {
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.2;
}

#grid-standard .card h3 span, #grid-cwu-profil .card h3 span, #grid-cwu-cyrkulacja .card h3 span {
    font-size: 0.75rem;
    font-weight: normal;
    color: #d1d5db !important;
    display: block;
    margin-top: 3px;
    text-shadow: none;
}

/* Tło kart audytu zintegrowane z tłem głównym aplikacji (#4b5563) (Z Wersji 3.21) */
.card-niski, .card-sredni, .card-wysoki { 
    background-color: #4b5563 !important; 
    border-color: #9ca3af !important; 
}

@media (hover: hover) {
    .card-niski:not(.selected):hover, .card-sredni:not(.selected):hover, .card-wysoki:not(.selected):hover { 
        border-color: #d1d5db !important; 
        background-color: #374151 !important;
    }
}

/* ZAZNACZENIE - Niezwykle głęboki grafit wchodzący w czerń (#1f2937) z kontrastowym cieniem (Z Wersji 3.21) */
.card-niski.selected, .card-sredni.selected, .card-wysoki.selected { 
    background-color: #1f2937 !important; 
    border-color: #111827 !important; 
    box-shadow: 0 0 0 2px #111827, 0 12px 25px rgba(17, 24, 39, 0.4) !important; 
    transform: translateY(-2px); 
    z-index: 2; 
}

.thumbs-up-badge {
    display: none;
    position: absolute;
    top: -12px;
    right: -10px;
    background: #ffffff;
    border-radius: 0; /* v3.22: Ostre rogi plakietki wyboru */
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
    text-align: center;
    line-height: 32px;
    z-index: 10;
}

.card.selected .thumbs-up-badge {
    display: block;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   SUWAKI (RANGE SLIDERS)
   ========================================================================== */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 0; /* v3.22: Ostre rogi toru suwaka */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 32px;
    width: 32px;
    border-radius: 0; /* v3.22: Kwadratowy uchwyt suwaka */
    background: #ea580c;
    cursor: pointer;
    margin-top: -12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 3px solid white;
    transition: 0.1s;
}

input[type=range]::-webkit-slider-thumb:active {
    transform: scale(1.1);
    background: #c2410c;
}

input[type=range]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 0; /* v3.22: Kwadratowy uchwyt suwaka (Firefox) */
    background: #ea580c;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ==========================================================================
   PRZYCISKI TERMOMODERNIZACJI (v3.21 - Dopasowane do audytu OZC)
   ========================================================================== */
.thermo-btn {
    padding: 12px;
    background: #4b5563 !important; /* Zmiana na ciemnoszary */
    border: 2px solid #9ca3af !important;
    border-radius: 0; /* v3.22: Ostre rogi przycisków */
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff !important; /* Odwrócenie tekstu na biały */
    flex: 1;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* Lepsza czytelność */
}

/* Sprzętowe pulsowanie przycisków Termomodernizacji dopóki żaden nie jest zaznaczony */
#thermo-grid-btns:not(:has(.selected)) .thermo-btn {
    animation: pulseSelectAlert 2.5s infinite ease-in-out;
}

@media (hover: hover) {
    #thermo-grid-btns:not(:has(.selected)) .thermo-btn:hover {
        animation-play-state: paused;
    }

    /* Wersja 3.21: Zmiana koloru na hover, aby pasowała do małych kart OZC */
    .thermo-btn:hover { border-color: #d1d5db !important; background: #374151 !important; }
}

/* Wersja 3.21: Zaznaczony guzik termomodernizacji staje się tak samo potężny jak zaznaczona karta OZC */
.thermo-btn.selected {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
    box-shadow: 0 0 0 2px #111827, 0 12px 25px rgba(17, 24, 39, 0.4) !important;
    transform: translateY(-2px);
    z-index: 2;
    position: relative;
}

/* ==========================================================================
   ALERTY I POWIADOMIENIA INŻYNIERYJNE
   ========================================================================== */
.alert-box {
    background: #ffffff;
    border: 1px solid #f59e0b;
    border-left: 5px solid #f59e0b;
    border-radius: 0; /* v3.22: Ostre rogi okien informacyjnych */
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.alert-box h3 { color: #b45309; margin-top: 0; margin-bottom: 12px; font-size: 1.25rem; }
.alert-box p { font-size: 0.95rem; color: #4b5563; margin-bottom: 12px; text-align: justify; }
.alert-box strong { color: #1f2937; }
.alert-box.danger { background: #fff5f5; border-color: #ef4444; border-left-color: #ef4444; }
.alert-box.danger h3 { color: #b91c1c; }
.alert-box.info { background: #f0fdf4; border-color: #15803d; border-left-color: #15803d; }
.alert-box.info h3 { color: #15803d; }
/* ==========================================================================
   7. MODUŁ ASORTYMENTU SKLEPOWEGO i PODSUMOWANIA WYCENY
   ========================================================================== */
.product-card {
    padding: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 0; /* v3.22: Ostre rogi kart produktów */
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

@media (hover: hover) {
    /* Szare, chłodne podświetlenie karty produktu na hover z zatrzymaniem pulsowania */
    .product-card:hover { 
        border-color: #6b7280; 
        box-shadow: 0 8px 16px rgba(31, 41, 55, 0.15); 
        transform: translateY(-3px); 
    }
}

/* Karty produktów używają jasnego tła, a grafitu jako formy zaznaczenia z cieniem */
.product-card.selected {
    border-color: #1f2937;
    background: #f9fafb;
    box-shadow: 0 0 0 2px #1f2937, 0 12px 25px rgba(31, 41, 55, 0.25);
    transform: translateY(-2px);
    z-index: 2;
}

.product-price {
    font-weight: 900;
    color: #15803d; /* Celowo zachowana zieleń symbolizująca cenę/finanse */
    font-size: 1.2rem;
    margin-bottom: 10px;
    background: #dcfce7;
    padding: 5px 10px;
    border-radius: 0; /* v3.22: Ostre rogi odznaki cenowej */
    display: inline-block;
}

/* ==========================================================================
   8. DOLNY PANEL NAWIGACYJNY (STREFA KLIKALNA SYSTEMU)
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 15px; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    z-index: 1000;
}
/* Subtelna wstążka spajająca motyw dolnego paska z nagłówkami */
.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(-45deg, #900C3F, #C70039, #ea580c, #BE185D);
    background-size: 300% 300%;
    animation: gradientWave 6s ease-in-out infinite;
}

.nav-content {
    max-width: 1050px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left, .nav-right {
    flex: 1;
    display: flex;
}
.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-center {
    flex: 2;
    text-align: center;
}

.status-text { 
    font-weight: 700; 
    color: #9ca3af; 
    font-size: 0.8rem; 
    transition: 0.3s ease;
}
.status-text.ok { color: #15803d; }

/* Przycisk Dalej (Aktywny) */
button.nav-btn {
    background: linear-gradient(-45deg, #900C3F, #C70039, #ea580c, #BE185D);
    background-size: 300% 300%;
    animation: gradientWave 5s ease-in-out infinite;
    color: white;
    border: none;
    padding: 8px 18px; 
    border-radius: 0; /* v3.22: Ostre rogi przycisku Dalej */
    font-weight: 800;
    font-size: 0.9rem; 
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(131,24,67,0.3);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    button.nav-btn:hover:not(:disabled) { 
        transform: translateY(-2px); 
        box-shadow: 0 6px 20px rgba(131,24,67,0.45); 
    }
}

/* Przycisk Dalej (Zablokowany/Loading) */
button.nav-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: none;
}

/* Wstecz & Powroty (Wersja 'Ghost / Outline') */
.btn-back {
    background: rgba(255, 255, 255, 0.8);
    color: #4b5563;
    padding: 8px 18px; 
    font-size: 0.85rem; 
    font-weight: 700;
    border: 2px solid #cbd5e1;
    box-shadow: none;
    cursor: pointer;
    border-radius: 0; /* v3.22: Ostre rogi przycisku Wstecz */
    transition: 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn-back:hover { 
        background: #f8fafc; 
        border-color: #9ca3af;
        color: #1f2937;
    }
}

/* Wielkie przyciski wywołania Akcji (Sklep, Koszyk) */
.btn-database {
    background: linear-gradient(-45deg, #ea580c, #C70039, #900C3F, #f97316);
    background-size: 300% 300%;
    animation: gradientWave 6s ease-in-out infinite;
    width: 100%;
    padding: 14px; 
    margin-top: 20px;
    margin-bottom: 20px;
    color: white;
    font-weight: bold;
    border-radius: 0;  /* v3.22: Ostre rogi wielkiego przycisku */
    border: none;
    cursor: pointer;
    font-size: 1rem; 
    box-shadow: 0 6px 15px rgba(234,88,12,0.3);
    transition: 0.3s;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn-database:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(234,88,12,0.4); }
}

/* ==========================================================================
   9. PODSUMOWANIE KOŃCOWE ORAZ INTEGRACJA KANAŁÓW KONTAKTU
   ========================================================================== */
.summary-wrapper {
    background: #ffffff;
    border-radius: 0; /* v3.22: Ostre rogi kontenera podsumowania */
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.summary-box {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 0; /* v3.22: Ostre rogi */
    padding: 25px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.summary-item {
    border-bottom: 1px dashed #d1d5db;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item:last-child { border-bottom: none; }

.total-price {
    font-size: 1.5rem;
    color: #047857;
    font-weight: bold;
    text-align: center;
    margin: 25px 0;
    background: #dcfce7;
    padding: 20px;
    border-radius: 0; /* v3.22: Ostre rogi */
    border: 2px solid #15803d;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.local-seo-box {
    text-align: center;
    background: #f3f4f6;
    padding: 15px;
    border-radius: 0; /* v3.22: Ostre rogi */
    margin-top: 20px;
    font-size: 0.95rem;
    color: #4b5563;
    border: 1px solid #d1d5db;
    grid-column: 1 / -1;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.btn-contact {
    padding: 12px; 
    border-radius: 0; /* v3.22: Ostre rogi przycisków kontaktowych */
    color: white;
    font-weight: bold;
    font-size: 0.95rem; 
    text-align: center;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn-contact:hover { transform: translateY(-2px); opacity: 0.9; box-shadow: 0 6px 10px rgba(0,0,0,0.15); }
}

.btn-wa { background: #25D366; color: #064e3b; text-shadow: none; }
.btn-em { background: #ea4335; }
.btn-ms { background: #0084FF; }
.btn-fb { background: #1877F2; }
.btn-web { background: #374151; grid-column: 1 / -1; }

/* ==========================================================================
   10. SPERSONALIZOWANA SEKROKCJA DIZAJNU MOBILE-FIRST (MEDIA QUERY)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 0;
        padding-bottom: 80px; 
        background-color: #4b5563;
    }
    .container {
        border-radius: 0;
        padding: 12px 10px;
        box-shadow: none;
        width: 100%;
        box-sizing: border-box;
    }
    .logo-section {
        margin-top: 5px;
        margin-bottom: 15px!important;
        padding: 12px 10px;
        border-width: 2px;
        border-radius: 0; /* v3.22 */
    }

    .title-box { padding: 15px 12px; margin-bottom: 15px!important; }
    .title-box h1 { font-size: 1.45rem; line-height: 1.25; }
    .subtitle-highlight { font-size: 1.1rem; margin-top: 6px; }
    .animated-stage-header {
        font-size: 1.15rem;
        padding: 12px 10px;
        letter-spacing: 0.5px;
        margin-top: 5px;
        margin-bottom: 15px!important;
    }
    .category-section {
        padding: 15px 10px;
        border-width: 2px;
        margin-bottom: 15px!important;
        border-radius: 0; /* v3.22 */
        overflow: visible; 
    }
    .category-desc { margin-bottom: 15px; font-size: 1.05rem; padding: 0 5px; }
    .alert-box {
        padding: 15px!important;
        margin-bottom: 15px!important;
        margin-top: 15px!important;
        margin-left: 0!important;
        margin-right: 0!important;
    }
    .grid, .grid-3 {
        grid-template-columns: 1fr;
        gap: 15px; 
        margin-left: 0;
    }
    .card, .product-card { padding: 12px; border-width: 2px; }
    .card-gallery { height: 200px; margin-bottom: 10px; }
    
    .bottom-nav {
        padding: 8px 12px!important; 
    }
    .nav-content {
        flex-wrap: wrap;
        gap: 6px; 
    }
    .nav-center {
        flex: 100%;
        order: 1; 
        margin-bottom: 2px;
    }
    .status-text {
        font-size: 0.75rem!important; 
    }
    .nav-left {
        flex: 1;
        order: 2; 
    }
    .nav-right {
        flex: 2; 
        order: 3; 
    }
    .nav-left button, .nav-right button {
        width: 100%;
    }
    button.nav-btn, .btn-back {
        padding: 8px 12px!important; 
        font-size: 0.85rem!important; 
        border-radius: 0!important; /* v3.22 */
        min-height: 36px; 
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0!important; 
    }

    .contact-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; margin-bottom: 15px; }
    .btn-web { grid-column: 1; }
    .summary-wrapper { padding: 15px 10px; border-radius: 0; margin-bottom: 15px!important; } /* v3.22 */
    .summary-box { padding: 15px; margin-top: 15px; margin-bottom: 15px; }
    .total-price { margin: 15px 0; padding: 15px; font-size: 1.3rem; }
    
    #thermo-grid-btns { flex-direction: column; gap: 12px; } 
    .thermo-btn { margin-bottom: 0; padding: 10px; }
    .btn-database { margin-top: 15px; margin-bottom: 15px; padding: 15px; font-size: 1.05rem; }
}
/* ==========================================================================
   11. WERSJA 3.20: SILNIK GENEROWANIA WYDRUKU PDF (A4)
   ========================================================================== */

/* Kontener roboczy ukryty na normalnej stronie WWW */
.print-area {
    display: none;
}

/* Podstawowe style dla zawartości PDF */
.pdf-page {
    font-family: 'Open Sans', -apple-system, sans-serif;
    color: #000000;
    line-height: 1.4;
    font-size: 12px;
    background-color: #ffffff;
    width: 100%;
}

/* Nagłówek dokumentu PDF */
.pdf-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000000;
}

.pdf-logo-area {
    width: 55%;
    display: flex;
    align-items: flex-end;
}

.pdf-logo-area img {
    max-width: 250px;
    max-height: 70px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.pdf-meta-area {
    width: 45%;
    font-size: 12px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pdf-title {
    text-align: center;
    font-size: 17px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 15px 0 5px 0;
}

.pdf-subtitle {
    text-align: center;
    font-size: 13px;
    font-weight: 400;
    margin: 0 0 20px 0;
    color: #333333;
}

/* Tytuły sekcji (szare tło) */
.pdf-section-title {
    background-color: #e9ecef !important;
    border: 1px solid #000000;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 12px;
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-radius: 0; /* v3.22: Ostre rogi dla sekcji PDF */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color: #000000;
}

/* Tabela z zestawieniem technologii/urządzeń */
.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.pdf-table th, .pdf-table td {
    border: 1px solid #000000;
    padding: 6px 8px;
    vertical-align: middle;
    text-align: left;
}

.pdf-table th {
    background-color: #f8f9fa !important;
    font-weight: bold;
    text-align: center;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.pdf-img-cell {
    width: 100px;
    text-align: center;
}

.pdf-img-cell img {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.pdf-desc-cell {
    width: auto;
}

.pdf-item-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
    color: #000000;
}

.pdf-price-cell {
    width: 110px;
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
}

/* Podsumowanie audytu OZC */
.pdf-audit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.pdf-audit-table th {
    text-align: right;
    font-weight: 600;
    border: 1px solid #000000;
    background-color: #f8f9fa !important;
    padding: 6px 10px;
    width: 30%;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.pdf-audit-table td {
    text-align: left;
    border: 1px solid #000000;
    padding: 6px 10px;
    width: 70%;
}

/* Tabela z podsumowaniem budżetu */
.pdf-total-box {
    margin-top: 20px;
    border: 2px solid #000000;
    padding: 12px;
    text-align: right;
    font-size: 15px;
    background-color: #f8f9fa !important;
    border-radius: 0; /* v3.22: Ostre rogi podsumowania cenowego PDF */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    font-weight: bold;
}

.pdf-footer {
    font-size: 10px;
    color: #555555;
    text-align: justify;
    margin-top: 30px;
    border-top: 1px solid #dddddd;
    padding-top: 10px;
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   BEZWZGLĘDNA DYREKTYWA DRUKU (Ukrywa aplikację, pokazuje PDF)
   -------------------------------------------------------------------------- */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm; 
    }
    
    body, html {
        background-color: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Wyłączamy z widoku całkowicie główny kontener aplikacji WWW oraz paski nawigacyjne! */
    #app-container, .bottom-nav, .no-print-area {
        display: none !important;
    }

    /* Włączamy kontener PDF */
    .print-area {
        display: block !important;
        position: relative !important;
        visibility: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Ochrona przed brutalnym cięciem tabel i sekcji na granicy dwóch kartek papieru */
    .pdf-table tr, .pdf-audit-table tr, .pdf-section-title, .pdf-total-box, .pdf-footer {
        page-break-inside: avoid;
    }
    
    .pdf-section-title {
        page-break-after: avoid;
    }
}