/* =============================================
   WooCommerce Pastilles Couleurs - Frontend CSS
   ============================================= */

/* --- Pastilles communes --- */
.wcs-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}

.wcs-swatch:hover,
.wcs-swatch.wcs-active {
    transform: scale(1.18);
    box-shadow: 0 0 0 2px #333;
}

/* --- Pastilles sur l'aperçu produit (boucle boutique) --- */
.wcs-swatches-loop {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 6px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Animation de transition de l'image dans la boucle */
.woocommerce ul.products li.product .wcs-image-transition {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.woocommerce ul.products li.product .wcs-image-visible {
    opacity: 1;
}

/* --- Pastilles sur la fiche produit --- */
.wcs-swatches-single {
    margin: 12px 0 16px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.wcs-label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.wcs-label strong.wcs-selected-name {
    color: #333;
    font-weight: 600;
}

.wcs-swatches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Pastilles plus grandes sur la fiche produit */
.wcs-swatch-single {
    width: 34px;
    height: 34px;
}

/* Image principale sur la fiche produit */
.woocommerce div.product div.images img {
    transition: opacity 0.25s ease;
}

.wcs-fade-out {
    opacity: 0 !important;
    transition: opacity 0.15s ease !important;
}

.wcs-fade-in {
    opacity: 1 !important;
    transition: opacity 0.25s ease !important;
}

/* Tooltip au survol */
.wcs-swatch::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.wcs-swatch:hover::after {
    opacity: 1;
}
