/* Configurateur Frontend Styles */

/* Cacher le label "edit:" dans le panier */
.variation-edit {
    display: none !important;
}
.variation-edit ~ .variation-edit {
    display: block !important;
}

.woopixi-configurateur-frontend {
	width: 100%;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.configurateur-field {
    margin-bottom: 25px;
}

.configurateur-field:last-child {
    margin-bottom: 0;
}

.configurateur-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* Price Range Slider */
.price-range-field {
    margin-bottom: 30px;
}

.range-wrap {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
}

.range-value {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--e-global-color-accent, #0073aa);
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 18px;
}

.range-value::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--e-global-color-accent, #0073aa);
}

.configurateur-range {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.configurateur-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--e-global-color-accent, #0073aa);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.configurateur-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--e-global-color-accent, #0073aa);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Dropdown */
.configurateur-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.configurateur-select:focus {
    border-color: var(--e-global-color-accent, #0073aa);
    outline: none;
}

/* Visual Choices (Image Picker) */
.img-picker {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.img-picker-item {
    position: relative;
}

.img-picker-checkbox {
    display: none;
}

.img-picker-label {
    display: block;
    padding: 10px;
    text-align: center;
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.img-picker-label img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
    border-radius: 4px;
}

.img-picker-label span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.img-picker-label:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.img-picker-checkbox:checked + .img-picker-label {
    border-color: var(--e-global-color-accent, #0073aa);
    background: #f0f8ff;
    box-shadow: 0 3px 12px rgba(0,115,170,0.2);
}

.img-picker-checkbox:checked + .img-picker-label span {
    color: var(--e-global-color-accent, #0073aa);
}

/* Preview button */
.btn-show-modal {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: 2px solid #666;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.btn-show-modal:hover {
    background: #666;
    color: #fff;
    transform: scale(1.1);
}

/* Modal */
.configurateur-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.modal-close:hover {
    background: #e63946;
    color: #fff;
    transform: rotate(90deg);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #666;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 15px;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.checkbox-label:hover {
    border-color: #999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.checkbox-input {
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-input:checked + span {
    font-weight: 600;
    color: var(--e-global-color-accent, #0073aa);
}

.checkbox-label:has(.checkbox-input:checked) {
    border-color: var(--e-global-color-accent, #0073aa);
    background: #f0f8ff;
}

/* Responsive */
@media (max-width: 782px) {
    .woopixi-configurateur-frontend {
        padding: 15px;
    }
    
    .img-picker {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .configurateur-select {
        max-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .img-picker {
        grid-template-columns: repeat(2, 1fr);
    }
}
