/* =========================================================================
   NotifyWhenAvailable — Nitro Edition
   The values below are defaults; the admin's "Popup styling" settings override
   them at runtime via a generated .nwa-root block (see controller::customcss).
   Palette shared with X-Gift:
     --nwa-brand      : #01436A  navy (primary)
     --nwa-brand-2    : #033553  navy dark (hover)
     --nwa-accent     : #2FA7DF  bright cyan
   Everything is scoped under .nwa-root / .nwa-* so the theme cannot bleed in.
   ========================================================================= */

.nwa-root {
    --nwa-brand: #01436A;
    --nwa-brand-2: #033553;
    --nwa-accent: #2FA7DF;
    --nwa-accent-soft: #D7E4FE;
    --nwa-accent-tint: #EEF5FF;
    --nwa-ink: #0F1F2E;
    --nwa-muted: #6B7A88;
    --nwa-line: #E7ECF1;
    --nwa-line-strong: #CFD9E3;
    --nwa-bg: #ffffff;
    --nwa-bg-soft: #F7F9FC;
    --nwa-success: #2E8B57;
    --nwa-danger: #D64545;
    --nwa-radius: 16px;
    --nwa-radius-sm: 10px;
    --nwa-shadow: 0 4px 8px rgba(1, 67, 106, .08), 0 24px 60px rgba(1, 67, 106, .18);

    font-family: inherit;
    color: var(--nwa-ink);
    line-height: 1.45;
    box-sizing: border-box;
}

.nwa-root *,
.nwa-root *::before,
.nwa-root *::after {
    box-sizing: inherit;
}

/* --------------------------------------------------------------------- */
/* Overlay                                                                */
/* --------------------------------------------------------------------- */

.nwa-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 24, 38, .55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nwa-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------------------- */
/* Dialog                                                                 */
/* --------------------------------------------------------------------- */

.nwa-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: auto;
    background: var(--nwa-bg);
    border-radius: var(--nwa-radius);
    box-shadow: var(--nwa-shadow);
    overflow: hidden;
    transform: translateY(16px) scale(.97);
    opacity: 0;
    transition: transform .26s cubic-bezier(.16, 1, .3, 1), opacity .26s ease;
}

.nwa-overlay.is-open .nwa-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* --------------------------------------------------------------------- */
/* Header                                                                 */
/* --------------------------------------------------------------------- */

.nwa-modal__head {
    position: relative;
    padding: 26px 26px 22px;
    background: linear-gradient(135deg, var(--nwa-brand) 0%, var(--nwa-brand-2) 100%);
    color: #fff;
    overflow: hidden;
}

.nwa-modal__head::after {
    content: "";
    position: absolute;
    top: -55%;
    right: -12%;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 167, 223, .40) 0%, transparent 65%);
    pointer-events: none;
}

.nwa-modal__icon {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    margin-bottom: 14px;
}

.nwa-modal__icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nwa-modal__title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #fff;
    text-transform: none;
}

.nwa-modal__sub {
    position: relative;
    z-index: 1;
    margin: 6px 0 0;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .78);
}

/* Close button */
.nwa-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.nwa-close:hover,
.nwa-close:focus {
    background: rgba(255, 255, 255, .26);
    transform: rotate(90deg);
    outline: none;
}

.nwa-close svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* --------------------------------------------------------------------- */
/* Body                                                                   */
/* --------------------------------------------------------------------- */

.nwa-modal__body {
    padding: 22px 26px 26px;
}

/* Product summary card */
.nwa-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 18px;
    background: var(--nwa-bg-soft);
    border: 1px solid var(--nwa-line);
    border-radius: var(--nwa-radius-sm);
}

.nwa-product__img {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--nwa-line);
    object-fit: contain;
    padding: 3px;
}

.nwa-product__meta {
    min-width: 0;
}

.nwa-product__name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--nwa-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nwa-product__model {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--nwa-muted);
}

.nwa-intro {
    margin: 0 0 18px;
    font-size: 13.5px;
    color: var(--nwa-muted);
}

/* --------------------------------------------------------------------- */
/* Form fields                                                            */
/* --------------------------------------------------------------------- */

.nwa-field {
    margin-bottom: 14px;
}

.nwa-field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--nwa-ink);
}

.nwa-root input.nwa-input,
.nwa-root textarea.nwa-input {
    display: block;
    width: 100%;
    height: auto;
    padding: 11px 13px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--nwa-ink);
    background: #fff;
    border: 1px solid var(--nwa-line-strong);
    border-radius: var(--nwa-radius-sm);
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.nwa-root textarea.nwa-input {
    min-height: 74px;
    resize: vertical;
}

.nwa-root input.nwa-input::placeholder,
.nwa-root textarea.nwa-input::placeholder {
    color: #9AA8B5;
}

.nwa-root input.nwa-input:focus,
.nwa-root textarea.nwa-input:focus {
    outline: none;
    border-color: var(--nwa-accent);
    box-shadow: 0 0 0 3px rgba(47, 167, 223, .18);
}

.nwa-field.has-error input.nwa-input,
.nwa-field.has-error textarea.nwa-input {
    border-color: var(--nwa-danger);
    background: #FFF7F7;
}

.nwa-field.has-error input.nwa-input:focus,
.nwa-field.has-error textarea.nwa-input:focus {
    box-shadow: 0 0 0 3px rgba(214, 69, 69, .16);
}

.nwa-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--nwa-danger);
}

/* Captcha */
.nwa-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nwa-captcha input.nwa-input {
    flex: 1 1 auto;
}

.nwa-captcha__img {
    flex: 0 0 auto;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--nwa-line-strong);
    cursor: pointer;
}

/* Consent checkbox */
.nwa-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 4px 0 16px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--nwa-muted);
    cursor: pointer;
}

.nwa-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--nwa-accent);
    cursor: pointer;
}

.nwa-consent a {
    color: var(--nwa-brand);
    text-decoration: underline;
}

.nwa-consent.has-error {
    color: var(--nwa-danger);
}

/* --------------------------------------------------------------------- */
/* Submit button                                                          */
/* --------------------------------------------------------------------- */

.nwa-root .nwa-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 18px;
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: .3px;
    color: #fff;
    background: linear-gradient(135deg, var(--nwa-brand) 0%, var(--nwa-brand-2) 100%);
    border: 0;
    border-radius: var(--nwa-radius-sm);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
    box-shadow: 0 4px 14px rgba(1, 67, 106, .22);
    text-transform: none;
}

.nwa-root .nwa-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(1, 67, 106, .3);
}

.nwa-root .nwa-submit:active:not(:disabled) {
    transform: translateY(0);
}

.nwa-root .nwa-submit:disabled {
    opacity: .65;
    cursor: default;
    box-shadow: none;
}

.nwa-submit svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nwa-privacy-note {
    margin: 12px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    color: var(--nwa-muted);
}

/* --------------------------------------------------------------------- */
/* Spinner                                                                */
/* --------------------------------------------------------------------- */

.nwa-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: nwa-spin .6s linear infinite;
}

@keyframes nwa-spin {
    to { transform: rotate(360deg); }
}

/* Loading state while the popup body is fetched */
.nwa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.nwa-loading .nwa-spinner {
    border-color: rgba(1, 67, 106, .18);
    border-top-color: var(--nwa-brand);
    width: 26px;
    height: 26px;
    border-width: 3px;
}

/* --------------------------------------------------------------------- */
/* Success state inside the dialog                                        */
/* --------------------------------------------------------------------- */

.nwa-result {
    padding: 8px 0 4px;
    text-align: center;
}

.nwa-result__icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 139, 87, .1);
    color: var(--nwa-success);
    animation: nwa-pop .4s cubic-bezier(.16, 1, .3, 1);
}

.nwa-result__icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes nwa-pop {
    0%   { transform: scale(.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.nwa-result__text {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--nwa-ink);
}

.nwa-root .nwa-result__close {
    display: inline-block;
    padding: 11px 26px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    color: var(--nwa-brand);
    background: var(--nwa-accent-tint);
    border: 0;
    border-radius: var(--nwa-radius-sm);
    cursor: pointer;
    transition: background .16s ease;
}

.nwa-root .nwa-result__close:hover {
    background: var(--nwa-accent-soft);
}

/* --------------------------------------------------------------------- */
/* Toast (one-click confirmation)                                         */
/* --------------------------------------------------------------------- */

.nwa-toast-host {
    position: fixed;
    z-index: 2147483001;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.nwa-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 330px;
    max-width: calc(100vw - 40px);
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--nwa-line);
    border-left: 3px solid var(--nwa-success);
    box-shadow: 0 6px 16px rgba(1, 67, 106, .1), 0 18px 44px rgba(1, 67, 106, .16);
    pointer-events: auto;
    transform: translateY(12px);
    opacity: 0;
    transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .28s ease;
}

.nwa-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.nwa-toast.is-leaving {
    transform: translateY(8px);
    opacity: 0;
}

.nwa-toast--error {
    border-left-color: var(--nwa-danger);
}

.nwa-toast--info {
    border-left-color: var(--nwa-accent);
}

.nwa-toast__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 139, 87, .12);
    color: var(--nwa-success);
}

.nwa-toast--error .nwa-toast__icon {
    background: rgba(214, 69, 69, .12);
    color: var(--nwa-danger);
}

.nwa-toast--info .nwa-toast__icon {
    background: rgba(47, 167, 223, .14);
    color: var(--nwa-accent);
}

.nwa-toast__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nwa-toast__body {
    min-width: 0;
    flex: 1 1 auto;
}

.nwa-toast__title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--nwa-ink);
}

.nwa-toast__text {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--nwa-muted);
}

.nwa-toast__close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #A6B3BF;
    cursor: pointer;
    border-radius: 50%;
    transition: background .16s ease, color .16s ease;
}

.nwa-toast__close:hover {
    background: var(--nwa-bg-soft);
    color: var(--nwa-ink);
}

.nwa-toast__close svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* --------------------------------------------------------------------- */
/* Storefront button states                                               */
/* --------------------------------------------------------------------- */

/* The theme's cart button reused as the notify button. Kept intentionally light
   so it inherits the theme's own shape, size and typography. */

/* Journal3 kills interaction on the whole .cart-group of an out-of-stock product
   (pointer-events is inherited, so the button itself has no rule to override).
   That is exactly the case where we need the button to stay clickable. */
.NWA-btn-action {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.NWA-btn-action.nwa-is-busy {
    opacity: .7;
    pointer-events: none !important;
}

.NWA-btn-action.nwa-is-subscribed {
    opacity: .85;
}

/* --------------------------------------------------------------------- */
/* Unsubscribe page                                                       */
/* --------------------------------------------------------------------- */

/* Sits inside the theme's own content column, so it only styles the card and
   lets the surrounding page keep its layout. Everything reads the same custom
   properties as the popup, which is what carries the admin's styling settings
   over to this screen. */

.nwa-page {
    max-width: 560px;
    margin: 0 auto 40px;
}

.nwa-card {
    background: var(--nwa-bg);
    border: 1px solid var(--nwa-line);
    border-radius: var(--nwa-radius);
    box-shadow: var(--nwa-shadow);
    overflow: hidden;
}

.nwa-card__head {
    padding: 22px 26px;
    background: linear-gradient(135deg, var(--nwa-brand), var(--nwa-brand-2));
    color: #fff;
}

.nwa-card__head h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    color: #fff;
}

.nwa-card__body {
    padding: 24px 26px 26px;
}

.nwa-card__text {
    margin: 0 0 18px;
    color: var(--nwa-muted);
}

.nwa-summary {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px;
    margin-bottom: 20px;
    background: var(--nwa-bg-soft);
    border: 1px solid var(--nwa-line);
    border-radius: var(--nwa-radius-sm);
}

.nwa-summary__image img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: var(--nwa-radius-sm);
    background: #fff;
}

.nwa-summary__name {
    font-weight: 600;
    color: var(--nwa-ink);
    text-decoration: none;
}

.nwa-summary__name:hover {
    color: var(--nwa-brand);
}

.nwa-summary__meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--nwa-muted);
}

.nwa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nwa-btn {
    display: inline-block;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--nwa-radius-sm);
    cursor: pointer;
    text-decoration: none;
}

.nwa-btn--danger {
    background: var(--nwa-danger);
    color: #fff;
}

.nwa-btn--danger:hover {
    filter: brightness(.93);
    color: #fff;
}

.nwa-btn--ghost {
    background: transparent;
    border-color: var(--nwa-line-strong);
    color: var(--nwa-ink);
}

.nwa-btn--ghost:hover {
    border-color: var(--nwa-brand);
    color: var(--nwa-brand);
}

.nwa-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--nwa-radius-sm);
    background: var(--nwa-accent-tint);
    border: 1px solid var(--nwa-accent-soft);
    color: var(--nwa-ink);
}

.nwa-note--done {
    background: rgba(46, 139, 87, .08);
    border-color: rgba(46, 139, 87, .28);
}

@media (max-width: 480px) {
    .nwa-summary {
        flex-direction: column;
        text-align: center;
    }

    .nwa-actions .nwa-btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* --------------------------------------------------------------------- */
/* Account page - "My notifications"                                      */
/*                                                                        */
/* Uses the same custom properties as the popup, so whatever the admin    */
/* picks for brand colour and radius applies here without a second set of */
/* settings.                                                              */
/* --------------------------------------------------------------------- */

.nwa-root .nwa-account__heading {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 700;
    color: var(--nwa-ink);
}

.nwa-root .nwa-account {
    border: 1px solid var(--nwa-line);
    border-radius: var(--nwa-radius);
    overflow: hidden;
    background: var(--nwa-bg);
}

.nwa-root .nwa-account__row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--nwa-line);
}

.nwa-root .nwa-account__row:last-child {
    border-bottom: 0;
}

.nwa-root .nwa-account__image {
    flex: 0 0 72px;
    width: 72px;
}

.nwa-root .nwa-account__image img {
    width: 100%;
    height: auto;
    border-radius: var(--nwa-radius-sm);
    border: 1px solid var(--nwa-line);
}

.nwa-root .nwa-account__info {
    flex: 1 1 auto;
    min-width: 0;
}

.nwa-root .nwa-account__name {
    display: block;
    font-weight: 600;
    color: var(--nwa-ink);
    text-decoration: none;
}

.nwa-root a.nwa-account__name:hover {
    color: var(--nwa-brand);
    text-decoration: underline;
}

.nwa-root .nwa-account__name--gone {
    color: var(--nwa-muted);
    font-style: italic;
}

.nwa-root .nwa-account__options,
.nwa-root .nwa-account__meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--nwa-muted);
}

.nwa-root .nwa-account__status {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.nwa-root .nwa-account__price {
    font-weight: 700;
    color: var(--nwa-brand);
}

.nwa-root .nwa-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--nwa-bg-soft);
    border: 1px solid var(--nwa-line);
    color: var(--nwa-muted);
}

.nwa-root .nwa-tag--in {
    color: var(--nwa-success);
    border-color: var(--nwa-success);
}

.nwa-root .nwa-tag--out {
    color: var(--nwa-danger);
    border-color: var(--nwa-danger);
}

.nwa-root .nwa-tag--sent {
    color: var(--nwa-brand);
    border-color: var(--nwa-accent);
    background: var(--nwa-accent-tint);
}

.nwa-root .nwa-account__action form {
    margin: 0;
}

@media (max-width: 640px) {
    .nwa-root .nwa-account__row {
        flex-wrap: wrap;
    }

    .nwa-root .nwa-account__info {
        flex: 1 1 60%;
    }

    .nwa-root .nwa-account__status {
        flex: 1 1 100%;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nwa-root .nwa-account__action {
        flex: 1 1 100%;
    }
}

/* --------------------------------------------------------------------- */
/* Responsive                                                             */
/* --------------------------------------------------------------------- */

@media (max-width: 480px) {
    .nwa-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .nwa-modal {
        max-width: 100%;
        border-radius: var(--nwa-radius) var(--nwa-radius) 0 0;
        transform: translateY(100%);
    }

    .nwa-overlay.is-open .nwa-modal {
        transform: translateY(0);
    }

    .nwa-modal__head {
        padding: 22px 20px 18px;
    }

    .nwa-modal__body {
        padding: 20px;
    }

    .nwa-toast-host {
        right: 10px;
        left: 10px;
        bottom: 10px;
    }

    .nwa-toast {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nwa-overlay,
    .nwa-modal,
    .nwa-toast,
    .nwa-close,
    .nwa-root .nwa-submit {
        transition: none;
    }

    .nwa-spinner {
        animation-duration: 1.4s;
    }

    .nwa-result__icon {
        animation: none;
    }
}
