/**
 * Styles Frontend - Angel Product Add-ons
 * Popup de personnalisation des produits
 */

/* ==========================================
   Overlay et Popup
   ========================================== */

.angel-addons-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.angel-addons-popup-overlay.active {
    opacity: 1;
}

.angel-addons-popup {
    background: #fff;
    border-radius: 15px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.angel-addons-popup-overlay.active .angel-addons-popup {
    transform: scale(1);
}

/* Bouton fermer */
.angel-addons-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #FF6B42;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #FF6B42;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.angel-addons-popup-close:hover {
    background: #FF6B42;
    color: #fff;
    transform: rotate(90deg);
}

/* Contenu scrollable */
.angel-addons-popup-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ==========================================
   Chargement
   ========================================== */

.angel-addons-loading {
    padding: 60px 20px;
    text-align: center;
}

.angel-addons-loading .spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF6B42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.angel-addons-loading p {
    margin-top: 15px;
    color: #666;
    font-size: 16px;
}

/* ==========================================
   En-tête de la popup
   ========================================== */

.angel-addons-popup-header {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, #FFF4E6 0%, #ffffff 100%);
    border-bottom: 3px solid #FF6B42;
}

.angel-addons-product-image {
    flex-shrink: 0;
}

.angel-addons-product-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(255, 107, 66, 0.2);
}

.angel-addons-product-info {
    flex: 1;
}

.angel-addons-product-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.angel-addons-product-price {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.angel-addons-product-price .base-price {
    font-weight: 700;
    color: #FF6B42;
    font-size: 18px;
}

.angel-addons-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ==========================================
   Formulaire de personnalisation
   ========================================== */

.angel-addons-form {
    padding: 0;
}

.angel-addons-groups {
    padding: 20px 30px;
}

.angel-addon-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.angel-addon-group:last-child {
    border-bottom: none;
}

.angel-addon-group-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.angel-addon-group-title .required {
    color: #FF6B42;
    font-size: 20px;
}

/* Description du groupe */
.angel-addon-group-description {
    font-size: 13px;
    color: #666;
    margin: -5px 0 15px 0;
    padding: 8px 12px;
    background: #f0f8ff;
    border-left: 3px solid #3498db;
    border-radius: 4px;
    font-style: italic;
}

/* Style différent pour ingrédients inclus vs suppléments */
.angel-addon-group.is-included .angel-addon-group-title {
    color: #27ae60;
}

.angel-addon-group.is-included .angel-addon-group-description {
    background: #e8f8f5;
    border-left-color: #27ae60;
}

.angel-addon-group.is-supplement .angel-addon-group-title {
    color: #e67e22;
}

.angel-addon-group.is-supplement .angel-addon-group-description {
    background: #fef5e7;
    border-left-color: #e67e22;
}

.angel-addon-group.is-supplement .angel-addon-option .option-price {
    font-size: 15px;
    font-weight: 700;
}

.angel-addon-options {
    display: grid;
    gap: 10px;
}

/* Options radio et checkbox */
.angel-addon-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.angel-addon-option:hover {
    background: #fff;
    border-color: #FF6B42;
    box-shadow: 0 2px 8px rgba(255, 107, 66, 0.1);
}

.angel-addon-option input[type="radio"],
.angel-addon-option input[type="checkbox"] {
    margin: 0 12px 0 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #FF6B42;
}

.angel-addon-option input[type="radio"]:checked ~ .option-label,
.angel-addon-option input[type="checkbox"]:checked ~ .option-label {
    font-weight: 600;
    color: #FF6B42;
}

.angel-addon-option .option-label {
    flex: 1;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.angel-addon-option .option-price {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
    margin-left: 8px;
}

/* Textarea */
.angel-addon-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.angel-addon-textarea:focus {
    outline: none;
    border-color: #FF6B42;
    box-shadow: 0 0 0 3px rgba(255, 107, 66, 0.1);
}

/* ==========================================
   Footer avec prix et bouton
   ========================================== */

.angel-addons-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.angel-addons-total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #FF6B42;
}

.angel-addons-total-price .label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.angel-addons-total-price .price {
    font-size: 24px;
    font-weight: 700;
    color: #FF6B42;
}

.angel-addons-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.angel-addons-quantity label {
    font-weight: 600;
    color: #333;
}

.angel-quantity-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.angel-addons-submit {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF6B42 0%, #FF8C6B 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 107, 66, 0.3);
}

.angel-addons-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 66, 0.4);
}

.angel-addons-submit:active {
    transform: translateY(0);
}

.angel-addons-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* État de chargement du bouton */
.angel-addons-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}

.angel-addons-submit.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* ==========================================
   Messages de succès/erreur
   ========================================== */

.angel-addons-message {
    padding: 15px 20px;
    margin: 0 30px 20px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: none;
}

.angel-addons-message.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    display: block;
}

.angel-addons-message.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    display: block;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .angel-addons-popup {
        max-width: 95%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .angel-addons-popup-header {
        flex-direction: column;
        padding: 20px;
    }

    .angel-addons-product-image img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .angel-addons-product-title {
        font-size: 20px;
    }

    .angel-addons-groups {
        padding: 15px 20px;
    }

    .angel-addons-footer {
        padding: 15px 20px;
    }

    .angel-addons-total-price {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ==========================================
   Affichage dans le panier
   ========================================== */

.angel-addons-summary {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #FF6B42;
    border-radius: 3px;
    font-size: 13px;
}

.angel-addons-summary .addon-group {
    margin-bottom: 5px;
}

.angel-addons-summary .addon-group:last-child {
    margin-bottom: 0;
}

.angel-addons-summary strong {
    color: #FF6B42;
}
