@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
}

.mrb-mypage {
  --mrb-green: #ff5a36;
  --mrb-green-dark: #e84a28;
  --mrb-green-soft: rgba(255, 90, 54, 0.1);
  --mrb-ink: #111827;
  --mrb-muted: #6b7280;
  --mrb-line: #e5e7eb;
  --mrb-line-soft: #eef0f2;
  /* !important overrides the block theme's `is-layout-constrained > *` rule
     (TT2 forces max-width: var(--wp--content-size) = 650px on direct children
     of .entry-content), which would otherwise squeeze the whole mypage into
     the narrow 650px content column. The parent is far wider, so lifting this
     cap restores the intended 1040px width. */
  max-width: 1040px !important;
  margin: 24px auto;
  padding: 16px;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "맑은 고딕", sans-serif;
  color: #1f2937;
}

/* Force mypage font on headings (theme/useanyfont may override h1-h6 directly) */
.mrb-mypage h1,
.mrb-mypage h2,
.mrb-mypage h3,
.mrb-mypage h4,
.mrb-mypage h5,
.mrb-mypage h6 {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "맑은 고딕", sans-serif !important;
}

/* ===================== 비로그인 상태 ===================== */
.mrb-mypage-anon {
  text-align: center;
  padding: 56px 20px;
  background: #f8fafc;
  border: 1px solid var(--mrb-line);
  border-radius: 16px;
}
.mrb-anon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  color: var(--mrb-green);
  border: 1px solid var(--mrb-line);
  margin-bottom: 16px;
}
.mrb-mypage-anon h2 { margin: 0 0 8px; font-size: 1.35rem; }
.mrb-mypage-anon p { margin: 0 0 16px; color: var(--mrb-muted); }
.mrb-mypage-anon p:last-child { margin-bottom: 0; }

/* ===================== 2단 레이아웃 셸 ===================== */
.mrb-mypage-shell {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}
.mrb-mypage-sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
}
.mrb-mypage-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* ----- 사용자 카드 ----- */
.mrb-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--mrb-line);
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.mrb-avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mrb-green), #e84a28);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mrb-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.mrb-user-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--mrb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrb-user-email {
  font-size: 0.78rem;
  color: var(--mrb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- 사이드바 네비게이션 ----- */
.mrb-mypage-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Aggressive reset — bypass theme <button> rules so the nav item renders
   as a flat menu row regardless of the active site theme. */
.mrb-mypage button.mrb-nav-item,
.mrb-mypage button.mrb-nav-item:hover,
.mrb-mypage button.mrb-nav-item:focus,
.mrb-mypage button.mrb-nav-item:active {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  width: 100% !important;
  text-align: left !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #374151 !important;
  padding: 11px 14px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  text-transform: none !important;
  cursor: pointer !important;
  outline: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mrb-mypage button.mrb-nav-item:hover { background: #f3f4f6 !important; color: var(--mrb-ink) !important; }
.mrb-mypage button.mrb-nav-item.is-active {
  background: var(--mrb-green-soft) !important;
  color: var(--mrb-green) !important;
  font-weight: 700 !important;
}
.mrb-nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mrb-nav-item.is-active .mrb-nav-ico { color: var(--mrb-green); }

/* ----- 로그아웃 ----- */
.mrb-sidebar-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--mrb-line-soft);
}
.mrb-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mrb-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 8px 6px;
  border-radius: 8px;
  transition: color 0.15s ease;
}
.mrb-logout:hover { color: #dc2626; }

/* ===================== 패널 헤더 ===================== */
.mrb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--mrb-line-soft);
}
.mrb-panel-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--mrb-ink);
  letter-spacing: -0.01em;
}

/* ===================== 예약 필터 칩 ===================== */
.mrb-mypage-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mrb-mypage button.mrb-chip,
.mrb-mypage button.mrb-chip:focus {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mrb-mypage button.mrb-chip:hover { border-color: var(--mrb-green); color: var(--mrb-green); }
.mrb-mypage button.mrb-chip.is-active { background: var(--mrb-green); border-color: var(--mrb-green); color: #fff; }

/* ===================== 예약 상태 / 빈 상태 ===================== */
.mrb-mypage-status {
  padding: 48px 16px;
  text-align: center;
  color: var(--mrb-muted);
  background: #f9fafb;
  border: 1px dashed var(--mrb-line);
  border-radius: 14px;
}

.mrb-mypage-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

/* ===================== 예약 카드 ===================== */
.mrb-card {
  border: 1px solid var(--mrb-line);
  border-radius: 14px;
  background: #fff;
  padding: 18px 20px 16px;
  display: grid;
  gap: 12px;
  transition: border-color 0.18s ease;
}
.mrb-card:hover {
  border-color: #d1d5db;
}

.mrb-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: -4px;
}

.mrb-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
}

.mrb-card-room {
  font-weight: 700;
  color: var(--mrb-ink);
  letter-spacing: -0.01em;
}

.mrb-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mrb-card-ref {
  color: var(--mrb-muted);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Hero: primary booking date/time — the most scannable info on the card */
.mrb-card-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.mrb-card-hero-icon {
  font-size: 1rem;
  line-height: 1;
}
.mrb-card-hero-dt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.mrb-card-hero-dt strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--mrb-ink);
  font-variant-numeric: tabular-nums;
}
.mrb-card-hero-more {
  font-size: 0.85rem;
  color: var(--mrb-muted);
}

.mrb-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mrb-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

/* 예약상태 */
.mrb-badge.s-pending   { background: #fef3c7; color: #92400e; }
.mrb-badge.s-approved  { background: #dbeafe; color: #1e40af; }
.mrb-badge.s-completed { background: #d1fae5; color: #065f46; }
.mrb-badge.s-cancelled { background: #fee2e2; color: #991b1b; }
.mrb-badge.s-no_show   { background: #f3f4f6; color: #374151; }

/* 결제상태 */
.mrb-badge.p-pending          { background: #fef3c7; color: #92400e; }
.mrb-badge.p-awaiting_deposit { background: #fef9c3; color: #854d0e; }
.mrb-badge.p-paid             { background: #d1fae5; color: #065f46; }
.mrb-badge.p-failed           { background: #fee2e2; color: #991b1b; }
.mrb-badge.p-canceled         { background: #f3f4f6; color: #374151; }
.mrb-badge.p-refunded         { background: #ede9fe; color: #5b21b6; }
.mrb-badge.p-none             { background: #f9fafb; color: var(--mrb-muted); border-color: var(--mrb-line); }

.mrb-card-body { display: grid; gap: 8px; font-size: 0.92rem; color: #374151; }
.mrb-card-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.mrb-card-row b {
  color: var(--mrb-muted);
  font-weight: 600;
  font-size: 0.86rem;
  padding-top: 1px;
}
.mrb-card-row > span { color: var(--mrb-ink); word-break: break-word; }

/* Slot/options sub-lists — softer & better aligned with the row grid */
.mrb-slots-list,
.mrb-options-list {
  grid-column: 2;
  margin: 4px 0 0;
  padding-left: 16px;
  color: #4b5563;
  font-size: 0.9rem;
}
.mrb-slots-list li,
.mrb-options-list li { padding: 1px 0; }

/* Foot — applied at + grand total */
.mrb-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px dashed var(--mrb-line);
  padding-top: 12px;
  margin-top: 4px;
  gap: 8px;
  flex-wrap: wrap;
}
.mrb-meta { color: #9ca3af; font-size: 0.78rem; }
.mrb-card-foot .mrb-total {
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--mrb-ink);
  font-variant-numeric: tabular-nums;
}

/* ===================== 내 정보 폼 ===================== */
.mrb-tab-panel { padding: 4px 0; }
.mrb-section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mrb-ink);
}
.mrb-profile-form {
  background: #fff;
  border: 1px solid var(--mrb-line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.mrb-field {
  display: block;
  margin-bottom: 14px;
}
.mrb-field > span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.mrb-field em {
  color: #dc2626;
  font-style: normal;
  margin-left: 2px;
}
.mrb-field input[type="text"],
.mrb-field input[type="email"],
.mrb-field input[type="tel"],
.mrb-field input[type="password"],
.mrb-field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: #1f2937;
  font-family: inherit;
  box-sizing: border-box;
}
.mrb-field input:focus {
  outline: none;
  border-color: var(--mrb-green);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.15);
}
.mrb-field input[disabled],
.mrb-field input[readonly] {
  background: #f3f4f6;
  color: var(--mrb-muted);
  cursor: not-allowed;
}
.mrb-field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--mrb-muted);
  margin-top: 4px;
}
.mrb-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.mrb-profile-msg {
  padding: 12px 16px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.mrb-profile-msg.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* ===================== 버튼 ===================== */
.mrb-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.mrb-btn-primary { background: var(--mrb-green); color: #fff; }
.mrb-btn-primary:hover { background: var(--mrb-green-dark); }
.mrb-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ===================== 반응형 ===================== */
@media (max-width: 860px) {
  .mrb-mypage-shell {
    flex-direction: column;
    gap: 18px;
  }
  .mrb-mypage-sidebar {
    width: 100%;
    position: static;
  }
  .mrb-user-card { margin-bottom: 0; }
  .mrb-mypage-nav { flex-direction: row; gap: 6px; }
  .mrb-mypage button.mrb-nav-item { justify-content: center !important; }
  .mrb-sidebar-foot {
    margin-top: 10px;
    padding-top: 10px;
    text-align: right;
  }
}

@media (max-width: 520px) {
  .mrb-mypage { padding: 12px; }
  .mrb-panel-head { gap: 12px; }
  .mrb-panel-title { font-size: 1.18rem; }
  .mrb-card-row { grid-template-columns: 84px 1fr; gap: 8px; }
}
