/* ================================================================
   UPSELL TOAST + SUGGESTIONS PANIER — CSS
   ================================================================
   Styles pour :
   1. Le toast notification (bas de l'écran, après ajout panier)
   2. La section suggestions dans le panneau panier
   
   Design discret, élégant, jamais agressif.
   Utilise les CSS variables du thème photographe.
   
   Emplacement : public/modules/promotion/css/upsell-toast.css
   ================================================================ */

/* ================================================================
   1. TOAST UPSELL — Notification bas d'écran
   ================================================================ */
.upsell-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 10500;
    width: 92%;
    max-width: 420px;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
}

.upsell-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.upsell-toast.dismissing {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
    transition-duration: 0.3s;
}

/* Barre timer auto-dismiss */
.upsell-toast__timer {
    height: 3px;
    background: #EDF2F7;
    width: 100%;
}

.upsell-toast__timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color, #6B9ECE) 0%, #9B8EC5 100%);
    width: 100%;
    transform-origin: left;
    transition: transform linear;
}

.upsell-toast__timer-bar.running {
    transform: scaleX(0);
}

/* Body du toast */
.upsell-toast__body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

/* Icône */
.upsell-toast__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(107, 158, 206, 0.12) 0%, rgba(155, 142, 197, 0.1) 100%);
}

.upsell-toast__icon i {
    width: 20px;
    height: 20px;
    color: var(--accent-color, #6B9ECE);
}

/* Icônes par type */
.upsell-toast__icon--upgrade {
    background: linear-gradient(135deg, rgba(107, 158, 206, 0.12) 0%, rgba(155, 142, 197, 0.1) 100%);
}

.upsell-toast__icon--upgrade i { color: #6B9ECE; }

.upsell-toast__icon--complement {
    background: linear-gradient(135deg, rgba(126, 200, 163, 0.12) 0%, rgba(107, 158, 206, 0.1) 100%);
}

.upsell-toast__icon--complement i { color: #7EC8A3; }

.upsell-toast__icon--crosssell {
    background: linear-gradient(135deg, rgba(155, 142, 197, 0.12) 0%, rgba(232, 153, 141, 0.1) 100%);
}

.upsell-toast__icon--crosssell i { color: #9B8EC5; }

.upsell-toast__icon--bundle {
    background: linear-gradient(135deg, rgba(232, 153, 141, 0.12) 0%, rgba(240, 219, 165, 0.1) 100%);
}

.upsell-toast__icon--bundle i { color: #E8998D; }

.upsell-toast__icon--social_proof {
    background: linear-gradient(135deg, rgba(240, 219, 165, 0.12) 0%, rgba(126, 200, 163, 0.1) 100%);
}

.upsell-toast__icon--social_proof i { color: #D4A017; }

/* Contenu texte */
.upsell-toast__content {
    flex: 1;
    min-width: 0;
}

.upsell-toast__message {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #2D3748);
    margin: 0;
    line-height: 1.35;
}

.upsell-toast__detail {
    font-size: 12px;
    color: #718096;
    margin: 3px 0 0;
    line-height: 1.3;
}

/* Actions */
.upsell-toast__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.upsell-toast__btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.upsell-toast__btn i {
    width: 16px;
    height: 16px;
}

/* Bouton principal (Ajouter) */
.upsell-toast__btn--primary {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: var(--accent-color, #6B9ECE);
    color: white;
}

.upsell-toast__btn--primary:hover {
    filter: brightness(0.92);
    transform: scale(1.03);
}

/* Bouton fermer */
.upsell-toast__btn--dismiss {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: #CBD5E0;
    flex-shrink: 0;
}

.upsell-toast__btn--dismiss:hover {
    background: #F8F9FA;
    color: #718096;
}

/* ================================================================
   2. SECTION SUGGESTIONS — Dans le panneau panier
   ================================================================ */
.upsell-suggestions {
    padding: 0 20px 16px;
}

/* Header avec titre centré entre deux lignes */
.upsell-suggestions__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-top: 4px;
}

.upsell-suggestions__divider {
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.upsell-suggestions__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #A0AEC0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.upsell-suggestions__title i {
    width: 14px;
    height: 14px;
    color: var(--accent-color, #6B9ECE);
}

/* Liste des suggestions */
.upsell-suggestions__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Loader */
.upsell-suggestions__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    color: #CBD5E0;
}

.upsell-suggestions__loader i {
    width: 20px;
    height: 20px;
}

/* ================================================================
   CARTE SUGGESTION
   ================================================================ */
.upsell-suggestion-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #EDF2F7;
    border-radius: 10px;
    background: #FAFBFC;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.upsell-suggestion-card:hover {
    border-color: var(--accent-color, #6B9ECE);
    background: #FFFFFF;
    transform: translateX(2px);
}

/* Icône contextuelle */
.upsell-suggestion-card__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(107, 158, 206, 0.1) 0%, rgba(155, 142, 197, 0.08) 100%);
}

.upsell-suggestion-card__icon i {
    width: 16px;
    height: 16px;
    color: var(--accent-color, #6B9ECE);
}

/* Icônes par type */
.upsell-suggestion-card[data-type="upgrade"] .upsell-suggestion-card__icon i { color: #6B9ECE; }
.upsell-suggestion-card[data-type="complement"] .upsell-suggestion-card__icon i { color: #7EC8A3; }
.upsell-suggestion-card[data-type="crosssell"] .upsell-suggestion-card__icon i { color: #9B8EC5; }
.upsell-suggestion-card[data-type="bundle"] .upsell-suggestion-card__icon i { color: #E8998D; }
.upsell-suggestion-card[data-type="social_proof"] .upsell-suggestion-card__icon i { color: #D4A017; }
.upsell-suggestion-card[data-type="sibling"] .upsell-suggestion-card__icon i { color: #E8998D; }

.upsell-suggestion-card[data-type="complement"] .upsell-suggestion-card__icon {
    background: linear-gradient(135deg, rgba(126, 200, 163, 0.1) 0%, rgba(107, 158, 206, 0.08) 100%);
}

.upsell-suggestion-card[data-type="crosssell"] .upsell-suggestion-card__icon {
    background: linear-gradient(135deg, rgba(155, 142, 197, 0.1) 0%, rgba(232, 153, 141, 0.08) 100%);
}

.upsell-suggestion-card[data-type="bundle"] .upsell-suggestion-card__icon,
.upsell-suggestion-card[data-type="sibling"] .upsell-suggestion-card__icon {
    background: linear-gradient(135deg, rgba(232, 153, 141, 0.1) 0%, rgba(240, 219, 165, 0.08) 100%);
}

.upsell-suggestion-card[data-type="social_proof"] .upsell-suggestion-card__icon {
    background: linear-gradient(135deg, rgba(240, 219, 165, 0.1) 0%, rgba(126, 200, 163, 0.08) 100%);
}

/* Contenu */
.upsell-suggestion-card__content {
    flex: 1;
    min-width: 0;
}

.upsell-suggestion-card__message {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color, #4A5568);
    margin: 0;
    line-height: 1.35;
}

.upsell-suggestion-card__detail {
    font-size: 12px;
    color: #7EC8A3;
    font-weight: 600;
    margin-top: 2px;
}

/* Bouton ajouter */
.upsell-suggestion-card__btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--accent-color, #6B9ECE);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, filter 0.15s;
}

.upsell-suggestion-card__btn:hover {
    transform: scale(1.1);
    filter: brightness(0.92);
}

.upsell-suggestion-card__btn i {
    width: 16px;
    height: 16px;
}

/* État loading d'une suggestion */
.upsell-suggestion-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.upsell-suggestion-card.loading .upsell-suggestion-card__btn {
    animation: spin 0.8s linear infinite;
}

/* Animation entrée des suggestions */
.upsell-suggestion-card {
    animation: suggestionSlideIn 0.3s ease both;
}

.upsell-suggestion-card:nth-child(1) { animation-delay: 0s; }
.upsell-suggestion-card:nth-child(2) { animation-delay: 0.08s; }
.upsell-suggestion-card:nth-child(3) { animation-delay: 0.16s; }

@keyframes suggestionSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */
@media (max-width: 768px) {
    /* Toast : pleine largeur en bas */
    .upsell-toast {
        bottom: 0;
        left: 0;
        transform: translateX(0) translateY(120%);
        width: 100%;
        max-width: 100%;
        border-radius: 14px 14px 0 0;
    }

    .upsell-toast.visible {
        transform: translateX(0) translateY(0);
    }

    .upsell-toast.dismissing {
        transform: translateX(0) translateY(120%);
    }

    .upsell-toast__body {
        padding: 12px 14px;
    }

    .upsell-toast__icon {
        width: 36px;
        height: 36px;
    }

    .upsell-toast__message {
        font-size: 13px;
    }

    /* Suggestions : dans le panneau (déjà responsive via le panneau) */
    .upsell-suggestions {
        padding: 0 16px 12px;
    }

    .upsell-suggestion-card {
        padding: 8px 10px;
    }

    .upsell-suggestion-card__icon {
        width: 30px;
        height: 30px;
    }

    .upsell-suggestion-card__message {
        font-size: 12px;
    }
}

/* ================================================================
   ANIMATION SPIN (réutilisée)
   ================================================================ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
