/**
 * renewal-common.css
 * 리뉴얼 페이지 공통 UI 컴포넌트 (접두사 r-)
 * 기존 nh-, nf-, gv-, gl-, cart 등과 병행 사용. 쇼핑몰 신규 개발 시 통일성 유지용.
 *
 * 디자인 토큰:
 *   --r-color-text: #111
 *   --r-color-text-secondary: #333, #666, #888
 *   --r-color-border: #eee, #e5e7eb
 *   --r-color-bg: #f6f7f8, #f9f9f9
 *   --r-color-accent: #caa381 (브랜드 버튼)
 *   --r-color-accent-outline: #d8b08c
 *   --r-radius: 6px ~ 8px
 *   --r-gap: 12px ~ 24px
 */

 /* ===== 컨테이너 ===== */
.r-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
.r-container--wide {
  max-width: 1400px;
  padding: 0 24px;
}

/* ===== 타이포 ===== */
.r-section-tt {
  margin: 0 0 14px 0;
  font-size: 24px;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
}
.r-section-sub {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #666;
}

/* ===== 버튼 (쇼핑몰 공통) ===== */
.r-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  transition: filter 0.2s, background-color 0.2s;
}
.r-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.r-btn-primary {
  background: #caa381;
  color: #fff;
}
.r-btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}
.r-btn-ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #333;
}
.r-btn-ghost:hover:not(:disabled) {
  background: #f5f7f8;
}
.r-btn--sm {
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
}
.r-btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.r-btn-group .r-btn { flex: 1; min-width: 120px; }

/* ===== 폼 ===== */
.r-form-group {
  margin-bottom: 16px;
}
.r-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.r-label--required::after {
  content: ' *';
  color: #e64b38;
}
.r-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  color: #111;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: border-color 0.2s;
}
.r-input:focus {
  border-color: #caa381;
  outline: none;
}
.r-input::placeholder {
  color: #9aa0a6;
}
textarea.r-input {
  height: auto;
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

/* ===== 카드 (상품/리스트 공통) ===== */
.r-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
}
.r-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.r-card-thumb {
  position: relative;
  width: 100%;
  background: #f6f7f8 center/cover no-repeat;
  aspect-ratio: 1 / 1;
}
.r-card-info {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.r-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.4;
}
.r-card-desc {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}
.r-card-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.r-card-price-now { font-size: 15px; font-weight: 700; color: #111; }
.r-card-price-old { font-size: 12px; color: #9aa0a6; text-decoration: line-through; }
.r-card-price-badge { margin-left: 6px; font-size: 12px; font-weight: 700; color: #ff5a3d; }

/* ===== 단계 표시 (주문 플로우 등) ===== */
.r-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
}
.r-steps li {
  display: flex;
  align-items: center;
  position: relative;
  font-size: 14px;
  color: #9aa0a6;
}
.r-steps li.is-active {
  color: #111;
  font-weight: 700;
}
.r-steps li + li::before {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  width: 8px;
  height: 8px;
  border-left: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  transform: translateY(-50%) rotate(-135deg);
}

/* ===== 테이블형 리스트 (마이페이지/주문목록 등) ===== */
.r-table-wrap {
  width: 100%;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.r-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.r-table th,
.r-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f2f2f2;
}
.r-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
}
.r-table tr:last-child td { border-bottom: 0; }
.r-table tr:hover td { background: #fafbfc; }

/* ===== 빈 상태 ===== */
.r-empty {
  padding: 48px 24px;
  text-align: center;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}
.r-empty-tt {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* ===== 페이지네이션 ===== */
.r-pgn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 28px 0;
}
.r-pgn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: #444;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  transition: background 0.2s, border-color 0.2s;
}
.r-pgn-btn:hover:not(.is-disabled) {
  background: #f5f7f8;
  border-color: #d1d5db;
}
.r-pgn-btn.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}
.r-pgn-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #111;
  border: 1px solid #111;
  border-radius: 6px;
  background: #fff;
}
.r-pgn-num.is-active {
  background: #111;
  color: #fff;
}

/* ===== 수량 조절 (공통) ===== */
.r-qty {
  display: inline-flex;
  align-items: center;
  background: #fff;
}
.r-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #222;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s;
}
.r-qty-btn:hover { background: #f5f7f8; }
.r-qty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.r-qty-input {
  width: 46px;
  height: 40px;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
  font-size: 14px;
  background: #fff;
}
.r-qty-input:focus { outline: none; }

/* ===== 배지/라벨 ===== */
.r-badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}
.r-badge--sale { background: #ff5a3d; color: #fff; }
.r-badge--new { background: #111; color: #fff; }
.r-badge--outline { border: 1px solid #e5e7eb; color: #666; }

/* ===== 반응형 ===== */
@media (max-width: 900px) {
  .r-container { padding: 0 16px; }
  .r-container--wide { padding: 0 16px; }
  .r-section-tt { font-size: 20px; }
  .r-steps { gap: 16px; font-size: 12px; }
  .r-steps li + li::before { right: calc(100% + 8px); }
  .r-btn-group .r-btn { min-width: 0; }
}
@media (max-width: 640px) {
  .r-table-wrap { border-radius: 0; border-left: 0; border-right: 0; }
  .r-table th,
  .r-table td { padding: 12px; font-size: 13px; }
}
