/**
 * Shared popup close button — matches R&D entry popup (#popmake-49017).
 * Gray #58595b square + dark SVG X; orange + white X on hover + transition.
 */

:root {
  --mt-popup-close-bg: #58595b;
  --mt-popup-close-icon: #231f20;
  --mt-popup-close-hover: #ff641f;
  --mt-popup-close-hover-icon: #ffffff;
  --mt-popup-close-size: 36px;
  --mt-popup-close-icon-size: 16px;
  --mt-popup-close-transition: background-color 0.2s ease, color 0.2s ease;
  --mt-popup-close-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 5l14 14M19 5L5 19' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------- */
/* Theme modals — inline SVG (currentColor)                                   */
/* -------------------------------------------------------------------------- */

body .block--vehicle-popup .grid--vehicle > button[data-close],
body .block--submit-pic .picture--form > button[data-close],
body .block--dealer-location .grid--dealer > button[data-close],
body .block--dealer-reminder .grid--dealer > button[data-close],
body #photo-sample-lightbox .photo-sample-lightbox__close,
body #image-popup #close-popup,
body #image-popup.photo-sample-image-popup #close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: var(--mt-popup-close-size);
  height: var(--mt-popup-close-size);
  min-width: var(--mt-popup-close-size);
  min-height: var(--mt-popup-close-size);
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--mt-popup-close-bg) !important;
  background-color: var(--mt-popup-close-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--mt-popup-close-icon) !important;
  font-size: 0 !important;
  font-weight: 400;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  text-shadow: none !important;
  text-transform: none !important;
  opacity: 1 !important;
  overflow: hidden;
  cursor: pointer;
  transition: var(--mt-popup-close-transition);
}

body .block--vehicle-popup .grid--vehicle > button[data-close] svg,
body .block--submit-pic .picture--form > button[data-close] svg,
body .block--dealer-location .grid--dealer > button[data-close] svg,
body .block--dealer-reminder .grid--dealer > button[data-close] svg,
body #photo-sample-lightbox .photo-sample-lightbox__close svg,
body #image-popup #close-popup svg,
body #image-popup.photo-sample-image-popup #close-popup svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
  transition: none;
}

body .block--vehicle-popup .grid--vehicle > button[data-close]::before,
body .block--vehicle-popup .grid--vehicle > button[data-close]::after,
body .block--submit-pic .picture--form > button[data-close]::before,
body .block--submit-pic .picture--form > button[data-close]::after,
body .block--dealer-location .grid--dealer > button[data-close]::before,
body .block--dealer-location .grid--dealer > button[data-close]::after,
body .block--dealer-reminder .grid--dealer > button[data-close]::before,
body .block--dealer-reminder .grid--dealer > button[data-close]::after,
body #photo-sample-lightbox .photo-sample-lightbox__close::before,
body #photo-sample-lightbox .photo-sample-lightbox__close::after,
body #image-popup #close-popup::before,
body #image-popup #close-popup::after,
body #image-popup.photo-sample-image-popup #close-popup::before,
body #image-popup.photo-sample-image-popup #close-popup::after {
  content: none !important;
  display: none !important;
  background: none !important;
  mask: none !important;
  -webkit-mask: none !important;
}

body .block--vehicle-popup .grid--vehicle > button[data-close]:hover,
body .block--vehicle-popup .grid--vehicle > button[data-close]:focus,
body .block--vehicle-popup .grid--vehicle > button[data-close]:focus-visible,
body .block--submit-pic .picture--form > button[data-close]:hover,
body .block--submit-pic .picture--form > button[data-close]:focus,
body .block--submit-pic .picture--form > button[data-close]:focus-visible,
body .block--dealer-location .grid--dealer > button[data-close]:hover,
body .block--dealer-location .grid--dealer > button[data-close]:focus,
body .block--dealer-location .grid--dealer > button[data-close]:focus-visible,
body .block--dealer-reminder .grid--dealer > button[data-close]:hover,
body .block--dealer-reminder .grid--dealer > button[data-close]:focus,
body .block--dealer-reminder .grid--dealer > button[data-close]:focus-visible,
body #photo-sample-lightbox .photo-sample-lightbox__close:hover,
body #photo-sample-lightbox .photo-sample-lightbox__close:focus,
body #photo-sample-lightbox .photo-sample-lightbox__close:focus-visible,
body #image-popup #close-popup:hover,
body #image-popup #close-popup:focus,
body #image-popup #close-popup:focus-visible,
body #image-popup.photo-sample-image-popup #close-popup:hover,
body #image-popup.photo-sample-image-popup #close-popup:focus,
body #image-popup.photo-sample-image-popup #close-popup:focus-visible {
  background: var(--mt-popup-close-hover) !important;
  background-color: var(--mt-popup-close-hover) !important;
  background-image: none !important;
  color: var(--mt-popup-close-hover-icon) !important;
  outline: 0;
  opacity: 1 !important;
}

/* -------------------------------------------------------------------------- */
/* Popup Maker + Magnific Popup — mask SVG so bg + X both transition          */
/* -------------------------------------------------------------------------- */

body .pum-close,
body .pum-content + .pum-close,
body .mfp-close,
button.mfp-close {
  position: absolute !important;
  z-index: 20 !important;
  display: block !important;
  width: var(--mt-popup-close-size) !important;
  height: var(--mt-popup-close-size) !important;
  min-width: var(--mt-popup-close-size) !important;
  min-height: var(--mt-popup-close-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--mt-popup-close-bg) !important;
  background-color: var(--mt-popup-close-bg) !important;
  background-image: none !important;
  color: transparent !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  text-indent: -9999px !important;
  text-shadow: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: var(--mt-popup-close-transition) !important;
}

/* Default PUM / MFP placement when theme doesn't set coords */
body .pum-close,
body .pum-content + .pum-close {
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
}

body .mfp-close,
button.mfp-close {
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
}

/* Hide plugin text / default glyphs */
body .pum-close::before,
body .pum-content + .pum-close::before,
body .mfp-close::before,
button.mfp-close::before {
  content: none !important;
  display: none !important;
}

/* SVG X via mask — color transitions with background-color */
body .pum-close::after,
body .pum-content + .pum-close::after,
body .mfp-close::after,
button.mfp-close::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: var(--mt-popup-close-icon-size) !important;
  height: var(--mt-popup-close-icon-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: translate(-50%, -50%) !important;
  background-color: var(--mt-popup-close-icon) !important;
  background-image: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  -webkit-mask-image: var(--mt-popup-close-x) !important;
  mask-image: var(--mt-popup-close-x) !important;
  -webkit-mask-position: center center !important;
  mask-position: center center !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  transition: background-color 0.2s ease !important;
  pointer-events: none !important;
  text-indent: 0 !important;
}

body .pum-close:hover,
body .pum-close:focus,
body .pum-close:focus-visible,
body .pum-content + .pum-close:hover,
body .pum-content + .pum-close:focus,
body .pum-content + .pum-close:focus-visible,
body .mfp-close:hover,
body .mfp-close:focus,
body .mfp-close:focus-visible,
button.mfp-close:hover,
button.mfp-close:focus,
button.mfp-close:focus-visible {
  background: var(--mt-popup-close-hover) !important;
  background-color: var(--mt-popup-close-hover) !important;
  background-image: none !important;
  color: transparent !important;
  opacity: 1 !important;
  outline: 0 !important;
}

body .pum-close:hover::after,
body .pum-close:focus::after,
body .pum-close:focus-visible::after,
body .pum-content + .pum-close:hover::after,
body .pum-content + .pum-close:focus::after,
body .pum-content + .pum-close:focus-visible::after,
body .mfp-close:hover::after,
body .mfp-close:focus::after,
body .mfp-close:focus-visible::after,
button.mfp-close:hover::after,
button.mfp-close:focus::after,
button.mfp-close:focus-visible::after {
  background-color: var(--mt-popup-close-hover-icon) !important;
}

/* R&D entry popup — keep designer placement, same chrome */
body #popmake-49017 .pum-close,
body #popmake-49017 .pum-content + .pum-close {
  top: 25px !important;
  right: 40px !important;
}

@media (max-width: 767px) {
  body .block--vehicle-popup .grid--vehicle > button[data-close],
  body .block--submit-pic .picture--form > button[data-close],
  body .block--dealer-location .grid--dealer > button[data-close],
  body .block--dealer-reminder .grid--dealer > button[data-close],
  body #photo-sample-lightbox .photo-sample-lightbox__close,
  body #image-popup #close-popup,
  body #image-popup.photo-sample-image-popup #close-popup,
  body .pum-close,
  body .pum-content + .pum-close,
  body .mfp-close,
  button.mfp-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }

  body .block--vehicle-popup .grid--vehicle > button[data-close] svg,
  body .block--submit-pic .picture--form > button[data-close] svg,
  body .block--dealer-location .grid--dealer > button[data-close] svg,
  body .block--dealer-reminder .grid--dealer > button[data-close] svg,
  body #photo-sample-lightbox .photo-sample-lightbox__close svg,
  body #image-popup #close-popup svg,
  body #image-popup.photo-sample-image-popup #close-popup svg {
    width: 16px;
    height: 16px;
  }

  body .pum-close::after,
  body .pum-content + .pum-close::after,
  body .mfp-close::after,
  button.mfp-close::after {
    width: 14px !important;
    height: 14px !important;
  }

  body #popmake-49017 .pum-close,
  body #popmake-49017 .pum-content + .pum-close {
    top: 12px !important;
    right: 12px !important;
  }
}
