/**
 * Color Group Switcher - Styles avec inversion d'ordre
 */

/* INVERSION DE L'ORDRE avec flexbox */
.product-add-to-cart {
    order: 2; /* Bouton en 2ème */
}

.color-group-variants {
    order: 1; /* Couleurs en 1er */
    margin: 20px 0;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
}

/* Forcer le conteneur parent à utiliser flexbox */

/* Style des variantes */
.variants-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.variant-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    min-width: 80px;
}

.variant-item:hover {
    border-color: #6c5ce7;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
    transform: translateY(-2px);
}

.variant-item.variant-current {
    border-color: #6c5ce7;
    border-width: 3px;
    background: #f5f3ff;
}

.variant-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

.variant-no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
    color: #666;
}

.variant-color-name {
    font-size: 12px;
    text-align: center;
    color: #666;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.variant-current .variant-color-name {
    color: #6c5ce7;
    font-weight: 600;
}

.variant-checkmark {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #6c5ce7;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .variants-list {
        gap: 8px;
    }
    
    .variant-item {
        min-width: 70px;
        padding: 6px;
    }
    
    .variant-item img,
    .variant-no-image {
        width: 50px;
        height: 50px;
    }
    
    .variant-color-name {
        font-size: 11px;
        max-width: 70px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-group-variants {
    animation: fadeIn 0.4s ease-out;
}