/* WooCommerce notices everywhere: „… įdėtas į krepšelį“, „Turite nuolaidos kodą?“, errors, account messages.
   One look, first drawn on the checkout: a white rounded card with a thin warm line, Ruda text, the icon on the
   left; errors in Rausva 1 with a red line; the button inside a message is a white outline pill.
   Astra draws them grey with a blue top line. Loaded on every WooCommerce page by inc/woocommerce-notices.php,
   before checkout.css / account.css, which only add page-specific touches (the yellow coupon toggle, the empty cart).
   `body` in front lifts the rules over Astra's single-class ones. */

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
    --mv-notice-ink: #510000;
    --mv-notice-muted: rgba(81, 0, 0, .7);
    --mv-notice-line: rgba(81, 0, 0, .14);
    --mv-notice-line-2: rgba(81, 0, 0, .22);
    --mv-notice-error: #b3261e;
    margin: 0 0 16px;
    padding: 16px 20px 16px 52px;
    border: 1px solid var(--mv-notice-line);
    border-radius: 16px;
    background: #fff;
    color: var(--mv-notice-ink);
    font-size: 15px;
    line-height: 1.5;
}

body :is(.woocommerce-message, .woocommerce-info)::before {
    top: 50%;
    left: 20px;
    color: var(--mv-notice-muted);
    transform: translateY(-50%);
}

body .woocommerce-error {
    border-color: rgba(179, 38, 30, .28);
    background: #ffefe9; /* Rausva 1 */
}

body .woocommerce-error::before {
    left: 20px;
    color: var(--mv-notice-error);
}

body .woocommerce-error li {
    margin: 0;
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:not(.button) {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* WooCommerce focuses new notices for screen readers; no ring for that programmatic focus */
body .woocommerce-notices-wrapper :focus:not(:focus-visible),
body .woocommerce-notices-wrapper [tabindex="-1"]:focus,
body .woocommerce-NoticeGroup [tabindex="-1"]:focus,
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)[tabindex="-1"]:focus {
    outline: 0;
}

/* „Krepšelis“ / „Peržiūrėti krepšelį“ inside a message: a small white outline pill on the right.
   `html body` + `.button.button` beat Astra's `.woocommerce .woocommerce-message a.button` (0,3,1; pink fill). */
html body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button.button {
    float: right;
    margin: -4px 0 -4px 16px;
    padding: 6px 16px;
    border: 1.5px solid var(--mv-notice-line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--mv-notice-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    transition: border-color .15s, background-color .15s, color .15s;
}

html body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button.button:is(:hover, :focus-visible) {
    border-color: var(--mv-notice-ink);
    background: var(--mv-notice-ink);
    color: #f9f6ed;
}

@media (max-width: 544px) {
    /* Astra turns notices into a wrapping flex row here and moves the button below the text */
    html body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button.button {
        float: none;
        display: table;
        margin: 10px 0 0;
    }
}
