/* Modal */
.pg-montage-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pg-montage-modal.active {
    display: flex;
}

.pg-modal-content {
    background: var(--pg-white);
    border-radius: 2px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pg-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--pg-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pg-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--pg-dark);
}

.pg-modal-close {
    font-size: 28px;
    color: var(--pg-grey-medium);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s;
}

.pg-modal-close:hover {
    background: var(--pg-light-grey);
    color: var(--pg-dark);
}

.pg-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.pg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.pg-product-card {
    border: 2px solid var(--pg-border-light);
    border-radius: 2px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.pg-product-card:hover {
    border-color: var(--pg-galaxy);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.pg-product-card-img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 2px;
    margin-bottom: 12px;
    background: var(--pg-light-grey);
}

.pg-product-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-dark);
    margin-bottom: 6px;
    line-height: 1.4;
}

.pg-product-card-attrs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pg-product-card-attr {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--pg-grey-medium);
    background: var(--pg-light-grey);
    padding: 2px 8px;
    border-radius: 2px;
}

.pg-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.pg-product-card-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pg-galaxy);
}

.pg-modal-notice {
    font-size: 13px;
    color: var(--pg-grey-medium);
    text-align: center;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--pg-border-light);
    margin-bottom: 20px;
}

.pg-card-used {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
    cursor: default;
}

.pg-card-used::after {
    content: 'Déjà sélectionné';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--pg-white);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 2px;
    white-space: nowrap;
    pointer-events: none;
}

.pg-card-used:hover {
    border-color: var(--pg-border-light);
    box-shadow: none;
}

