/* ========================================== */
/* BRANDS NAVIGATION STYLES */
/* ========================================== */

/* Brand navigation inside unified container */
.brands-nav {
    background: transparent;
    padding: 20px 30px 30px 30px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    position: relative;
}

.brands-nav h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-text-main);
    font-size: 1.8rem;
    padding: 0;
}

.brands-scroll-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.brands-scroll-track {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding: 15px 30px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.brands-scroll-track::-webkit-scrollbar {
    display: none;
}

/* Barra di progresso rossa trasparente */
.scroll-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(217, 56, 41, 0.7);
    border-radius: 2px;
    transform-origin: left;
    transform: scaleX(0);
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.brands-scroll-container.scrolling .scroll-progress-bar {
    opacity: 1;
    transform: scaleX(1);
}

/* Frecce di navigazione */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(217, 56, 41, 0.2);
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary);
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
}

.scroll-arrow:hover {
    background: rgba(217, 56, 41, 0.1);
    border-color: rgba(217, 56, 41, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(217, 56, 41, 0.2);
}

.scroll-arrow-left {
    left: 10px;
}

.scroll-arrow-right {
    right: 10px;
}

.brands-scroll-container.can-scroll-left .scroll-arrow-left,
.brands-scroll-container.can-scroll-right .scroll-arrow-right {
    opacity: 1;
    pointer-events: all;
}

/* Ombre ai lati per indicare la possibilità di scorrere */
.scroll-fade-left,
.scroll-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.scroll-fade-left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), transparent);
    opacity: 0;
}

.scroll-fade-right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    opacity: 1;
}

.brands-scroll-container.can-scroll-left .scroll-fade-left {
    opacity: 1;
}

.brands-scroll-container.can-scroll-right .scroll-fade-right {
    opacity: 1;
}

.brands-scroll-container:not(.can-scroll-right) .scroll-fade-right {
    opacity: 0;
}

@keyframes scrollbarFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Brand items */
.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-main);
    padding: 15px 10px;
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background:  linear-gradient(150deg, #cccccc00 0%, #cccccccc 100%);
    border: 1px solid #e0e0e0;
    min-width: 90px;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    /* Remove sticky hover/active states on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.brand-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(217, 56, 41, 0.05), rgba(242, 82, 82, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

/* Touch feedback with automatic reset */
.brand-item:active {
    transform: translateY(-4px) scale(0.98);
    box-shadow: 0 6px 15px rgba(217, 56, 41, 0.2);
    border-color: rgba(217, 56, 41, 0.1);
    transition: all 0.1s ease;
}

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
    .brand-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(217, 56, 41, 0.3);
        border-color: rgba(217, 56, 41, 0.2);
        color: var(--color-text-main);
        text-decoration: none;
    }

    .brand-item:hover::before {
        opacity: 1;
    }

    .brand-item:hover img {
        transform: scale(1.15);
    }
}

.brand-item img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.brand-item span {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

/* Brand DISABILITATO - Stile elegante */
.brand-item.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    filter: grayscale(80%) !important;
}

.brand-item.disabled img {
    opacity: 0.5 !important;
}

.brand-item.disabled span {
    color: #999 !important;
}

/* Rimuovi tutti gli effetti hover/active per disabled */
.brand-item.disabled:hover,
.brand-item.disabled:active {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    border-color: #e0e0e0 !important;
}

.brand-item.disabled:hover::before {
    opacity: 0 !important;
}

.brand-item.disabled:hover img {
    transform: none !important;
}

.brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 12px;
    border-radius: 10px;
    background: linear-gradient(145deg, #F2F2E4, #e8e8da);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: var(--color-text-main);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    width: 120px;
    height: 140px;
    justify-content: center;
    flex-shrink: 0;
}

.brand-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(217, 56, 41, 0.2);
    border-color: var(--color-primary);
}

.brand-logo {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 8px;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Fallback for emoji if there's no image */
.brand-logo-emoji {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-text-main);
}

.brand-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    max-width: 100px;
    word-wrap: break-word;
    line-height: 1.1;
    margin-top: 6px;
}
