/* Eligenda shop messages: confirmations and errors sit in the page, above what they refer to, in the checkout's
   look, instead of the theme's grey box floating over the page. Two routes lead to these rules:
   - .er-msg, the wrapper eligenda-pages.php prints around a message on the pages not restyled yet;
   - body.er-pg #main, the restyled pages, where WooCommerce's scripts also move and create messages.
   The theme's rules for its floating box weigh five classes and use !important. :is() takes the weight of its
   heaviest entry (the one with #main) whichever entry matches, so both routes outweigh them. */
.er-msg { --er-blue: #052531; --er-error: #9b2c2c; --er-tint: #e3eff6; --er-tint-line: #b6d0dc; --er-sans: Raleway, "Helvetica Neue", Arial, sans-serif; }
body.er-pg #main .woocommerce-notices-wrapper:empty { display: none; }

:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  position: relative !important; inset: auto !important; z-index: auto !important; transform: none !important; animation: none !important; opacity: 1 !important; visibility: visible !important; overflow: visible !important;
  display: flex !important; flex-flow: row nowrap !important; align-items: center; justify-content: space-between; gap: 14px; box-sizing: border-box;
  width: auto !important; max-width: none !important; min-height: 0 !important; max-height: none !important; margin: 0 0 16px !important; padding: 14px 54px 14px 18px !important;
  list-style: none; border: 1px solid var(--er-tint-line) !important; border-radius: 10px !important; box-shadow: none !important; outline: 0;
  background: var(--er-tint) !important; color: var(--er-blue) !important; font: 500 14px/1.5 var(--er-sans) !important; letter-spacing: 0; text-align: left; text-transform: none; }
:is(.er-msg > *, body.er-pg #main *).woocommerce-error { border-color: rgba(155, 44, 44, .3) !important; background: #fbf1ef !important; color: var(--er-error) !important; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before, :is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::after { display: none !important; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error).hide-message { display: none !important; }   /* the theme's mark for a closed message */

/* The words. The theme wraps them in a div (or a list, for errors); WooCommerce's own scripts use a bare list. */
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) > :is(div, ul) { display: block !important; flex: 1 1 0 !important; width: auto !important; min-width: 0; margin: 0 !important; padding: 0 !important; list-style: none;
  font: inherit !important; color: inherit !important; text-align: left !important; white-space: normal !important; }   /* the theme keeps the template's line breaks in an error list */
:is(.er-msg > *, body.er-pg #main *):is(ul.woocommerce-error, ul.woocommerce-message, ul.woocommerce-info) { flex-flow: column nowrap !important; align-items: stretch; gap: 4px; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) li { display: block !important; margin: 0 !important; padding: 0 !important; list-style: none; font: inherit; color: inherit; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) li + li { margin-top: 4px !important; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) li::before, :is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) li::after { display: none !important; }

:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(strong, b) { color: inherit !important; font-weight: 700; }

/* Links read as part of the sentence: bold, underlined only under the pointer. */
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a { display: inline !important; float: none !important; margin: 0 !important; padding: 0 !important; min-width: 0 !important; min-height: 0 !important; height: auto !important;
  border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
  color: inherit !important; font: inherit !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; text-decoration: none !important; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:hover { text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 4px; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px !important; }

/* A message with an action ("Visualizza carrello"): WooCommerce writes the action first. It goes after the words,
   at the right while there is room and under them on a narrow screen. (body.er-msg-new: a restyled page, for the
   visitors the "messages" switch applies to.) */
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(div, li):has(> a.button) { display: flex !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 22px; }
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button { order: 2; flex: none; display: inline-flex !important; align-items: center; gap: 7px; white-space: nowrap; }
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button::before { display: none !important; }
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button::after { content: "" !important; position: static !important; display: block !important; flex: none; width: 13px; height: 13px; margin: 0 !important; background: currentColor !important; opacity: 1 !important; transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform 160ms; }
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button:hover::after { transform: translateX(2px); }

/* WooCommerce moves keyboard focus to a message when the page opens, so screen readers announce it. The box is not
   a control: no focus ring around it. */
:is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error):focus, :is(.er-msg > *, body.er-msg-new #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error):focus-visible { outline: 0 !important; }
/* On the cart itself "Visualizza carrello" leads nowhere new. */
body.er-pg-cart.er-msg-new #main .woocommerce-message a.wc-forward { display: none !important; }

/* The close button: top right corner, always clear of the outline. */
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message {
  position: absolute !important; top: 9px !important; right: 10px !important; bottom: auto !important; left: auto !important; transform: none !important;
  display: grid !important; place-items: center; width: 32px !important; height: 32px !important; margin: 0 !important; padding: 0 !important;
  border-radius: 8px; color: inherit !important; opacity: .72; cursor: pointer; transition: opacity 160ms, background-color 160ms; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message:hover, :is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message:focus-visible { opacity: 1; background: rgba(5, 37, 49, .08); }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message::before { position: static !important; display: block !important; width: 15px !important; height: 15px !important; margin: 0 !important; background-color: currentColor !important;
  -webkit-mask-size: contain !important; mask-size: contain !important; -webkit-mask-position: center !important; mask-position: center !important; -webkit-mask-repeat: no-repeat !important; mask-repeat: no-repeat !important; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message::after { display: none !important; }
/* Several confirmations at once (three products added one after the other, then the cart): the theme prints them in ONE box,
   each text followed by its own close mark. The texts go one under the other; before 0.8.4 they stood side by side, three
   narrow columns on a phone. One close mark is enough: each of them closes the whole box. */
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error):has(> .woocommerce-message-text ~ .woocommerce-message-text) { flex-flow: column nowrap !important; align-items: stretch; gap: 10px; }
:is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) > .close-message ~ .close-message { display: none !important; }

@media (prefers-reduced-motion: reduce) { :is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .close-message, :is(.er-msg > *, body.er-pg #main *):is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button::after { transition: none !important; } }
