/* simulateur-granulat-card.css */

.bwa-sim-granulat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    user-select: none;
    position: relative;
    transition: opacity 0.2s;
}

.bwa-sim-granulat-card:hover:not(.is-disabled) .bwa-sim-granulat-card__swatch {
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    transform: scale(1.06);
}

/* ── État sélectionné ── */
.bwa-sim-granulat-card.is-selected .bwa-sim-granulat-card__swatch {
    box-shadow: 0 0 0 3px #3B82F6, 0 0 0 5px #fff, 0 4px 16px rgba(59,130,246,0.25);
}

/* ── État désactivé ── */
.bwa-sim-granulat-card.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Swatch (cercle) ── */
.bwa-sim-granulat-card__swatch {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: box-shadow 0.2s, transform 0.2s;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .bwa-sim-granulat-card__swatch {
        width: 96px;
        height: 96px;
    }
}

@media (min-width: 640px) {
    .bwa-sim-granulat-card__swatch {
        width: 125px;
        height: 125px;
    }
}

.bwa-sim-granulat-card__swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Checkmark centré ── */
.bwa-sim-granulat-card__check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s, transform 0.2s;
}

.bwa-sim-granulat-card.is-selected .bwa-sim-granulat-card__check {
    opacity: 1;
    transform: scale(1);
}

.bwa-sim-granulat-card__check-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bwa-sim-granulat-card__check-circle svg {
    display: block;
}

/* ── Badge contrainte ★ ── */
.bwa-sim-granulat-card__constrained-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fbbf24;
    color: #fff;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    line-height: 1;
}

/* ── Badge IA suggéré ── */
.bwa-sim-granulat-card__ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #3B82F6;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(59,130,246,0.4);
}

/* ── Swatch suggéré (anneau pointillé) ── */
.bwa-sim-granulat-card.is-suggested .bwa-sim-granulat-card__swatch {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.5), 0 0 12px rgba(59,130,246,0.2);
}

/* ── Tooltip hover ── */
.bwa-sim-granulat-card__tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 23, 42, 0.92) !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 7px 10px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    text-align: center;
    backdrop-filter: blur(4px);
}

.bwa-sim-granulat-card__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.92);
}

.bwa-sim-granulat-card__tooltip-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff !important;
}

.bwa-sim-granulat-card__tooltip-ral {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-top: 2px;
    line-height: 1.3;
}

.bwa-sim-granulat-card:hover:not(.is-disabled) .bwa-sim-granulat-card__tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Texte info ── */
.bwa-sim-granulat-card__info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bwa-sim-granulat-card__code {
    font-size: 10px;
    color: #6b7280;
    display: block;
    line-height: 1.3;
}

.bwa-sim-granulat-card__name {
    font-size: 11px;
    font-weight: 500;
    display: block;
    line-height: 1.25;
    color: var(--foreground, #1a1a1a);
}
