/*
 * ═══════════════════════════════════════════════════════
 *  DWIJA Diamond — Toast Notifications
 *  Premium, on-brand toast for every frontend action
 *  (Add to Cart, Login, Contact, Wishlist, …)
 *
 *  Styles the existing JS markup — no JS changes needed:
 *    • .cart-notification / -success / -error / -info   (cart.js → CartManager.showToast, auth, contact)
 *    • .wishlist-notification (Bootstrap alert)          (wishlist.js)
 * ═══════════════════════════════════════════════════════
 */

:root {
    --toast-rose: #B76E79;
    --toast-rose-deep: #8E5158;
    --toast-rose-pale: #E8C4C9;
    --toast-cream: #FFF8F4;
    --toast-charcoal: #2D2424;
    --toast-ink: #3A2E2E;
    --toast-text: #4A3C3C;
    --toast-line: #EBD8D0;
    --toast-success: #1E8449;
    --toast-error: #C0392B;
    --toast-radius: 14px;
    --toast-shadow: 0 18px 44px rgba(45, 36, 36, 0.18), 0 6px 16px rgba(183, 110, 121, 0.14);
}

/* ═══════════════════════════════════════════════════════
   SHARED CARD  (both toast systems)
   ═══════════════════════════════════════════════════════ */
.cart-notification,
.wishlist-notification.alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: auto;
    min-width: 300px;
    max-width: 400px;
    margin: 0;
    padding: 16px 20px 16px 18px;
    border: 1px solid var(--toast-line);
    border-left: 4px solid var(--toast-rose);
    border-radius: var(--toast-radius);
    background: linear-gradient(135deg, #FFFFFF 0%, var(--toast-cream) 100%);
    color: var(--toast-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.005em;
    box-shadow: var(--toast-shadow);
    overflow: hidden;
}

/* ── Icon badge (::before) ── */
.cart-notification::before,
.wishlist-notification.alert::before {
    content: "\f05a"; /* info-circle (default) */
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 17px;
    line-height: 1;
    background: rgba(183, 110, 121, 0.12);
    color: var(--toast-rose);
}

/* ── Progress bar (::after) ── */
.cart-notification::after,
.wishlist-notification.alert::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--toast-rose), var(--toast-rose-pale));
    transform: scaleX(1);
    transform-origin: left center;
}

/* ═══════════════════════════════════════════════════════
   CART / GENERIC TOAST  (cart.js, auth, contact)
   ═══════════════════════════════════════════════════════ */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 24px;
    left: auto;
    z-index: 100000;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification.show::after {
    animation: toast-progress 3s linear forwards;
}

/* Type variants — icon glyph + accent colour */
.cart-notification-success { border-left-color: var(--toast-success); }
.cart-notification-success::before {
    content: "\f00c"; /* check */
    background: rgba(30, 132, 73, 0.12);
    color: var(--toast-success);
}
.cart-notification-success::after {
    background: linear-gradient(90deg, var(--toast-success), rgba(30, 132, 73, 0.4));
}

.cart-notification-error { border-left-color: var(--toast-error); }
.cart-notification-error::before {
    content: "\f071"; /* exclamation-triangle */
    background: rgba(192, 57, 43, 0.12);
    color: var(--toast-error);
}
.cart-notification-error::after {
    background: linear-gradient(90deg, var(--toast-error), rgba(192, 57, 43, 0.4));
}

.cart-notification-info { border-left-color: var(--toast-rose); }

/* ═══════════════════════════════════════════════════════
   WISHLIST TOAST  (Bootstrap alert override)
   ═══════════════════════════════════════════════════════ */
#wishlist-notification-container {
    top: 100px !important;
    right: 24px !important;
    left: auto !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100000 !important;
}

.wishlist-notification.alert {
    animation: toast-slide-in 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.wishlist-notification.alert::after {
    animation: toast-progress 3s linear forwards;
}

/* Success / danger / info variants */
.wishlist-notification.alert-success { border-left-color: var(--toast-success); }
.wishlist-notification.alert-success::before {
    content: "\f00c";
    background: rgba(30, 132, 73, 0.12);
    color: var(--toast-success);
}
.wishlist-notification.alert-success::after {
    background: linear-gradient(90deg, var(--toast-success), rgba(30, 132, 73, 0.4));
}

.wishlist-notification.alert-danger { border-left-color: var(--toast-error); }
.wishlist-notification.alert-danger::before {
    content: "\f071";
    background: rgba(192, 57, 43, 0.12);
    color: var(--toast-error);
}
.wishlist-notification.alert-danger::after {
    background: linear-gradient(90deg, var(--toast-error), rgba(192, 57, 43, 0.4));
}

.wishlist-notification.alert-info { border-left-color: var(--toast-rose); }

/* Close button */
.wishlist-notification.alert .close {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    padding: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--toast-text);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    opacity: 0.6;
    text-shadow: none;
    transition: all 0.25s ease;
}
.wishlist-notification.alert .close:hover {
    opacity: 1;
    background: rgba(183, 110, 121, 0.12);
    color: var(--toast-rose-deep);
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 575px) {
    .cart-notification,
    #wishlist-notification-container {
        top: 84px !important;
        right: 12px !important;
        left: 12px !important;
    }
    .cart-notification,
    .wishlist-notification.alert {
        min-width: 0;
        max-width: none;
        width: auto;
        padding: 14px 16px;
        font-size: 13.5px;
    }
    #wishlist-notification-container {
        width: auto;
    }
    .cart-notification { transform: translateY(-120%); }
    .cart-notification.show { transform: translateY(0); }
    .cart-notification::before,
    .wishlist-notification.alert::before {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

/* ═══════════════════════════════════════════════════════
   MOTION PREFERENCE
   ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .cart-notification,
    .wishlist-notification.alert { transition: opacity 0.2s ease; animation: none; }
    .cart-notification.show::after,
    .wishlist-notification.alert::after { animation: none; }
}
