@media (min-width: 768px) {

  /* ✅ top:0 left:0 으로 저장된 팝업만 중앙정렬 */
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"],
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10000;
  }

  /* (선택) 화면 밖으로 튀지 않게 */
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"],
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"] {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }

  /* (선택) 내용이 길면 내부 스크롤 */
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"] .hd_pops_con,
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"] .hd_pops_con {
    overflow: auto;
    max-height: calc(100vh - 110px); /* footer 높이 감안 */
  }
}

/* =========================
   팝업 오버레이(블러 배경)
========================= */
#hd_pop_overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9990;

  /* 어두운 반투명 배경 */
  background: rgba(0, 0, 0, 0.35);

  /* 블러 */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* =========================
   팝업 떠 있을 때 스크롤 잠금
========================= */
html.is-popup-open,
body.is-popup-open {
  overflow: hidden !important;
}

/* (선택) iOS/모바일까지 안전하게 하고 싶으면 */
body.is-popup-open {
  touch-action: none;
}

/* =========================
   768px 이상에서 top/left=0인 팝업 중앙정렬
========================= */
@media (min-width: 768px) {
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"],
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10000; /* 오버레이보다 위 */
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }

  /* 내용 길면 내부 스크롤 */
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"] .hd_pops_con,
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"] .hd_pops_con {
    overflow: auto;
    max-height: calc(100vh - 110px); /* footer 고려 */
  }
}

/* =========================
   팝업 라운드(상단만) + 살짝 그림자
========================= */
#hd_pop .hd_pops {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  overflow: hidden; /* 라운드 밖으로 내용 튀는 거 방지 */
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

/* (선택) footer에도 살짝 구분감 */
#hd_pop .hd_pops_footer {
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* 오버레이는 기존 그대로 사용 */
#hd_pop_overlay{
  display:none;
  position:fixed;
  inset:0;
  z-index:9990;
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html.is-popup-open, body.is-popup-open{
  overflow:hidden !important;
}
body.is-popup-open{
  touch-action:none;
}

/* 팝업 라운드(상단만) */
#hd_pop .hd_pops{
  border-top-left-radius:14px;
  border-top-right-radius:14px;
  overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,.25);

  /* 애니메이션은 CSS transition으로 */
  opacity: 1;
  transition: opacity .18s ease, transform .18s ease;
  will-change: transform, opacity;
}

/* 닫히는 상태 */
#hd_pop .hd_pops.is-closing{
  opacity: 0;
}

/* ===== 중앙정렬 대상(768px 이상 + top/left=0) ===== */
@media (min-width: 768px){
  #hd_pop .hd_pops[style*="top:0"][style*="left:0"],
  #hd_pop .hd_pops[style*="top:0px"][style*="left:0px"]{
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;

    /* ✅ 중앙정렬 transform을 CSS가 고정으로 들고 있고 */
    transform: translate(-50%, -50%) translateY(var(--pop-y, 0px)) !important;

    z-index: 10000;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }

  /* 중앙정렬 대상 닫힐 때만 살짝 위로 */
  #hd_pop .hd_pops.is-closing[style*="top:0"][style*="left:0"],
  #hd_pop .hd_pops.is-closing[style*="top:0px"][style*="left:0px"]{
    --pop-y: -12px;
  }
}

/* 중앙정렬 대상이 아닌 일반 팝업도 닫힐 때 살짝 위로 (원하면 유지) */
#hd_pop .hd_pops.is-closing{
  transform: translateY(-12px);
}

/* 내용 길면 내부 스크롤 */
#hd_pop .hd_pops .hd_pops_con{
  overflow:auto;
  max-height: calc(100vh - 110px);
}

.hd_pops_footer button{
  padding: 15px 20px !important;
  font-size: 13px;
}

/* Topbar: 헤더 위에 고정 */
.rb-order-topbar{
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20000;

  background: rgba(255,243,205,.96);
  border-bottom: 1px solid rgba(255,230,156,.9);
  backdrop-filter: blur(6px);
}
.rb-order-topbar__inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rb-order-topbar__msg{ font-size: 14px; line-height: 1.35; }
.rb-order-topbar__msg a{ margin-left: 10px; text-decoration: underline; }

.rb-order-topbar__actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-shrink: 0;
}
.rb-order-topbar__btn{
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.7);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}
.rb-order-topbar__close{
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

/* 우측하단 토스트 */
.rb-order-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20001; /* topbar(20000)보다 위 */
  width: 320px;
  max-width: calc(100vw - 36px);
  background: rgba(20,20,20,.92);
  color: #fff;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 200ms ease, transform 200ms ease;
}

.rb-order-toast.is-open{
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.rb-order-toast__title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.rb-order-toast__body{
  font-size: 13px;
  opacity: .92;
  line-height: 1.35;
}

.rb-order-toast__actions{
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.rb-order-toast__link{
  color: #fff;
  text-decoration: underline;
  font-size: 12px;
}

.rb-order-toast__close{
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}


@media(max-width:768px)
{
.rb-order-toast{
  top: 18px;
  width: 100%;
  height: 100px;
}
.rb-order-topbar{
  display: none;
}
}
.rb-order-toast__title{ font-weight: 700; margin-bottom: 6px; }
.rb-order-toast__body{ opacity: .9; margin-bottom: 10px; line-height: 1.35; }
.rb-order-toast__actions{ display:flex; gap:10px; align-items:center; justify-content:flex-end; }
.rb-order-toast__link{ color:#fff; text-decoration: underline; }
.rb-order-toast__close{ background: transparent; border:0; color:#fff; cursor:pointer; opacity:.85; }
.rb-order-toast__close:hover{ opacity:1; }

.rb-admin-alert-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 14px;
}

.rb-admin-alert-item strong {
    font-weight: 700;
}

.rb-admin-alert-item a {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .rb-order-topbar__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rb-order-topbar__msg {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .rb-admin-alert-item {
        margin-left: 0;
    }
}