/* ===================== SERVICES BAR ===================== */
.services-bar {
    /* slightly darker gradient and fixed height with gradient dividers so icons can be centered
       and have an exact 5px gap to the top/bottom divider. */
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-blue) 3%, #164b78c7 50%, var(--primary-blue) 97%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
    animation: gradientFlow 8s ease-in-out infinite;
    height: auto;
    box-sizing: border-box;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.services-bar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.services-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center; /* vertically center items within the bar */
    flex-wrap: nowrap;
    padding: 7px 0 1px 0;
    box-sizing: border-box;
    animation: scrollInfinitely 40s linear infinite;
    gap: 100px;
}

.services-container:hover {
    animation-play-state: paused;
}





@keyframes scrollInfinitely {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-160px * 5 - 20px * 5));
    }
}

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

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly; /* evenly distribute space between icon and text */
    text-align: center;
    flex: 0 0 auto;
    min-width: 200px;
    padding: 0 0px;
    /* height determined by icon + text */
    transform: translateY(6px); /* subtle default offset for 'enter' animation */
    opacity: 0;
    transition: var(--transition-slow);
}

.service-item.visible {
    transform: translateY(0);
    opacity: 1;
}


.services-bar .service-icon {
    max-height: 30px;
    height: 30px;
    margin: 0;
    margin-bottom: 3px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0) invert(1);
}

/* Top and bottom thin gradient dividers; icons will have exactly 5px gap to these */
.services-bar::before,
.services-bar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 10px; /* divider thickness */
    z-index: 0;
    pointer-events: none;
}
.services-bar::before {
    top: 0;
    /* subtle top divider fading downwards */
    background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 100%);
}
.services-bar::after {
    bottom: 0;
    /* subtle bottom divider fading upwards */
    background: linear-gradient(0deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 100%);
}

.service-item:hover .service-icon {
    transform: translateY(-5px);
}

.service-text {
    color: var(--white);
    font-family: 'Raleway', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: -2px;
}

/* WCAG FOCUS - TYLKO DLA TEKSTU */
.service-item:focus-within .service-text {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    margin: -2px -4px;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .services-container { 
        animation: none;
        justify-content: space-around; /* ZACHOWUJĘ RÓWNOMIERNE ROZŁOŻENIE */
        flex-wrap: wrap;
        gap: 30px; /* WIĘKSZE ODSTĘPY DLA WRAP */
    }
    .service-item {
        flex: 0 0 auto;
    }
    .services-bar .service-item:hover .service-icon {
        transform: none;
    }
}

/* RESPONSIVE - DOSTOSOWANIE ODSTĘPÓW */
@media (max-width: 480px) {
    .services-container {
        padding: 5px 0;
        justify-content: space-around;
        gap: 15px;
        width: 100%;
    }
    
    .service-item {
        flex: 0 0 auto;
        min-width: 85px;
        max-width: 100px;
    }
    
    .services-bar .service-icon {
        max-height: 18px;
        max-width: 40px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.6rem;
        line-height: 1.1;
        min-height: 1.4em;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .services-container {
        padding: 5px 0;
        gap: 25px;
    }
    
    .service-item {
        flex: 0 0 auto;
        max-width: 125px;
    }
    
    .services-bar .service-icon {
        max-height: 20px;
        max-width: 45px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.65rem;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .services-container {
        gap: 35px;
    }
    
    .service-item {
        flex: 0 0 auto;
        max-width: 140px;
    }
    
    .services-bar .service-icon {
        max-height: 22px;
        max-width: 50px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.68rem;
    }
}

@media (min-width: 993px) {
    .services-container {
        gap: 50px;
    }
    
    .service-item {
        flex: 0 0 auto;
        max-width: 160px;
    }
    
    .services-bar .service-icon {
        max-height: 24px;
        max-width: 55px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.72rem;
        min-height: 1.7em;
    }
}

/* LARGE DESKTOP */
@media (min-width: 1200px) {
    .services-container {
        gap: 60px;
    }
    
    .service-item {
        flex: 0 0 auto;
        max-width: 180px;
    }
    
    .services-bar .service-icon {
        max-height: 26px;
        max-width: 60px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.75rem;
    }
}

/* LANDSCAPE */
@media (max-width: 768px) and (orientation: landscape) {
    .services-container {
        justify-content: space-around;
        gap: 20px;
        width: 100%;
    }
    
    .service-item {
        flex: 0 0 auto;
        max-width: 110px;
    }
    
    .services-bar .service-icon {
        max-height: 16px;
        max-width: 35px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.58rem;
    }
}

/* TOUCH DEVICES */
@media (hover: none) and (pointer: coarse) {
    .services-container {
        gap: 40px;
    }
    
    .service-item {
        min-height: 50px;
        justify-content: center;
    }
    
    .services-bar .service-icon {
        max-height: 26px;
        margin-bottom: 3px;
    }
    
    .service-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* HIGH CONTRAST - bez zmian */
@media (prefers-contrast: high) {
    .service-text {
        color: #ffffff !important;
        font-weight: 700;
        text-shadow: 
            0 1px 0 #000000,
            0 2px 0 #000000,
            0 3px 0 #000000;
    }
    .services-bar .service-icon {
        filter: brightness(0) invert(1) contrast(100) !important;
    }
}

/* PRINT - bez zmian */
@media print {
    .services-bar {
        background: #f0f0f0 !important;
    }
    .services-container {
        animation: none !important;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 20px;
        padding: 5px 0;
        min-height: auto;
    }
    .service-item {
        flex: 0 0 auto;
        background: transparent !important;
    }
    .service-text {
        color: #000000 !important;
        text-shadow: none !important;
        font-size: 0.6rem;
        font-weight: 600;
        background: none !important;
        outline: none !important;
    }
    .services-bar .service-icon {
        filter: brightness(0) invert(0) !important;
        max-height: 15px;
    }
}

.services-bar .services-container,
.services-bar .service-item,
.services-bar .service-icon,
.services-bar .service-text {
    position: relative;
    z-index: 1;
}