/* =============================================
   Purchase Notify – Frontend Notification Styles
   ============================================= */

#pn-notification-wrap {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    width: 340px;
    max-width: calc(100vw - 24px);
}

/* ---- Positions ---- */
#pn-notification-wrap.pn-position-bottom-right {
    bottom: 24px;
    right: 24px;
}
#pn-notification-wrap.pn-position-bottom-left {
    bottom: 24px;
    left: 24px;
}
#pn-notification-wrap.pn-position-top-right {
    top: 24px;
    right: 24px;
}
#pn-notification-wrap.pn-position-top-left {
    top: 24px;
    left: 24px;
}

/* ---- Notification Card ---- */
.pn-notification {
    pointer-events: all;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 14px 16px 20px;
    overflow: hidden;
    border-left: 4px solid #7b5cf0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    will-change: opacity, transform;
}

.pn-notification.pn-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Themes ---- */
.pn-notification.pn-theme-dark {
    background: #1e1e2e;
    color: #e2e2f0;
    border-left-color: #7b5cf0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.pn-notification.pn-theme-success {
    border-left-color: #22c55e;
}
.pn-notification.pn-theme-brand {
    background: linear-gradient(135deg, #7b5cf0 0%, #5b3dd5 100%);
    color: #fff;
    border-left: none;
}
.pn-notification.pn-theme-brand .pn-source {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.pn-notification.pn-theme-brand .pn-close {
    color: rgba(255,255,255,0.8);
}
.pn-notification.pn-theme-brand .pn-product-link {
    color: #fff;
    text-decoration-color: rgba(255,255,255,0.5);
}

/* ---- Avatar / Product Image ---- */
.pn-avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f0ff;
    border: 2px solid #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pn-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Content ---- */
.pn-content {
    flex: 1;
    min-width: 0;
}
.pn-message {
    margin: 0 0 6px;
    color: #374151;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
}
.pn-theme-dark .pn-message {
    color: #e2e2f0;
}
.pn-theme-brand .pn-message {
    color: #fff;
}

.pn-buyer-name {
    font-weight: 700;
    color: #1f2937;
}
.pn-theme-dark .pn-buyer-name {
    color: #fff;
}
.pn-theme-brand .pn-buyer-name {
    color: #fff;
}

.pn-product-link {
    color: #7b5cf0;
    text-decoration: underline;
    text-decoration-color: #c4b5fd;
    font-weight: 600;
    word-break: break-word;
}
.pn-product-link:hover {
    color: #5b3dd5;
}

/* ---- Meta row ---- */
.pn-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pn-flag {
    border-radius: 2px;
    vertical-align: middle;
}
.pn-time {
    font-size: 11.5px;
    color: #9ca3af;
    font-weight: 400;
}
.pn-theme-dark .pn-time {
    color: #6b7280;
}
.pn-theme-brand .pn-time {
    color: rgba(255,255,255,0.7);
}

.pn-source {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.5;
}
.pn-source-woo {
    background: #f0eaff;
    color: #7b5cf0;
}
.pn-source-envato {
    background: #e6f7ea;
    color: #1e8b34;
}
.pn-source-stripe {
    background: #eef2ff;
    color: #4f46e5;
}

/* ---- Close button ---- */
#pn-notification-wrap .pn-close {
    all: unset;
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.08) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #6b7280 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    min-height: unset !important;
    transition: background 0.2s, color 0.2s;
}
#pn-notification-wrap .pn-close:hover {
    background: rgba(0, 0, 0, 0.15) !important;
    color: #1f2937 !important;
}
.pn-theme-brand #pn-notification-wrap .pn-close,
.pn-notification.pn-theme-brand .pn-close {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

/* ---- Progress bar ---- */
.pn-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.06);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
}
.pn-progress-bar span {
    display: block;
    height: 100%;
    background: #7b5cf0;
    width: 100%;
    transform-origin: left;
    transition: none;
}
.pn-notification.pn-theme-success .pn-progress-bar span {
    background: #22c55e;
}
.pn-notification.pn-theme-brand .pn-progress-bar span {
    background: rgba(255,255,255,0.5);
}

/* ---- Animation classes ---- */
@keyframes pn-slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pn-slideOutDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(30px); }
}
@keyframes pn-slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pn-slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pn-slideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes pn-slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}
@keyframes pn-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pn-fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes pn-bounceIn {
    0%   { opacity: 0; transform: scale(0.7); }
    60%  { opacity: 1; transform: scale(1.05); }
    80%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}

.pn-anim-slideInUp    { animation: pn-slideInUp    0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.pn-anim-slideInLeft  { animation: pn-slideInLeft  0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.pn-anim-slideInRight { animation: pn-slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.pn-anim-fadeIn       { animation: pn-fadeIn       0.4s ease forwards; }
.pn-anim-bounceIn     { animation: pn-bounceIn     0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

.pn-anim-slideOutDown  { animation: pn-slideOutDown  0.35s ease forwards; }
.pn-anim-slideOutLeft  { animation: pn-slideOutLeft  0.35s ease forwards; }
.pn-anim-slideOutRight { animation: pn-slideOutRight 0.35s ease forwards; }
.pn-anim-fadeOut       { animation: pn-fadeOut       0.35s ease forwards; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
    #pn-notification-wrap {
        width: calc(100vw - 24px);
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    #pn-notification-wrap.pn-position-bottom-left,
    #pn-notification-wrap.pn-position-bottom-right {
        right: 12px;
        left: 12px;
    }
}

.pn-source-woo {
    display: none;
}
