/* mr-drawer.css —— MARY RUTH'S 购物车抽屉（唯一实现）
   规格与其它站一致：宽 380px、右滑入 transform .18s、遮罩 opacity .16s、≤749px 全宽。 */

/* ---------- 页头角标 ---------- */
/* 主题自带的 Shopify 抽屉壳（cart-drawer / #CartDrawer）：本站只用 #mr-cart-drawer，
   彻底隐藏，避免双抽屉与遮罩吃点击 */
cart-drawer,#CartDrawer,.cart-drawer{display:none !important}
#cart-icon-bubble{position:relative}
.mr-cart-count{
  display:inline-block;
  position:absolute;
  top:-6px;
  right:-8px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:10px;
  background:#dd1d1d;
  color:#fff;
  font-size:11px;
  font-weight:700;
  line-height:20px;
  text-align:center;
  letter-spacing:0;
  z-index:2;
  pointer-events:none;
  box-shadow:0 0 0 2px #fff;
}
.mr-cart-count.is-empty{display:none !important;min-width:0;height:0;padding:0;overflow:hidden}

/* ---------- 抽屉外壳 ---------- */
.mr-drawer{
  position:fixed;
  inset:0;
  z-index:100000;
  visibility:hidden;
  pointer-events:none;
  max-width:100vw;
}
.mr-drawer.is-open{visibility:visible;pointer-events:auto}
.mr-drawer__overlay{
  display:block !important; /* 主题有 div:empty{display:none}，空遮罩会被吞掉 */
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  background:rgba(0,0,0,.5);
  opacity:0;
  cursor:pointer;
  transition:opacity .16s ease;
}
.mr-drawer.is-open .mr-drawer__overlay{opacity:1}
.mr-drawer__panel{
  position:absolute;
  top:0;
  right:0;
  height:100%;
  width:380px;
  max-width:100vw;
  display:flex;
  flex-direction:column;
  background:#fff;
  color:#121212;
  box-shadow:-8px 0 32px rgba(0,0,0,.18);
  transform:translateX(100%);
  transition:transform .18s cubic-bezier(.2,.8,.2,1);
  will-change:transform;
}
.mr-drawer.is-open .mr-drawer__panel{transform:translateX(0)}

/* ---------- 头部 ---------- */
.mr-drawer__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 18px 14px;
  border-bottom:1px solid #eee;
}
.mr-drawer__heading{margin:0;font-size:17px;font-weight:700;letter-spacing:.01em}
.mr-drawer__heading-count{font-weight:600;color:#555}
.mr-drawer__close{
  border:0;
  background:none;
  padding:6px;
  cursor:pointer;
  line-height:0;
  color:#121212;
}
.mr-drawer__close-icon{width:16px;height:16px}

/* ---------- 主体 ---------- */
.mr-drawer__body{
  flex:1 1 auto;
  overflow-y:auto;
  padding:14px 18px;
  -webkit-overflow-scrolling:touch;
}
.mr-drawer__status{margin:8px 0 12px;font-size:13px;color:#777}
.mr-drawer__empty{text-align:center;padding:26px 0;color:#555}
.mr-drawer__empty-text{font-size:15px;margin:0 0 14px}
.mr-drawer__empty-cta{
  display:inline-block;
  min-height:46px;
  line-height:46px;
  padding:0 22px;
  border-radius:12px;
  background:#121212;
  color:#fff;
  font-weight:700;
  text-decoration:none;
}
.mr-drawer__empty-cta:hover{background:#000;color:#fff}
.mr-drawer__items{list-style:none;margin:0;padding:0}

/* ---------- 行 ---------- */
.mr-drawer__item{
  display:grid;
  grid-template-columns:76px minmax(0,1fr);
  gap:12px;
  padding:14px 0;
  border-bottom:1px solid #f0f0f0;
}
.mr-drawer__item.is-busy{opacity:.55}
.mr-drawer__thumb{display:block;width:76px}
.mr-drawer__thumb img{width:76px;height:76px;object-fit:cover;display:block;border-radius:8px;background:#f6f6f6}
.mr-drawer__info{min-width:0}
.mr-drawer__name{
  display:block;
  font-size:14px;
  font-weight:600;
  line-height:1.35;
  color:#121212;
  text-decoration:none;
}
.mr-drawer__name:hover{text-decoration:underline}
.mr-drawer__variant{font-size:12px;color:#666;margin-top:2px}
.mr-drawer__unit{font-size:12px;color:#666;margin-top:4px}
.mr-drawer__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}
.mr-drawer__qty{display:inline-flex;align-items:center;border:1px solid #dcdcdc;border-radius:8px;overflow:hidden}
.mr-drawer__qty button{
  width:34px;
  height:34px;
  border:0;
  background:#fff;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  color:#121212;
}
.mr-drawer__qty button:hover{background:#f5f5f5}
.mr-drawer__qty input{
  width:38px;
  height:34px;
  border:0;
  border-left:1px solid #eee;
  border-right:1px solid #eee;
  text-align:center;
  font-size:14px;
  color:#121212;
  background:#fff;
  -moz-appearance:textfield;
}
.mr-drawer__qty input::-webkit-outer-spin-button,
.mr-drawer__qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.mr-drawer__line{font-size:14px;font-weight:700;white-space:nowrap}
.mr-drawer__remove{
  margin-top:8px;
  border:0;
  background:none;
  padding:0;
  font-size:12px;
  color:#8a8a8a;
  text-decoration:underline;
  cursor:pointer;
}
.mr-drawer__remove:hover{color:#b3261e}

/* ---------- 底部 ---------- */
.mr-drawer__foot{
  flex:0 0 auto;
  padding:14px 18px 18px;
  border-top:1px solid #eee;
  background:#fff;
}
.mr-drawer__subtotal{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:15px;
  margin-bottom:12px;
}
.mr-drawer__checkout{
  display:block;
  width:100%;
  text-align:center;
  min-height:48px;
  line-height:48px;
  border-radius:12px;
  background:#121212;
  color:#fff !important;
  font-weight:700;
  text-decoration:none;
  letter-spacing:.02em;
  box-sizing:border-box;
}
.mr-drawer__checkout:hover{background:#000;color:#fff !important}
/* 滚动锁定：主题用 html body{overflow:clip visible !important} 压着，这里提高特异性 + !important 覆盖 */
html.mr-drawer-open,
html.mr-drawer-open body{overflow:hidden !important}

/* ---------- 移动端：全宽 ---------- */
@media screen and (max-width:749px){
  .mr-cart-count{right:0;top:-4px}
  .mr-drawer__panel{width:100%}
  .mr-drawer__items .mr-drawer__item{grid-template-columns:64px minmax(0,1fr)}
  .mr-drawer__thumb,.mr-drawer__thumb img{width:64px}
  .mr-drawer__thumb img{height:64px}
}
