/* simulateur-grille.css — matches React Simulateur.tsx */

[hidden] {
    display: none !important;
}

.bwa-sim-grille {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Filtres ── */
.bwa-sim-grille__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bwa-sim-grille__filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1.5px solid #e5e7eb;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #65758b;
    transition: all 0.2s;
    font-family: inherit;
}

.bwa-sim-grille__filter:hover {
    border-color: #3B82F6;
    color: #3B82F6;
}

.bwa-sim-grille__filter.is-active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: #fff;
}

.bwa-sim-grille__filter .dashicons {
    display: flex;
    align-items: center;
    font-size: 12px;
    line-height: 1;
}

.bwa-sim-grille__filter-sep {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.bwa-sim-grille__product-filters {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

/* ── Top combinaisons grid ── */
.bwa-sim-grille__top-combos {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}

.bwa-sim-grille__top-combos[hidden] {
    display: none !important;
}

@media (min-width: 640px) {
    .bwa-sim-grille__top-combos {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bwa-sim-grille__top-combo-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.bwa-sim-grille__top-combo-item:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.bwa-sim-grille__top-combo-colors {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.bwa-sim-grille__top-combo-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.bwa-sim-grille__top-combo-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bwa-sim-grille__top-combo-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #171c26;
    display: block;
    margin-bottom: 2px;
}

.bwa-sim-grille__top-combo-desc {
    font-size: 0.75rem;
    color: #65758b;
    display: block;
    line-height: 1.4;
    margin-bottom: 8px;
}

.bwa-sim-grille__top-combo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bwa-sim-grille__top-combo-tag {
    font-size: 0.7rem;
    color: #65758b;
}

.bwa-sim-grille__top-combo-props {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bwa-sim-grille__top-combo-prop {
    font-size: 0.75rem;
    color: #65758b;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ── Grille granulats ── */
.bwa-sim-grille__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .bwa-sim-grille__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .bwa-sim-grille__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1440px) {
    .bwa-sim-grille__grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ── Skeleton ── */
.bwa-sim-granulat-card--skeleton {
    height: 160px;
    border-radius: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sim-skeleton-shimmer 1.5s infinite;
}

.bwa-sim-granulat-card__swatch {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

@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;
}

@keyframes sim-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Suggestion IA ── */
.bwa-sim-grille__ai-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

.bwa-sim-grille__ai-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.bwa-sim-grille__ai-text {
    flex: 1;
    min-width: 0;
}

.bwa-sim-grille__ai-text strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.bwa-sim-grille__ai-text p {
    font-size: 0.8rem;
    color: #65758b;
    margin: 0;
}

.bwa-sim-grille__ai-accept {
    padding: 6px 14px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    font-family: inherit;
}

.bwa-sim-grille__ai-accept:hover {
    background: #2563EB;
}

.bwa-sim-grille__ai-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #65758b;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.bwa-sim-grille__ai-dismiss:hover {
    background: rgba(0,0,0,0.05);
}

/* ── Freestyle ── */
.bwa-sim-grille__freestyle {
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 16px;
    padding: 16px 20px;
    background: rgba(59,130,246,0.02);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 640px) {
    .bwa-sim-grille__freestyle {
        padding: 20px 24px;
    }
}

.bwa-sim-grille__freestyle-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bwa-sim-grille__freestyle-sparkle {
    color: #3B82F6;
    flex-shrink: 0;
}

.bwa-sim-grille__freestyle-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #171c26;
    margin: 0;
}

.bwa-sim-grille__freestyle-desc {
    font-size: 0.75rem;
    color: #65758b;
    margin: 0;
    line-height: 1.5;
}

.bwa-sim-grille__freestyle-row {
    display: flex;
    gap: 8px;
}

.bwa-sim-grille__freestyle-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 10px 16px;
    font-size: 0.875rem;
    outline: none;
    font-family: inherit;
    color: #171c26;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.bwa-sim-grille__freestyle-input::placeholder {
    color: rgba(101,117,139,0.6);
}

.bwa-sim-grille__freestyle-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.bwa-sim-grille__freestyle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.bwa-sim-grille__freestyle-btn:hover:not(:disabled) {
    background: #2563EB;
    transform: scale(1.05);
}

.bwa-sim-grille__freestyle-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.bwa-sim-grille__freestyle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bwa-sim-grille__freestyle-send-icon,
.bwa-sim-grille__freestyle-spinner {
    display: block;
    flex-shrink: 0;
}

@keyframes sim-spin {
    to { transform: rotate(360deg); }
}

.bwa-sim-grille__freestyle-spinner {
    animation: sim-spin 0.7s linear infinite;
}

.bwa-sim-grille__freestyle-reason {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #65758b;
    line-height: 1.5;
}

.bwa-sim-grille__freestyle-reason-icon {
    color: #3B82F6;
    flex-shrink: 0;
    margin-top: 1px;
}
