/**
 * Brands Section - Auto-scrolling Carousel
 * Uses CSS variables from main stylesheet (:root)
 */

/* Section container */
.brands-section {
    width: 100%;
    background-color: var(--color-bg-light);
    padding: 60px 0;
    margin: 0;
    overflow: hidden;
}

/* Content container */
.brands-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Title styling - nowoczesny styl spójny z section-title */
.brands-title {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin: 0 0 15px 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Description styling - elegancki, subtelny */
.brands-description {
    max-width: 800px;
    margin: 0 auto 50px auto;
    text-align: center;
}

.brands-description p {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    color: var(--color-text-light);
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.brands-description p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 18px;
}

/* Carousel wrapper with navigation */
.brands-carousel-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

/* Carousel container */
.brands-carousel {
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    z-index: 1;
}

/* Carousel track - contains all brand items */
.brands-carousel-track {
    display: flex;
    gap: 40px;
    animation: scroll-brands 40s linear infinite;
    width: fit-content;
}

/* Pause animation on hover */
.brands-carousel-track:hover {
    animation-play-state: paused;
}

/* Individual brand item - powiększone logo */
.brands-carousel-item {
    flex: 0 0 auto;
    width: 260px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brand link */
.brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 20px;
    border-radius: 12px;
    background: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.brand-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(30, 136, 229, 0.15);
    border-color: var(--color-primary);
}

/* Logo wrapper - większa przestrzeń */
.brand-logo-wrapper {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* Brand logo image */
.brand-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-link:hover .brand-logo {
    transform: scale(1.05);
}

/* Brand name */
.brand-name {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-dark);
    text-align: center;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.brand-link:hover .brand-name {
    color: var(--color-primary);
}

/* Navigation buttons */
.brands-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    border-radius: 50%;
    background: white;
    color: var(--color-text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.brands-carousel-nav:hover {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.3);
}

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

.brands-carousel-nav:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.brands-carousel-prev {
    left: 0;
}

.brands-carousel-next {
    right: 0;
}

.brands-carousel-nav svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
    display: block;
    flex-shrink: 0;
}

.brands-carousel-nav svg polyline {
    stroke: currentColor;
    fill: none;
}

/* Keyframe animation for auto-scroll */
@keyframes scroll-brands {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Responsive Design */

/* Tablet (iPad) */
@media screen and (max-width: 1024px) {
    .brands-section {
        padding: 50px 0;
    }

    .brands-title {
        font-size: 42px;
        margin-bottom: 12px;
    }

    .brands-description {
        margin-bottom: 40px;
        padding: 0 20px;
    }

    .brands-description p {
        font-size: 16px;
    }

    .brands-carousel-wrapper {
        padding: 0 50px;
    }

    .brands-carousel-track {
        gap: 30px;
    }

    .brands-carousel-item {
        width: 220px;
        height: 160px;
    }

    .brand-link {
        padding: 18px;
    }

    .brand-logo-wrapper {
        height: 95px;
    }

    .brands-carousel-nav {
        width: 44px;
        height: 44px;
    }
}

/* Mobile (Phone) */
@media screen and (max-width: 768px) {
    .brands-section {
        padding: 40px 0;
    }

    .brands-title {
        font-size: 32px;
        margin-bottom: 10px;
        letter-spacing: -0.3px;
    }

    .brands-description {
        padding: 0 15px;
        margin-bottom: 35px;
    }

    .brands-description p {
        font-size: 15px;
    }

    .brands-description p:last-child {
        font-size: 16px;
    }

    .brands-carousel-wrapper {
        padding: 0 45px;
    }

    .brands-carousel-track {
        gap: 25px;
        animation-duration: 30s;
    }

    .brands-carousel-item {
        width: 200px;
        height: 145px;
    }

    .brand-link {
        padding: 15px;
        border-radius: 10px;
    }

    .brand-logo-wrapper {
        height: 85px;
        margin-bottom: 10px;
    }

    .brand-name {
        font-size: 14px;
    }

    .brands-carousel-nav {
        width: 42px;
        height: 42px;
    }

    .brands-carousel-nav svg {
        width: 22px;
        height: 22px;
    }
}

/* Small mobile */
@media screen and (max-width: 480px) {
    .brands-section {
        padding: 30px 0;
    }

    .brands-title {
        font-size: 26px;
        letter-spacing: -0.2px;
    }

    .brands-description {
        padding: 0 10px;
    }

    .brands-description p {
        font-size: 14px;
    }

    .brands-description p:last-child {
        font-size: 15px;
    }

    .brands-carousel-wrapper {
        padding: 0 38px;
    }

    .brands-carousel-track {
        gap: 18px;
        animation-duration: 25s;
    }

    .brands-carousel-item {
        width: 170px;
        height: 130px;
    }

    .brand-link {
        padding: 12px;
    }

    .brand-logo-wrapper {
        height: 75px;
    }

    .brand-name {
        font-size: 13px;
    }

    .brands-carousel-nav {
        width: 38px;
        height: 38px;
    }

    .brands-carousel-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* Accessibility - Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .brands-carousel-track {
        animation: none;
    }

    .brand-link:hover {
        transform: none;
    }

    .brand-link:hover .brand-logo {
        transform: none;
    }
}

/* Print styles */
@media print {
    .brands-carousel-nav {
        display: none;
    }

    .brands-carousel-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
    }
}
