/**
 * Styles pour le système de validation du panier
 * Custom Product Personalization - Cart Validation System
 */

/* Variables CSS pour la cohérence */
:root {
    --cpp-cart-validation-success: #28a745;
    --cpp-cart-validation-warning: #ffc107;
    --cpp-cart-validation-info: #17a2b8;
    --cpp-cart-validation-error: #dc3545;
    --cpp-promotion-gradient: linear-gradient(135deg, #A020F0 0%, #B44DFF 50%, #FF6D00 100%);
    --cpp-promotion-shadow: 0 8px 25px rgba(160, 32, 240, 0.15);
}

/* Messages de validation du panier */
.cpp-cart-validation-message {
    margin-top: 15px;
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.cpp-validation-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'Gilroy', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cpp-validation-message i {
    font-size: 16px;
    flex-shrink: 0;
}

.cpp-validation-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #c3e6cb;
}

.cpp-validation-success i {
    color: var(--cpp-cart-validation-success);
}

.cpp-validation-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-color: #ffeaa7;
}

.cpp-validation-warning i {
    color: var(--cpp-cart-validation-warning);
}

.cpp-validation-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-color: #bee5eb;
}

.cpp-validation-info i {
    color: var(--cpp-cart-validation-info);
}

/* États du bouton "Ajouter au panier" */
.cpp-btn-enabled {
    background: linear-gradient(135deg, var(--cpp-violet) 0%, var(--cpp-violet-light) 100%) !important;
    color: white !important;
    border-color: var(--cpp-violet) !important;
    box-shadow: var(--cpp-promotion-shadow) !important;
    transform: translateY(-2px) !important;
    animation: pulseGlow 2s infinite !important;
}

.cpp-btn-disabled {
    background: #e9ecef !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    animation: none !important;
}

.cpp-btn-disabled:hover {
    background: #e9ecef !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Animation de pulsation pour le bouton activé */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: var(--cpp-promotion-shadow);
    }
    50% {
        box-shadow: 0 12px 35px rgba(160, 32, 240, 0.25);
    }
}

/* Section de promotion d'abonnement */
.cpp-subscription-promotion {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.05) 0%, rgba(255, 109, 0, 0.05) 100%);
    border: 1px solid rgba(160, 32, 240, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(160, 32, 240, 0.1);
    animation: slideInUp 0.3s ease-out;
}

/* Masquer les conteneurs vides */
.cpp-subscription-promotion:empty {
    display: none !important;
}

.cpp-subscription-promotion:not(:has(.cpp-btn)) {
    display: none !important;
}

/* Message de contremarque avec boutons intégrés */
.cpp-watermark-message {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.cpp-watermark-message > span {
    margin-bottom: 0;
}

/* Boutons intégrés au message */
.cpp-promotion-buttons-integrated {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.cpp-promotion-buttons-integrated .cpp-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 6px;
}

.cpp-promotion-buttons-integrated .cpp-btn i {
    font-size: 12px;
}

.cpp-promotion-header {
    text-align: center;
    margin-bottom: 20px;
}

.cpp-promotion-header h4 {
    font-family: 'Righteous', cursive;
    font-size: 1.4rem;
    background: var(--cpp-promotion-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.3;
}

.cpp-promotion-header p {
    font-family: 'Gilroy', sans-serif;
    color: var(--cpp-text-light);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

.cpp-promotion-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.cpp-promotion-buttons .cpp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Gilroy', sans-serif;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.cpp-promotion-buttons .cpp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cpp-promotion-buttons .cpp-btn:hover::before {
    left: 100%;
}

.cpp-promotion-buttons .cpp-btn i {
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.cpp-promotion-buttons .cpp-btn:hover i {
    opacity: 1;
}

.cpp-subscription-btn {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.15) 0%, rgba(160, 32, 240, 0.25) 100%) !important;
    color: #6B46C1 !important;
    border: 1px solid rgba(160, 32, 240, 0.3) !important;
    box-shadow: 0 2px 8px rgba(160, 32, 240, 0.15) !important;
}

.cpp-subscription-btn:hover {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.25) 0%, rgba(160, 32, 240, 0.35) 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(160, 32, 240, 0.25) !important;
    color: #5B21B6 !important;
}

.cpp-details-btn {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.15) 0%, rgba(255, 109, 0, 0.25) 100%) !important;
    color: #EA580C !important;
    border: 1px solid rgba(255, 109, 0, 0.3) !important;
    box-shadow: 0 2px 8px rgba(255, 109, 0, 0.15) !important;
}

.cpp-details-btn:hover {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.25) 0%, rgba(255, 109, 0, 0.35) 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 109, 0, 0.25) !important;
    color: #DC2626 !important;
}

.cpp-comparison-btn {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.08) 0%, rgba(255, 109, 0, 0.08) 100%) !important;
    color: #7C3AED !important;
    border: 1px solid rgba(160, 32, 240, 0.2) !important;
    box-shadow: 0 2px 6px rgba(160, 32, 240, 0.1) !important;
}

.cpp-comparison-btn:hover {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.15) 0%, rgba(255, 109, 0, 0.15) 100%) !important;
    color: #6B46C1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(160, 32, 240, 0.2) !important;
}

.cpp-promotion-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(160, 32, 240, 0.1);
}

.cpp-promotion-footer small {
    font-family: 'Gilroy', sans-serif;
    color: var(--cpp-text-light);
    font-size: 12px;
    line-height: 1.4;
}

.cpp-promotion-footer strong {
    color: var(--cpp-violet);
    font-weight: 700;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .cpp-promotion-buttons {
        gap: 10px;
    }
    
    .cpp-promotion-buttons .cpp-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .cpp-promotion-header h4 {
        font-size: 1.2rem;
    }
    
    .cpp-promotion-header p {
        font-size: 0.9rem;
    }
    
    .cpp-subscription-promotion {
        padding: 15px;
        margin-top: 20px;
    }
    
    .cpp-validation-message {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Boutons intégrés sur mobile */
    .cpp-promotion-buttons-integrated {
        flex-direction: column;
        gap: 6px;
    }
    
    .cpp-promotion-buttons-integrated .cpp-btn {
        flex: none;
        min-width: auto;
        width: 100%;
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cpp-promotion-buttons .cpp-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .cpp-promotion-header h4 {
        font-size: 1.1rem;
    }
    
    .cpp-promotion-header p {
        font-size: 0.85rem;
    }
    
    .cpp-subscription-promotion {
        padding: 12px;
    }
    
    .cpp-validation-message {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .cpp-validation-message i {
        font-size: 14px;
    }
    
    /* Boutons intégrés sur très petits écrans */
    .cpp-promotion-buttons-integrated .cpp-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .cpp-promotion-buttons-integrated .cpp-btn i {
        font-size: 11px;
    }
}

/* États spéciaux pour les produits sans variantes */
.cpp-no-variants .cpp-cart-validation-message {
    display: none;
}

.cpp-no-variants .cpp-subscription-promotion {
    margin-top: 15px;
}

/* Amélioration de l'accessibilité */
.cpp-validation-message:focus {
    outline: 2px solid var(--cpp-violet);
    outline-offset: 2px;
}

.cpp-promotion-buttons .cpp-btn:focus {
    outline: 2px solid var(--cpp-violet);
    outline-offset: 2px;
}

/* Mode sombre (si nécessaire) */
@media (prefers-color-scheme: dark) {
    .cpp-subscription-promotion {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: rgba(160, 32, 240, 0.3);
    }
    
    .cpp-promotion-header p {
        color: #e2e8f0;
    }
    
    .cpp-promotion-footer {
        border-color: rgba(160, 32, 240, 0.2);
    }
    
    .cpp-promotion-footer small {
        color: #e2e8f0;
    }
}

/* Indicateur de chargement pour les boutons */
.cpp-promotion-buttons .cpp-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cpp-promotion-buttons .cpp-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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