/* ==========================================================================
   장바구니 부품 키트 — cart.css
   실행DAY 2026-08-29 · https://runday.irumai.kr/260829/kit/cart/

   ● 브랜드에 맞추려면 아래 변수 6개만 바꾸면 됩니다.
     클래스 이름은 전부 rdcart- 로 시작해서 내 사이트 CSS 와 겹치지 않습니다.
   ========================================================================== */
:root {
  --cart-bg:     #FFFFFF;   /* NEXGEN 화이트 */
  --cart-ink:    #2E2E2E;   /* NEXGEN 차콜 */
  --cart-line:   rgba(46, 46, 46, .18);
  --cart-accent: #2F6FED;   /* NEXGEN 코발트 */
  --cart-radius: 0;
  --cart-font:   "Noto Sans KR", Arial, sans-serif;
}

/* ───────── 열렸을 때 배경 스크롤 잠금 ───────── */
html.rdcart-locked, body.rdcart-locked { overflow: hidden; }

/* ───────── 장바구니 버튼 ───────── */
.rdcart-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 999px;
  background: var(--cart-ink); color: var(--cart-bg);
  font: inherit; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.rdcart-btn--float {
  position: fixed; top: 94px; right: 20px; z-index: 90;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.rdcart-btn:active { transform: translateY(0); }
@media (hover: hover) { .rdcart-btn:hover { transform: translateY(-1px); } }
.rdcart-btn:focus-visible { outline: 2px solid var(--cart-accent); outline-offset: 3px; }
.rdcart-btn svg { display: block; }

.rdcart-btn__count {
  position: absolute; top: -3px; right: -3px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--cart-accent); color: #fff;
  font-family: var(--cart-font);
  font-size: 11px; font-weight: 800; line-height: 1;
  transform: scale(0); transition: transform .25s cubic-bezier(.2, .8, .3, 1);
}
.rdcart-btn--has .rdcart-btn__count { transform: scale(1); }

/* 담기 버튼의 "담았습니다" 순간 (참가자 버튼 스타일은 건드리지 않습니다) */
.rdcart-added { opacity: .68; }

/* ───────── 서랍 ───────── */
.rdcart {
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
  font-family: var(--cart-font);
  color: var(--cart-ink);
  -webkit-text-size-adjust: 100%;
}
.rdcart--open { pointer-events: auto; }

.rdcart__back {
  position: absolute; inset: 0;
  background: rgba(20, 18, 16, .48);
  opacity: 0; transition: opacity .32s ease;
}
.rdcart--open .rdcart__back { opacity: 1; }

.rdcart__panel {
  position: absolute; top: 0; right: 0;
  height: 100%; width: min(400px, 92vw);
  display: flex; flex-direction: column;
  background: var(--cart-bg);
  box-shadow: -18px 0 54px rgba(20, 18, 16, .2);
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.2, .8, .3, 1);
}
.rdcart--open .rdcart__panel { transform: none; }

.rdcart__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 20px 22px;
  border-bottom: 1px solid var(--cart-line);
}
.rdcart__title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.rdcart__close {
  width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 999px; background: none;
  color: var(--cart-ink); font: inherit; font-size: 22px; line-height: 1;
  cursor: pointer; opacity: .6;
}
@media (hover: hover) { .rdcart__close:hover { background: var(--cart-line); opacity: 1; } }
.rdcart__close:focus-visible { outline: 2px solid var(--cart-accent); outline-offset: 2px; }

.rdcart__body { flex: 1; overflow-y: auto; padding: 6px 22px; -webkit-overflow-scrolling: touch; }
.rdcart__empty { padding: 34px 0; margin: 0; font-size: 14px; line-height: 1.85; opacity: .6; }

/* ───────── 줄 ───────── */
.rdcart__line {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 0; border-bottom: 1px solid var(--cart-line);
}
.rdcart__grow { flex: 1; min-width: 0; }
.rdcart__grow b {
  display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.rdcart__grow small { display: block; margin-top: 3px; font-size: 12.5px; opacity: .6; }

.rdcart__go {
  display: inline-block; margin-top: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--cart-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--cart-ink); padding-bottom: 1px;
}
@media (hover: hover) { .rdcart__go:hover { opacity: .6; } }
.rdcart__go--off {
  font-weight: 400; opacity: .45;
  border-bottom-style: dotted; cursor: default;
}

.rdcart__qty {
  display: inline-flex; align-items: center; flex: none;
  border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--cart-line);
}
.rdcart__qty button {
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 999px; background: none;
  color: var(--cart-ink); font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer;
}
@media (hover: hover) { .rdcart__qty button:hover { background: var(--cart-line); } }
.rdcart__qty button:focus-visible { outline: 2px solid var(--cart-accent); outline-offset: 1px; }
.rdcart__qty > span { min-width: 26px; text-align: center; font-size: 14px; font-weight: 700; }

.rdcart__kill {
  flex: none; border: 0; background: none; padding: 4px 2px;
  color: var(--cart-ink); font: inherit; font-size: 12px; opacity: .55;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
@media (hover: hover) { .rdcart__kill:hover { opacity: 1; color: var(--cart-accent); } }

/* ───────── 아래 (합계·안내·버튼) ───────── */
.rdcart__foot {
  padding: 18px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--cart-line);
  background: var(--cart-bg);
}
.rdcart__sum { display: flex; align-items: baseline; justify-content: space-between; }
.rdcart__sum span { font-size: 13px; opacity: .6; }
.rdcart__sum b { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.rdcart__lead { margin: 12px 0 14px; font-size: 12.5px; line-height: 1.7; opacity: .62; }

.rdcart__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rdcart__act {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 12px;
  border: 1.5px solid var(--cart-ink); border-radius: var(--cart-radius);
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer;
  transition: opacity .2s ease;
}
@media (hover: hover) { .rdcart__act:hover { opacity: .78; } }
.rdcart__act:focus-visible { outline: 2px solid var(--cart-accent); outline-offset: 2px; }
.rdcart__act--solid { background: var(--cart-ink); color: var(--cart-bg); }
.rdcart__act--ghost { background: none; color: var(--cart-ink); }
.rdcart__act[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.rdcart--empty .rdcart__act { opacity: .35; pointer-events: none; }
.rdcart--empty .rdcart__sum { opacity: .45; }

/* ───────── 모바일 (375px 에서 전체 폭) ───────── */
@media (max-width: 480px) {
  .rdcart__panel { width: 100%; box-shadow: none; }
  .rdcart__head, .rdcart__body, .rdcart__foot { padding-left: 18px; padding-right: 18px; }
  .rdcart__line { gap: 9px; }
  .rdcart__kill { font-size: 11.5px; }
  .rdcart-btn--float { top: 82px; right: 12px; }
}

/* ───────── 움직임을 줄여 달라는 설정 존중 ───────── */
@media (prefers-reduced-motion: reduce) {
  .rdcart__panel, .rdcart__back, .rdcart-btn, .rdcart-btn__count, .rdcart__act {
    transition: none !important;
  }
  .rdcart-btn:hover { transform: none; }
}
