/* =====================================================================================================================
   notifications-v1.css - toast notifications (core, all shops); behaviour in js/notifications-v1.js.

   WHY: the stock .bar-notification was a full-width coloured strip fixed over the header (green success / red error,
   14px centred white text, a PNG close at 20px). Now a card: top right under the header on desktop, above the tab bar
   on phones, with a type icon, an accent rail, a 32px close button and a countdown line while it auto-hides.

   SHOP TOKENS: set them in a GLOBAL `:root { }` of the shop's mobile-shop-overrides.css (no :root here on purpose:
   every rule reads var(--nt-x, <neutral default>)).
     --nt-font  --nt-size        family / size of the message      --nt-bg  --nt-fg   card background / text
     --nt-border                 card hairline                     --nt-radius        card corners
     --nt-success / -error / -warning   accent rail, icon and countdown per type
     --nt-link                   links inside the message ("shopping cart")       --nt-muted   close glyph
     --nt-top                    desktop distance from the top of the window (clear of the shop's header)
     --nt-shadow                 card shadow
   Specificity: #bar-notification + class (1,1,0) beats simplex.styles.css .bar-notification (0,1,0..0,2,1).
   Cache: bump the file name (-v2) on any change (and in Head.cshtml).
   ===================================================================================================================== */

#bar-notification.bar-notification-container {
    position: fixed;
    top: var(--nt-top, 96px);
    right: 16px;
    left: auto;
    z-index: 1000000002;   /* above the floating a11y trigger (1000000000) and #backTop */
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

#bar-notification .bar-notification.nt-toast {
    --nt-accent: var(--nt-success, #2e7d4f);
    position: relative;
    top: auto;
    left: auto;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    width: auto;
    margin: 0;
    padding: 14px 48px 14px 16px;
    border: 1px solid var(--nt-border, #e3e3e3);
    border-left: 4px solid var(--nt-accent);
    border-radius: var(--nt-radius, 6px);
    background: var(--nt-bg, #fff);
    color: var(--nt-fg, #222);
    box-shadow: var(--nt-shadow, 0 12px 32px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06));
    font-family: var(--nt-font, inherit);
    font-size: var(--nt-size, 14px);
    line-height: 1.45;
    text-align: left;
    overflow: hidden;
    pointer-events: auto;
    animation: nt-in .22s ease-out both;
}
#bar-notification .bar-notification.nt-toast.error { --nt-accent: var(--nt-error, #b3261e); }
#bar-notification .bar-notification.nt-toast.warning { --nt-accent: var(--nt-warning, #a15c00); }

#bar-notification .nt-icon { flex: 0 0 20px; height: 20px; margin-top: 1px; color: var(--nt-accent); }
#bar-notification .nt-icon svg { display: block; }
#bar-notification .nt-body { flex: 1 1 auto; min-width: 0; }
#bar-notification .bar-notification.nt-toast p.content {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    overflow-wrap: anywhere;
}
#bar-notification .bar-notification.nt-toast p.content + p.content { margin-top: 6px; }
#bar-notification .bar-notification.nt-toast p.content a {
    color: var(--nt-link, var(--nt-accent));
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#bar-notification .bar-notification.nt-toast p.content a:hover { color: var(--nt-link, var(--nt-accent)); text-decoration: none; }

#bar-notification .bar-notification.nt-toast .close {
    position: absolute;
    top: 8px;
    right: 8px;
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--nt-muted, #666);
    opacity: 1;
    cursor: pointer;
}
#bar-notification .bar-notification.nt-toast .close svg { width: 18px; height: 18px; }
#bar-notification .bar-notification.nt-toast .close:hover { background: rgba(0, 0, 0, .06); color: var(--nt-fg, #222); }
#bar-notification .bar-notification.nt-toast .close:focus-visible { outline: 2px solid var(--nt-fg, #222); outline-offset: 1px; }

/* countdown while a success auto-hides; stops while hovered / focused */
#bar-notification .nt-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--nt-accent);
    opacity: .35;
    transform-origin: left center;
    animation: nt-countdown linear forwards;
}
#bar-notification .nt-toast.is-paused .nt-progress { animation-play-state: paused; }
#bar-notification .nt-toast.is-leaving { animation: nt-out .18s ease-in forwards; }

@keyframes nt-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes nt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes nt-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* phones: full width above the bottom tab bar (and above the PDP's add-to-cart bar when it is up) */
@media (max-width: 767.98px) {
    #bar-notification.bar-notification-container {
        top: auto;
        right: 12px;
        left: 12px;
        bottom: calc(var(--m-bottomnav-h, 56px) + env(safe-area-inset-bottom, 0px) + 12px);
        width: auto;
    }
    html:has(.m-pdp-cta.m-show) #bar-notification.bar-notification-container {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
    }
    @keyframes nt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    @keyframes nt-out { to { opacity: 0; transform: translateY(6px); } }
}

@media (prefers-reduced-motion: reduce) {
    #bar-notification .bar-notification.nt-toast,
    #bar-notification .nt-toast.is-leaving { animation: none; }
    #bar-notification .nt-progress { display: none; }
}
