/* =======================================================================
   WP COLORING - POPUP TRIGGER BUTTON STYLES
   ======================================================================= */

/* --- Container (Chống xung đột theme) --- */
.wp-block-gallery .wp-block-image,
.gallery .gallery-item .gallery-icon {
  position: relative !important;
  display: flex !important;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

/* --- Lớp phủ (Overlay) khi hover --- */
.wp-block-gallery .wp-block-image::after,
.gallery .gallery-item .gallery-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* background-color: rgba(30, 41, 59, 0.4); */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
@media (hover: hover) and (min-width: 901px) {
  .wp-block-gallery .wp-block-image:hover::after,
  .gallery .gallery-item .gallery-icon:hover::after {
    opacity: 1;
  }
}

/* --- Nút bấm "Tô màu" --- */
.coloring-popup-trigger {
  position: absolute !important;
  bottom: 62px !important;
  left: 12px !important;
  width: 50px !important;
  height: 50px !important;
  padding: 0 !important;
  z-index: 2;
  background: #fff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  display: grid !important;
  place-items: center !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* --- Logic hiển thị --- */
@media (hover: hover) and (min-width: 901px) { /* Desktop */
  .wp-block-gallery .wp-block-image:hover .coloring-popup-trigger,
  .gallery .gallery-item .gallery-icon:hover .coloring-popup-trigger {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
  .coloring-popup-trigger:hover {
    transform: scale(1.1) !important;
    background: #3b82f6 !important;
    color: #fff !important;
  }
}
@media (max-width: 900px) { /* Mobile */
  .coloring-popup-trigger {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    bottom: 8px !important;
    left: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }
  .wp-block-gallery .wp-block-image::after,
  .gallery .gallery-item .gallery-icon::after {
    display: none !important;
  }
}