/*
 * Avvisi WooCommerce in stile CamoChem (voce 6 audit pagine di sistema, 10 nov 2026).
 * Destinazione sul server: wp-content/themes/astra-child/css/wc-notices.css
 * Handle condiviso: camochem-wc-notices (inc/135 lo carica su my-account da anonimo;
 * il carrello inc/134 puo caricarlo con lo stesso handle, WordPress lo stampa una volta sola).
 * Vale SOLO sotto due classi di body:
 *   body.woocommerce-account:not(.logged-in)  login, lost-password e tutti i suoi stati
 *   body.woocommerce-cart                     /cart/ (14991)
 * Non tocca: checkout-v2 (body woocommerce-checkout, page-id-43009, stili cv2/cv2p/cv2s),
 * schede prodotto (single-product), area account da loggato (.mav3-content in myaccount-v3.css).
 * Rollback: togliere l'enqueue (option camochem_lost_password = off per inc/135).
 */

/* Contenitore: larghezza del contenitore che lo ospita; sul login e sulla pagina
   ?password-reset=true la scheda e larga 440 px, l'avviso si allinea a lei. */
body.woocommerce-account:not(.logged-in) .mav3-login-wrap .woocommerce-notices-wrapper:not(:empty) {
    max-width: 440px;
    margin: 20px auto 20px;
}

/* Avviso base: successo e informazione */
body.woocommerce-account:not(.logged-in) .woocommerce-message,
body.woocommerce-account:not(.logged-in) .woocommerce-info,
body.woocommerce-account:not(.logged-in) .woocommerce-error,
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #3a3a3a;
    background: #F3F8F8;
    border: 1px solid #A3C6C4;
    border-left-width: 4px;
    border-radius: 10px;
    padding: 14px 18px 14px 46px;
    margin: 0 0 16px;
    box-shadow: none;
    list-style: none;
}
body.woocommerce-account:not(.logged-in) .woocommerce-message::before,
body.woocommerce-account:not(.logged-in) .woocommerce-info::before,
body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-cart .woocommerce-info::before {
    color: #354649;
    top: 15px;
    left: 18px;
}

/* Errore: stessa forma, tono rosso spento (nessun rosso acceso, nessun verde) */
body.woocommerce-account:not(.logged-in) .woocommerce-error,
body.woocommerce-cart .woocommerce-error {
    background: #FBF4F4;
    border-color: #E3C3C3;
    border-left-color: #9B2C2C;
    flex-direction: column;
}
body.woocommerce-account:not(.logged-in) .woocommerce-error::before,
body.woocommerce-cart .woocommerce-error::before {
    color: #9B2C2C;
    top: 15px;
    left: 18px;
}
body.woocommerce-account:not(.logged-in) .woocommerce-error li,
body.woocommerce-cart .woocommerce-error li {
    margin: 0;
    padding: 0;
}
body.woocommerce-account:not(.logged-in) .woocommerce-error li + li,
body.woocommerce-cart .woocommerce-error li + li {
    margin-top: 4px;
}

/* Link e bottoni dentro gli avvisi (per esempio "View cart", "Return to shop") */
body.woocommerce-account:not(.logged-in) .woocommerce-message a,
body.woocommerce-account:not(.logged-in) .woocommerce-info a,
body.woocommerce-account:not(.logged-in) .woocommerce-error a,
body.woocommerce-cart .woocommerce-message a,
body.woocommerce-cart .woocommerce-info a,
body.woocommerce-cart .woocommerce-error a {
    color: #222F3F;
    font-weight: 600;
    text-decoration: underline;
}
body.woocommerce-account:not(.logged-in) .woocommerce-message a.button,
body.woocommerce-account:not(.logged-in) .woocommerce-info a.button,
body.woocommerce-cart .woocommerce-message a.button,
body.woocommerce-cart .woocommerce-info a.button {
    background: transparent !important;
    color: #222F3F !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
}

/* Contorno di focus: WooCommerce (woocommerce.js, focus_populate_live_region) mette
   tabindex="-1" sul primo avviso e lo mette a fuoco dopo 500 ms perche il lettore di schermo
   lo annunci. Un elemento con tabindex -1 non si raggiunge con Tab, quindi il contorno non serve
   a chi usa la tastiera: lo togliamo solo li. Il focus resta (annuncio intatto) e i link e i
   bottoni dentro l'avviso tengono il loro anello :focus-visible (inc/37 e Astra). */
body.woocommerce-account:not(.logged-in) .woocommerce-message[tabindex="-1"]:focus,
body.woocommerce-account:not(.logged-in) .woocommerce-info[tabindex="-1"]:focus,
body.woocommerce-account:not(.logged-in) .woocommerce-error[tabindex="-1"]:focus,
body.woocommerce-cart .woocommerce-message[tabindex="-1"]:focus,
body.woocommerce-cart .woocommerce-info[tabindex="-1"]:focus,
body.woocommerce-cart .woocommerce-error[tabindex="-1"]:focus {
    outline: none;
}

@media (max-width: 600px) {
    body.woocommerce-account:not(.logged-in) .mav3-login-wrap .woocommerce-notices-wrapper:not(:empty) {
        max-width: calc(100% - 24px);
        margin: 16px auto;
    }
    body.woocommerce-account:not(.logged-in) .woocommerce-message,
    body.woocommerce-account:not(.logged-in) .woocommerce-info,
    body.woocommerce-account:not(.logged-in) .woocommerce-error,
    body.woocommerce-cart .woocommerce-message,
    body.woocommerce-cart .woocommerce-info,
    body.woocommerce-cart .woocommerce-error {
        font-size: 13px;
        padding: 12px 14px 12px 40px;
    }
    body.woocommerce-account:not(.logged-in) .woocommerce-message::before,
    body.woocommerce-account:not(.logged-in) .woocommerce-info::before,
    body.woocommerce-account:not(.logged-in) .woocommerce-error::before,
    body.woocommerce-cart .woocommerce-message::before,
    body.woocommerce-cart .woocommerce-info::before,
    body.woocommerce-cart .woocommerce-error::before {
        top: 13px;
        left: 14px;
    }
}
