/* ===================== KARUZELA OBROTOWA ===================== */
.services-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 0 auto;
    perspective: 1500px;
    overflow: hidden;
}

.carousel-stage {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: var(--transition);
}

/* STYLY DLA WSZYSTKICH KART */
.service-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: 420px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 35px 30px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backface-visibility: hidden;
    transform-origin: center;
    /* Default state (before JS): hide all cards */
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

/* First card visible by default before JS runs */
.service-card[data-index="0"] {
    transform: translate(-50%, -50%) translateZ(100px);
    opacity: 1;
    z-index: 5;
    pointer-events: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--primary-light);
}

/* POZYCJE KART W PIĘCIO-ELEMENTOWYM UKŁADZIE */
/* KARTA CENTRALNA (główna) - indeks 0 */
.service-card[data-position="center"] {
    transform: translate(-50%, -50%) translateZ(100px);
    opacity: 1;
    z-index: 5;
    pointer-events: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--primary-light);
}

/* KARTY PO LEWEJ STRONIE - indeksy 1 i 2 */
.service-card[data-position="left-2"] {
    transform: translate(-50%, -50%) translateX(-450px) translateZ(-100px);
    opacity: 0.4;
    z-index: 2;
    pointer-events: auto;
    filter: blur(1px);
}

.service-card[data-position="left-1"] {
    transform: translate(-50%, -50%) translateX(-280px) translateZ(0);
    opacity: 0.7;
    z-index: 3;
    pointer-events: auto;
}

/* KARTY PO PRAWEJ STRONIE - indeksy 3 i 4 */
.service-card[data-position="right-1"] {
    transform: translate(-50%, -50%) translateX(280px) translateZ(0);
    opacity: 0.7;
    z-index: 3;
    pointer-events: auto;
}

.service-card[data-position="right-2"] {
    transform: translate(-50%, -50%) translateX(450px) translateZ(-100px);
    opacity: 0.4;
    z-index: 2;
    pointer-events: auto;
    filter: blur(1px);
}

/* IKONY - jak w cenniku */
.service-card .service-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 47, 97, 0.1);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.service-card[data-position="center"] .service-icon {
    transform: scale(1.2);
    background: rgba(8, 47, 97, 0.1);
}

.service-card .service-icon::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card[data-position="center"] .service-icon::after {
    opacity: 1;
}

.service-card .service-icon i {
    font-size: 2rem;
    color: var(--primary-dark) !important;
    fill: var(--primary-dark) !important;
    stroke: var(--primary-dark) !important;
}

.service-card .service-icon i::before {
    color: var(--primary-dark) !important;
    background: none !important;
}

.service-card[data-position="center"] .service-icon i {
    color: var(--primary-dark) !important;
}

/* TYPOGRAPHY */
.service-card h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card[data-position="center"] h3 {
    color: var(--primary);
    font-size: 1.6rem;
}

.service-card p {
    font-size: 1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 30px;
    flex-grow: 1;
}

/* PRZYCISKI */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 86, 219, 0.3);
}

.service-card[data-position="center"] .btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(26, 86, 219, 0.2);
}

.service-card[data-position="center"] .btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 25px rgba(26, 86, 219, 0.4);
}

/* KONTENER NAWIGACJI */
.carousel-nav {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(8, 47, 97, 0.7);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: fit-content;
    margin: 15px auto 0;
}

/* PRZYCISKI NAWIGACJI */
.carousel-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* PRZYCISKI NAWIGACJI - STARY STYL (do usunięcia) */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    display: none; /* Całkowicie ukryj strzałki */
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 50px;
}

.carousel-next {
    right: 50px;
}

/* PAGINATION DOTS */
/* Make the carousel pagination visually match the men-slider navigation
   (centered, pill background, blur + border). Position it above the cards. */
.carousel-dots {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(8, 47, 97, 0.7);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: fit-content;
    margin: 15px auto 0;
}

.carousel-arrow {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.28s ease;
    backdrop-filter: blur(5px);
    padding: 0;
    margin: 0;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.28s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0;
    margin: 0;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    flex-shrink: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--white);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ANIMACJE */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.service-card[data-position="center"] {
    animation: fadeIn 0.5s ease-out;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 1400px) {
    .service-card[data-position="left-2"] {
        transform: translate(-50%, -50%) translateX(-380px) translateZ(-100px);
    }

    .service-card[data-position="left-1"] {
        transform: translate(-50%, -50%) translateX(-220px) translateZ(0);
    }

    .service-card[data-position="right-1"] {
        transform: translate(-50%, -50%) translateX(220px) translateZ(0);
    }

    .service-card[data-position="right-2"] {
        transform: translate(-50%, -50%) translateX(380px) translateZ(-100px);
    }
}

@media (max-width: 1200px) {
    .services-carousel {
        height: 450px;
    }

    .service-card {
        width: 280px;
        height: 340px;
        padding: 25px 20px;
    }

    .service-card[data-position="left-2"] {
        transform: translate(-50%, -50%) translateX(-320px) translateZ(-100px);
    }

    .service-card[data-position="left-1"] {
        transform: translate(-50%, -50%) translateX(-180px) translateZ(0);
    }

    .service-card[data-position="right-1"] {
        transform: translate(-50%, -50%) translateX(180px) translateZ(0);
    }

    .service-card[data-position="right-2"] {
        transform: translate(-50%, -50%) translateX(320px) translateZ(-100px);
    }

    .carousel-prev {
        left: 30px;
    }

    .carousel-next {
        right: 30px;
    }
}

@media (max-width: 992px) {
    .services-carousel {
        height: 400px;
    }

    .service-card {
        width: 240px;
        height: 300px;
        padding: 20px 15px;
    }

    .service-card .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .service-card .service-icon i {
        font-size: 1.8rem;
    }

    .service-card h3 {
        font-size: 1.3rem;
        min-height: 50px;
    }

    .service-card p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .service-card[data-position="left-2"] {
        transform: translate(-50%, -50%) translateX(-270px) translateZ(-100px);
        opacity: 0.3;
    }

    .service-card[data-position="left-1"] {
        transform: translate(-50%, -50%) translateX(-150px) translateZ(0);
        opacity: 0.6;
    }

    .service-card[data-position="right-1"] {
        transform: translate(-50%, -50%) translateX(150px) translateZ(0);
        opacity: 0.6;
    }

    .service-card[data-position="right-2"] {
        transform: translate(-50%, -50%) translateX(270px) translateZ(-100px);
        opacity: 0.3;
    }

    .carousel-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .services-carousel {
        height: 500px;
    }

    .service-card {
        width: 260px; /* Increased from 200px for much better readability */
        height: 320px; /* Increased from 260px */
        padding: 20px 18px; /* More padding for better spacing */
    }

    .service-card[data-position="center"] {
        border-width: 2px;
        width: 300px; /* Zwiększono szerokość karty centralnej dla lepszego dopasowania tytułów */
    }

    .service-card .service-icon {
        width: 60px; /* Increased from 50px */
        height: 60px;
        margin-bottom: 20px; /* More space below icon */
        border-radius: 15px;
    }

    .service-card .service-icon i {
        font-size: 1.8rem; /* Larger icons */
    }

    .service-card h3 {
        font-size: 1.3rem; /* Larger headings */
        min-height: 50px; /* More space for text */
        margin-bottom: 18px;
        line-height: 1.4;
    }

    .service-card p {
        font-size: 0.95rem; /* Larger body text */
        margin-bottom: 20px;
        line-height: 1.6;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .service-card[data-position="left-2"] {
        transform: translate(-50%, -50%) translateX(-220px) translateZ(-100px);
        opacity: 0.2;
        filter: blur(2px);
    }

    .service-card[data-position="left-1"] {
        transform: translate(-50%, -50%) translateX(-120px) translateZ(0);
        opacity: 0.5;
    }

    .service-card[data-position="right-1"] {
        transform: translate(-50%, -50%) translateX(120px) translateZ(0);
        opacity: 0.5;
    }

    .service-card[data-position="right-2"] {
        transform: translate(-50%, -50%) translateX(220px) translateZ(-100px);
        opacity: 0.2;
        filter: blur(2px);
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-dots {
        padding: 8px 14px;
        gap: 10px;
        margin-top: 15px;
    }
    
    .carousel-dots .carousel-arrow {
        display: flex;
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 576px) {
    .services-carousel {
        height: 480px;
    }

    .service-card {
        width: 240px;
        height: 320px;
        padding: 20px 18px;
    }

    .service-card[data-position="center"] {
        width: min(300px, 85vw);
    }

    .service-card .service-icon {
        width: 55px; /* Good size for phones */
        height: 55px;
        margin-bottom: 18px;
        border-radius: 12px;
    }

    .service-card .service-icon i {
        font-size: 1.6rem;
    }

    .service-card h3 {
        font-size: 1.1rem; /* Zmniejszono z 1.2rem dla lepszego dopasowania długich tytułów */
        min-height: 55px; /* Zwiększono z 45px dla dłuższych tytułów */
        margin-bottom: 16px;
        line-height: 1.4;
    }

    .service-card p {
        font-size: 0.9rem; /* Larger than before */
        margin-bottom: 18px;
        line-height: 1.5;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .service-card[data-position="left-2"] {
        transform: translate(-50%, -50%) translateX(-180px) translateZ(-100px);
    }

    .service-card[data-position="left-1"] {
        transform: translate(-50%, -50%) translateX(-100px) translateZ(0);
    }

    .service-card[data-position="right-1"] {
        transform: translate(-50%, -50%) translateX(100px) translateZ(0);
    }

    .service-card[data-position="right-2"] {
        transform: translate(-50%, -50%) translateX(180px) translateZ(-100px);
    }

    .service-card[data-position="left-2"],
    .service-card[data-position="right-2"] {
        display: none; /* Ukrywamy skrajne karty na bardzo małych ekranach */
    }

    /* Dostosowanie nawigacji dla bardzo małych ekranów */
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }

    .carousel-dots {
        padding: 8px 14px;
        gap: 8px;
        margin-top: 10px;
    }
    
    .carousel-dots .carousel-arrow {
        display: flex;
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot:hover {
        transform: scale(1.15);
    }

    .carousel-dot.active {
        transform: scale(1.3);
    }
}

/* WCAG SUPPORT */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .carousel-btn,
    .btn,
    .carousel-stage {
        transition: none !important;
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    .service-card {
        border: 3px solid #000;
    }

    .service-card[data-position="center"] {
        border: 4px solid #000;
    }

    .carousel-btn {
        border: 3px solid #000;
    }

    .carousel-dot.active {
        border: 3px solid #000;
    }
}

/* FOCUS STATES */
.carousel-btn:focus-visible,
.carousel-dot:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 3px;
}
