/**
 * Styles CSS pour le plugin Socrashop
 */

/* Container principal */
.socrashop-calculator {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Formulaire */
.socrashop-form {
    margin-bottom: 30px;
}

.socrashop-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.socrashop-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.socrashop-form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.socrashop-form-group input,
.socrashop-form-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #ffffff;
}

.socrashop-form-group input:focus,
.socrashop-form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.socrashop-form-group small {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* Champ prix avec devise */
.socrashop-price-input {
    position: relative;
    display: flex;
    align-items: center;
}

.socrashop-price-input input {
    flex: 1;
    padding-right: 40px;
}

.socrashop-price-input .currency {
    position: absolute;
    right: 12px;
    color: #666;
    font-weight: 600;
    pointer-events: none;
}

/* Options supplémentaires */
.socrashop-options {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.socrashop-options h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.socrashop-option {
    margin-bottom: 12px;
}

.socrashop-option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.socrashop-option-label:hover {
    background-color: rgba(0, 124, 186, 0.05);
}

.socrashop-option-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.socrashop-option-label .option-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.socrashop-option-label .option-price {
    color: #007cba;
    font-weight: 600;
    font-size: 14px;
}

/* Boutons */
.socrashop-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.socrashop-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.socrashop-btn-primary {
    background: #007cba;
    color: #ffffff;
}

.socrashop-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.socrashop-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.socrashop-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Résultats */
.socrashop-result,
.socrashop-ajax-result {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.socrashop-result h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.socrashop-result-summary {
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.total {
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
    border-top: 2px solid #007cba;
    margin-top: 10px;
    padding-top: 15px;
}

.result-item .label {
    font-weight: 600;
    color: #333;
}

.result-item .value {
    font-weight: 700;
    color: #007cba;
}

/* Détail des options */
.socrashop-options-detail {
    margin: 20px 0;
    padding: 15px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.socrashop-options-detail h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.option-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.option-detail:last-child {
    border-bottom: none;
}

.option-label {
    color: #666;
}

.option-cost {
    font-weight: 600;
    color: #007cba;
}

/* Actions du résultat */
.socrashop-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* Messages d'erreur */
.socrashop-errors {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.socrashop-errors .error {
    margin: 0;
    color: #721c24;
    font-weight: 500;
}

/* Messages de succès */
.socrashop-success {
    margin-bottom: 20px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    font-weight: 500;
}

/* Loading state */
.socrashop-loading {
    opacity: 0.6;
    pointer-events: none;
}

.socrashop-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .socrashop-calculator {
        margin: 10px;
        padding: 15px;
    }
    
    .socrashop-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .socrashop-form-actions {
        flex-direction: column;
    }
    
    .socrashop-btn {
        width: 100%;
    }
    
    .socrashop-result-actions {
        flex-direction: column;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-item .value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .socrashop-calculator {
        margin: 5px;
        padding: 10px;
    }
    
    .socrashop-form-group input,
    .socrashop-form-group select {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* Styles d'impression */
@media print {
    .socrashop-form,
    .socrashop-result-actions {
        display: none;
    }
    
    .socrashop-calculator {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .socrashop-result {
        background: #ffffff;
        border: 1px solid #000;
    }
}

/* Accessibilité */
.socrashop-form-group input:focus,
.socrashop-form-group select:focus,
.socrashop-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation d'apparition du résultat */
.socrashop-result {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

