/**
 * GHA Theme - Toast notification ajout panier
 *
 * Toast fixe en haut de page pour confirmation AJAX d'ajout au panier.
 * Chargé uniquement sur les pages single cours.
 *
 * @package GHA Theme
 * @since 2.0.0
 */

/* ==========================================================================
   TOAST CONTAINER
   ========================================================================== */
.gha-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: 800px;
    width: calc(100% - 32px);
    pointer-events: none;
    animation: ghaToastSlideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.gha-toast.gha-toast--hiding {
    animation: ghaToastFadeOut 0.3s ease forwards;
}

/* ==========================================================================
   TOAST INNER
   ========================================================================== */
.gha-toast-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

/* Success variant */
.gha-toast--success .gha-toast-inner {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
}

/* Error variant */
.gha-toast--error .gha-toast-inner {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

/* ==========================================================================
   TOAST ELEMENTS
   ========================================================================== */
.gha-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.gha-toast--success .gha-toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.gha-toast--error .gha-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.gha-toast-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    min-width: 0;
}

.gha-toast--success .gha-toast-text {
    color: #166534;
}

.gha-toast--error .gha-toast-text {
    color: #991b1b;
}

.gha-toast-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #16a34a;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.gha-toast-cta:hover {
    background: #15803d;
    color: #fff !important;
}

.gha-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.gha-toast-close:hover {
    color: #475569;
    background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes ghaToastSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes ghaToastFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
}

/* ==========================================================================
   BUTTON STATE — After add to cart, replace button
   ========================================================================== */
.tutor-add-to-cart-button.gha-added {
    pointer-events: none;
    opacity: 0.7;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
    .gha-toast {
        top: 8px;
        width: calc(100% - 16px);
    }

    .gha-toast-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .gha-toast-text {
        font-size: 13px;
        flex-basis: calc(100% - 80px);
    }

    .gha-toast-cta {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        order: 4;
    }

    .gha-toast-close {
        margin-left: auto;
    }
}
