/* Modal overlay: covers entire viewport, semi-transparent background */
#r-custom-search-modal {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0; /* top/right/bottom/left = 0 */
  z-index: 10000;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: flex-end; /* push modal panel to the right */
  align-items: stretch;
  overflow-y: auto;
  transition: opacity 0.3s ease-in-out; /* optional fade effect */
}

/* Modal panel: the sliding content area */
#r-custom-search-modal-content {
  background-color: #fff;
  width: 40%; /* desktop width */
  max-width: 700px;
  height: 100vh; /* full height */
  position: relative;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  transform: translateX(100%); /* start off-screen to the right */
  transition: transform 0.35s ease-out; /* slide animation */
  padding: 30px;
}

/* Slide-in state: move panel into view */
#r-custom-search-modal.show #r-custom-search-modal-content {
  transform: translateX(0);
}

/* Close button inside modal */
#r-custom-search-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  z-index: 9999;
}
#r-custom-search-modal-close:hover {
  color: #000; /* highlight on hover */
}

/* Prevent background from scrolling when modal is open */
body.r-modal-open {
  overflow: hidden;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #r-custom-search-modal-content {
    width: 75%; /* wider panel for smaller screens */
    padding: 20px; /* reduce padding on mobile */
  }
}
