/*
 * ss-notices.css — LK Dryfruits site-wide WooCommerce notice skin
 * ══════════════════════════════════════════════════════════════
 * Skins ALL WooCommerce notices — success, info, error — plus "Customer
 * matched zone" style shipping/plugin banners. Turns them into
 * brand-consistent, minimal pill-cards that slide in from the top with
 * a soft spring and dismiss automatically.
 *
 * Loaded site-wide (see functions.php).
 * ══════════════════════════════════════════════════════════════
 */

/* Wrapper: floats at the top, safe stacking, no layout jump */
.woocommerce-notices-wrapper,
.woocommerce-notices-wrapper:not(:empty) {
    position: fixed;
    top: 88px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(560px, calc(100vw - 32px));
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}
.woocommerce-notices-wrapper:empty { display: none !important; }

/* Base notice card */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .wc-block-components-notice-banner,
.woocommerce-store-notice,
.demo_store {
    position: relative;
    pointer-events: auto;
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 44px !important;
    margin: 0 !important;
    background: var(--ss-ink) !important;
    color: var(--ss-cream) !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 44px color-mix(in srgb, var(--ss-ink) 28%, transparent) !important;
    font: 500 14px/1.4 var(--ss-font-sans) !important;
    letter-spacing: .01em;
    list-style: none !important;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-16px);
    animation: ss-notice-in .48s cubic-bezier(.34,1.4,.6,1) forwards,
               ss-notice-out .35s ease 4.4s forwards;
    will-change: transform, opacity;
}

/* Remove the legacy left border / bg injected by the WC plugin */
.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce-notices-wrapper .woocommerce-error::before {
    content: '' !important;
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: var(--ss-ink) !important;
    color: var(--ss-ink) !important;
    font-family: inherit !important;
    display: block !important;
    /* SVG check mark */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a3a26' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='14 4 6 12 2 8'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--ss-ink) 15%, transparent);
}

/* Info variant → softer amber dot with i icon */
.woocommerce-notices-wrapper .woocommerce-info::before {
    background: var(--ss-brand) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a3a26' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><line x1='8' y1='7' x2='8' y2='12'/><circle cx='8' cy='4.5' r='.5' fill='%231a3a26'/></svg>") !important;
    background-repeat: no-repeat;
    background-position: center;
}

/* Error variant → red background */
.woocommerce-notices-wrapper .woocommerce-error {
    background: var(--ss-brand) !important;
}
.woocommerce-notices-wrapper .woocommerce-error::before {
    background: var(--ss-white) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23b23a3a' stroke-width='2.4' stroke-linecap='round'><line x1='4' y1='4' x2='12' y2='12'/><line x1='12' y1='4' x2='4' y2='12'/></svg>") !important;
    background-repeat: no-repeat;
    background-position: center;
}

/* Multi-item notice (li list ke liye) */
.woocommerce-notices-wrapper .woocommerce-message li,
.woocommerce-notices-wrapper .woocommerce-info li,
.woocommerce-notices-wrapper .woocommerce-error li {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* "View cart" and other action buttons inside the notice */
.woocommerce-notices-wrapper .button,
.woocommerce-notices-wrapper .wc-forward,
.woocommerce-notices-wrapper a.button {
    margin-left: auto !important;
    padding: 6px 14px !important;
    background: transparent !important;
    color: var(--ss-brand) !important;
    border: none !important;
    border-radius: 999px !important;
    font: 500 14px/1 var(--ss-font-sans) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    box-shadow: none !important;
    transition: color .15s ease, transform .15s ease;
    flex-shrink: 0;
    order: 2;
}
.woocommerce-notices-wrapper .button:hover,
.woocommerce-notices-wrapper a.button:hover,
.woocommerce-notices-wrapper .wc-forward:hover {
    color: var(--ss-white) !important;
    transform: translateX(2px);
}

/* wc-blocks banner (new notices API) */
.woocommerce-notices-wrapper .wc-block-components-notice-banner {
    padding: 12px 16px 12px 44px !important;
}
.woocommerce-notices-wrapper .wc-block-components-notice-banner > svg { display: none !important; }
.woocommerce-notices-wrapper .wc-block-components-notice-banner__content {
    color: inherit !important;
    font: inherit !important;
}
.woocommerce-notices-wrapper .wc-block-components-notice-banner.is-error { background: var(--ss-brand) !important; }
.woocommerce-notices-wrapper .wc-block-components-notice-banner.is-info  { background: var(--ss-ink) !important; }

/* Storefront store-notice (top bar) — also styled as a softer pill */
.woocommerce-store-notice,
.demo_store {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    width: min(560px, calc(100vw - 32px));
    z-index: 10000;
}

/* Mobile — bring closer to the top and reduce padding */
@media (max-width: 640px) {
    .woocommerce-notices-wrapper,
    .woocommerce-notices-wrapper:not(:empty) {
        top: 68px;
        width: calc(100vw - 16px);
    }
    .woocommerce-notices-wrapper .woocommerce-message,
    .woocommerce-notices-wrapper .woocommerce-info,
    .woocommerce-notices-wrapper .woocommerce-error,
    .woocommerce-notices-wrapper .wc-block-components-notice-banner {
        padding: 11px 14px 11px 40px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
    }
    .woocommerce-notices-wrapper .woocommerce-message::before,
    .woocommerce-notices-wrapper .woocommerce-info::before,
    .woocommerce-notices-wrapper .woocommerce-error::before {
        left: 11px !important;
        width: 20px !important;
        height: 20px !important;
        background-size: 12px 12px !important;
    }
}

/* Reduced motion — skip the springy in/out effect */
@media (prefers-reduced-motion: reduce) {
    .woocommerce-notices-wrapper .woocommerce-message,
    .woocommerce-notices-wrapper .woocommerce-info,
    .woocommerce-notices-wrapper .woocommerce-error,
    .woocommerce-notices-wrapper .wc-block-components-notice-banner {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

@keyframes ss-notice-in {
    0%   { opacity: 0; transform: translateY(-18px) scale(.98); }
    60%  { opacity: 1; transform: translateY(2px) scale(1.005); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ss-notice-out {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-14px) scale(.98); visibility: hidden; }
}
