/**
 * Brands Grid - CSS griglia marchi espandibile
 */

/* Contenitore principale */
.brand, #brand {
    width: 100%;
    padding: 3rem 0;
    margin: 2rem 0;
}

/* Wrapper griglia */
.brands-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Griglie */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2rem 1.5rem;
    margin-bottom: 2rem;
}

.expanded-grid {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* Elementi singoli */
.brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/2;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.brand-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-item:hover {
    transform: translateY(-5px);
}

.brand-item a:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.brand-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
}

.brand-item a:hover img {
    filter: grayscale(0%);
}

/* Sezione toggle */
.toggle-section {
    text-align: center;
    margin-top: 3rem;
}

.toggle-btn {
    background: transparent;
    border: 2px solid #333;
    color: #333;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.toggle-btn:hover {
    background: #333;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.toggle-btn.expanded {
    background: #333;
    color: white;
}

.btn-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.toggle-btn.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .brands-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.8rem 1.2rem;
    }
    
    .brands-grid-wrapper {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .brand, #brand {
        padding: 2rem 0;
    }
    
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem 1rem;
    }
    
    .brands-grid-wrapper {
        padding: 0 1rem;
    }
    
    .brand-item {
        aspect-ratio: 2/1;
    }
    
    .toggle-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 0.8rem;
    }
    
    .brand-item a {
        padding: 0.8rem;
    }
    
    .toggle-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Stati di caricamento */
.brand:empty::before, #brand:empty::before {
    content: "Caricamento marchi...";
    display: block;
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* Performance ottimizzazioni */
.brands-grid {
    transform: translateZ(0);
}

.brand-item {
    transform: translateZ(0);
}