/* --- GŁÓWNY KONTENER --- */
.nmea-container {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* --- TRYB HARMONIJKI --- */
.nmea-mode-accordion {
    display: flex;
    overflow: hidden;
    gap: 0;
}
.nmea-mode-accordion .nmea-item {
    position: relative;
    flex: 1; 
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    text-decoration: none;
    display: block;
    border-right: 1px solid rgba(255,255,255,0.1); 
}
.nmea-mode-accordion .nmea-item:hover { flex: 4; }

/* --- TRYB KARUZELI --- */
.nmea-mode-carousel {
    display: block !important;
    overflow: hidden;
    
    /* MIEJSCE NA KROPKI POD SPODEM */
    padding-bottom: 40px; 
}

.nmea-mode-carousel .swiper,
.nmea-mode-carousel .swiper-wrapper,
.nmea-mode-carousel .swiper-slide {
    height: 100% !important;
    min-height: 100% !important;
    box-sizing: border-box;
}
.nmea-mode-carousel .swiper-wrapper {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 1;
}
.nmea-mode-carousel .swiper-slide {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: block;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.1);
    width: 33.333%; 
    width: calc(100% / var(--nmea-cols-m, 1));
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (min-width: 768px) {
    .nmea-mode-carousel .swiper-slide { width: calc(100% / var(--nmea-cols-t, 2)); }
}
@media (min-width: 1025px) {
    .nmea-mode-carousel .swiper-slide { width: calc(100% / var(--nmea-cols-d, 3)); }
    .nmea-mode-carousel .swiper-slide:hover {
        width: calc( (100% / var(--nmea-cols-d, 3)) * 1.6 ) !important;
        z-index: 10;
    }
}

/* --- WSPÓLNE STYLE GRAFICZNE --- */
.nmea-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1; pointer-events: none;
}
.nmea-item:hover .nmea-bg, .swiper-slide:hover .nmea-bg { transform: scale(1.1); }

.nmea-overlay {
    position: absolute; inset: 0; z-index: 2;
    width: 100%; height: 100%;
    transition: background 0.4s ease; pointer-events: none;
}
.nmea-item:hover .nmea-overlay, .swiper-slide:hover .nmea-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.1)) !important;
}

/* KONTENER TREŚCI - FIX DLA iPHONE */
.nmea-content {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 30px; /* To jest nadpisywane przez PHP z !important */
    z-index: 3;
    display: flex; flex-direction: column; justify-content: flex-end;
    
    /* KLUCZOWE: Zapobiega rozciąganiu przycisku na iOS */
    align-items: flex-start !important; 
    
    pointer-events: none; 
}

.nmea-title {
    margin: 0;
    font-size: 1.5rem; font-weight: 700; text-transform: uppercase;
    white-space: nowrap; opacity: 0.8;
    transform: translateY(20px); transition: all 0.4s ease;
    color: inherit; 
    width: 100%; /* Tytuł może być na całą szerokość */
}
.nmea-desc {
    margin-top: 10px; font-size: 1rem;
    opacity: 0; transform: translateY(20px); transition: all 0.4s ease 0.1s;
    max-height: 0; overflow: hidden;
    color: inherit;
    width: 100%;
}
.nmea-item:hover .nmea-title, .swiper-slide:hover .nmea-title {
    opacity: 1; transform: translateY(0); font-size: 1.8rem; 
}
.nmea-item:hover .nmea-desc, .swiper-slide:hover .nmea-desc {
    opacity: 1; transform: translateY(0); max-height: 200px;
}

/* --- PRZYCISK --- */
.nmea-btn {
    display: inline-block;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;
    text-decoration: none;
    
    /* Zabezpieczenie szerokości */
    width: auto !important;
    max-width: 100%;
}
.nmea-item:hover .nmea-btn, .swiper-slide:hover .nmea-btn {
    opacity: 1;
    transform: translateY(0);
}

/* --- MOBILE FIXES --- */
@media (max-width: 767px) {
    .nmea-title, .nmea-desc, .nmea-btn {
        opacity: 1 !important;
        transform: translateY(0) !important;
        max-height: none !important;
        white-space: normal;
    }
    .nmea-title { font-size: 1.2rem !important; }
    
    /* FIX IPHONE: Przycisk nie rozciąga się */
    .nmea-btn {
        display: inline-block !important;
        width: auto !important; 
        align-self: flex-start !important; 
        margin-top: 10px;
    }
}

/* --- OPCJA: TYLKO NA MOBILE --- */
@media (min-width: 768px) {
    .nmea-mobile-only {
        display: none !important;
    }
}

/* --- NAWIGACJA (SVG) --- */
.nmea-mode-carousel .swiper-button-next,
.nmea-mode-carousel .swiper-button-prev {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 50px; height: 50px;
    background-color: rgba(0,0,0,0.3); border-radius: 50%;
    z-index: 50; cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    color: transparent !important; border: none; outline: none;
}
.nmea-mode-carousel .swiper-button-prev::after {
    content: ''; width: 24px; height: 24px; display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: contain;
}
.nmea-mode-carousel .swiper-button-next::after {
    content: ''; width: 24px; height: 24px; display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: contain;
}
.nmea-mode-carousel .swiper-button-prev { left: 20px; }
.nmea-mode-carousel .swiper-button-next { right: 20px; }
.nmea-mode-carousel .swiper-button-next:hover, .nmea-mode-carousel .swiper-button-prev:hover {
    background-color: rgba(0,0,0,0.8); transform: translateY(-50%) scale(1.1);
}
.swiper-button-next::before, .swiper-button-prev::before { display: none !important; }

/* --- KROPKI POD ELEMENTEM --- */
.nmea-mode-carousel .swiper-pagination {
    /* Pozycjonowanie wewnątrz dolnego paddingu */
    position: absolute; 
    bottom: 10px; 
    left: 0; 
    width: 100%;
    z-index: 50; 
    text-align: center; 
    pointer-events: none;
}
.nmea-mode-carousel .swiper-pagination-bullet {
    opacity: 0.5; width: 10px; height: 10px; margin: 0 6px !important;
    display: inline-block; border-radius: 50%; cursor: pointer; pointer-events: auto;
    /* Usunięcie cienia, bo teraz są na płaskim tle */
    box-shadow: none; 
    border: 1px solid rgba(0,0,0,0.1); /* Delikatny obrys dla kontrastu */
    transition: all 0.3s ease;
}
.nmea-mode-carousel .swiper-pagination-bullet-active {
    opacity: 1; transform: scale(1.3);
}