/* MG-WA-01 v1.0.0 — WhatsApp visibility. Scope: actual WhatsApp destinations only.
 * No WooCommerce, Rank Math, taxonomy, URL, or click-action changes.
 * #25D366 = WhatsApp signature green; dark text #063D22 increases contrast on green.
 */
:root {
  --mg-whatsapp-green: #25D366;
  --mg-whatsapp-green-deep: #087A3A;
  --mg-whatsapp-ink: #063D22;
}

/* Actual chat links only; preserve their layout and destinations. */
a:is([href*="wa.me/"], [href*="api.whatsapp.com/send"], [href^="whatsapp:"]) {
  color: var(--mg-whatsapp-green-deep);
  text-decoration-thickness: 1.5px;
}

/* Add the recognizable WhatsApp mark only when no icon is already present.
   CSS decorative icon; visible link text remains the accessible name. */
a:is([href*="wa.me/"], [href*="api.whatsapp.com/send"], [href^="whatsapp:"]):not(:has(svg, img, i.fa-whatsapp, i.fab, .whatsapp-icon))::before {
  content: "";
  display: inline-block;
  width: 1.17em;
  height: 1.17em;
  margin-inline-end: .46em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  background-color: var(--mg-whatsapp-green);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M17.472%2014.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.967-.94%201.164-.173.198-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.76-1.653-2.058-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.148-.173.198-.297.297-.495.099-.198.05-.372-.025-.52-.075-.148-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.372-.01-.57-.01-.198%200-.52.074-.793.372s-1.04%201.016-1.04%202.479%201.065%202.875%201.213%203.073c.149.198%202.095%203.2%205.076%204.487.709.306%201.262.489%201.693.626.712.227%201.36.195%201.872.118.571-.085%201.758-.719%202.006-1.413.248-.694.248-1.29.173-1.413-.074-.124-.272-.198-.57-.347m-5.421%207.44h-.003a9.85%209.85%200%200%201-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.85%209.85%200%200%201-1.51-5.26c.002-5.443%204.43-9.871%209.876-9.871a9.81%209.81%200%200%201%206.978%202.891%209.81%209.81%200%200%201%202.89%206.98c-.003%205.443-4.431%209.871-9.861%209.871M20.52%203.449A11.91%2011.91%200%200%200%2012.048%200C5.49%200%20.15%205.338.148%2011.9c0%202.098.547%204.145%201.588%205.948L.05%2024l6.3-1.654a11.93%2011.93%200%200%200%205.693%201.45h.005c6.557%200%2011.9-5.338%2011.902-11.901a11.87%2011.87%200%200%200-3.43-8.446Z%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M17.472%2014.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.967-.94%201.164-.173.198-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.76-1.653-2.058-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.148-.173.198-.297.297-.495.099-.198.05-.372-.025-.52-.075-.148-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.372-.01-.57-.01-.198%200-.52.074-.793.372s-1.04%201.016-1.04%202.479%201.065%202.875%201.213%203.073c.149.198%202.095%203.2%205.076%204.487.709.306%201.262.489%201.693.626.712.227%201.36.195%201.872.118.571-.085%201.758-.719%202.006-1.413.248-.694.248-1.29.173-1.413-.074-.124-.272-.198-.57-.347m-5.421%207.44h-.003a9.85%209.85%200%200%201-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.85%209.85%200%200%201-1.51-5.26c.002-5.443%204.43-9.871%209.876-9.871a9.81%209.81%200%200%201%206.978%202.891%209.81%209.81%200%200%201%202.89%206.98c-.003%205.443-4.431%209.871-9.861%209.871M20.52%203.449A11.91%2011.91%200%200%200%2012.048%200C5.49%200%20.15%205.338.148%2011.9c0%202.098.547%204.145%201.588%205.948L.05%2024l6.3-1.654a11.93%2011.93%200%200%200%205.693%201.45h.005c6.557%200%2011.9-5.338%2011.902-11.901a11.87%2011.87%200%200%200-3.43-8.446Z%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
}

/* Marcnet: category and single-product WhatsApp CTAs; other CTAs unaffected. */
body.mg-single-product-v1 a.mg-product-v2__support-link[href*="wa.me/"],
body.mg-single-product-v1 .mg-product-v2__card-actions a[href*="wa.me/"],
body.mg-product-category-v1 .mg-category-v2__support-actions > a[href*="wa.me/"] {
  background-color: var(--mg-whatsapp-green) !important;
  border-color: #1A944C !important;
  color: var(--mg-whatsapp-ink) !important;
  font-weight: 750;
}

/* On a branded green CTA, keep the symbol dark enough to distinguish clearly. */
body.mg-single-product-v1 a.mg-product-v2__support-link[href*="wa.me/"]::before,
body.mg-single-product-v1 .mg-product-v2__card-actions a[href*="wa.me/"]::before,
body.mg-product-category-v1 .mg-category-v2__support-actions > a[href*="wa.me/"]::before {
  background-color: var(--mg-whatsapp-ink);
}

/* Clearly visible hover and keyboard focus, desktop + mobile. */
a:is([href*="wa.me/"], [href*="api.whatsapp.com/send"], [href^="whatsapp:"]):focus-visible {
  outline: 3px solid #075E54 !important;
  outline-offset: 3px;
}
body.mg-single-product-v1 a.mg-product-v2__support-link[href*="wa.me/"]:hover,
body.mg-single-product-v1 .mg-product-v2__card-actions a[href*="wa.me/"]:hover,
body.mg-product-category-v1 .mg-category-v2__support-actions > a[href*="wa.me/"]:hover {
  background-color: #1FBD58 !important;
  color: #042F1B !important;
}
