*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fb;
  --surface: #fff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2B87EC;
  --accent-hover: #2276d4;
  --selected-bg: #eef6fe;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(40px + var(--safe-bottom));
}

.site-header {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 0;
  padding-top: calc(16px + var(--safe-top));
}

.site-logo {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.site-logo:hover { opacity: 0.85; }

.site-logo img {
  height: 19px;
  width: auto;
  display: block;
}

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px;
  padding-top: calc(24px + var(--safe-top));
}

.page--wide {
  max-width: 1320px;
}

@media (min-width: 768px) {
  .page--wide .order-layout {
    grid-template-columns: 1fr 360px;
  }
}

.page--wide .order-layout--extras {
  grid-template-columns: 1fr 300px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.page-nav {
  margin-bottom: 16px;
}

.page-nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.page-nav a:hover { color: var(--accent); }

.order-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.order-section-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.order-section-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.order-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 768px) {
  .order-layout {
    grid-template-columns: 1fr 320px;
  }
}

.map-panel {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 768px) {
  .map-panel {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
}

.map-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.map-panel-label {
  font-size: 14px;
  font-weight: 600;
}

.map-panel-hint {
  font-size: 12px;
  color: var(--muted);
}

.map-viewport {
  height: 480px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.map-viewport.is-spotlight {
  overflow: hidden;
  height: 320px;
  background: #eceff3;
}

.map-viewport.is-spotlight.is-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.map-viewport.is-spotlight .map-stage {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
  margin: 0 auto;
}

.map-viewport.is-spotlight .map-image {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
}

.map-viewport.is-mobile-frame {
  overflow: auto;
  background: #eceff3;
}

.map-viewport.is-mobile-frame .map-stage {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
}

.map-viewport.is-mobile-frame .map-image {
  width: 390px;
  max-width: 100%;
}

.map-viewport.is-fit {
  overflow: hidden;
  height: auto;
  min-height: 120px;
}

.map-viewport.is-slot-frame {
  overflow: hidden;
  height: 400px;
  background: #eceff3;
}

.map-viewport.is-slot-frame .map-stage {
  width: var(--frame-width, 390px);
  max-width: 100%;
  margin: 0 auto;
}

.map-viewport.is-slot-frame .map-image {
  width: var(--frame-width, 390px);
  max-width: 100%;
}

.extras-mockup .map-viewport {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f9fafb;
}

.extras-mockup .map-viewport.is-fit {
  overflow: hidden;
  height: auto;
  min-height: 120px;
  max-height: min(680px, 72vh);
  --fit-max-height: min(680px, 72vh);
}

.extras-mockup .map-viewport.is-slot-frame {
  overflow: hidden;
  height: min(680px, 72vh);
  background: #eceff3;
}

.extras-mockup .map-viewport.is-fit.is-fit-white {
  background: #fff;
}

.extras-mockup .map-viewport.is-spotlight.is-spotlight-auto {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  height: min(680px, 72vh);
  background: #fff;
}

.extras-mockup .map-viewport.is-spotlight.is-spotlight-auto::-webkit-scrollbar {
  display: none;
}

.extras-mockup .map-viewport.is-spotlight.is-spotlight-auto .map-stage {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
  margin: 0 auto;
}

.extras-mockup .map-viewport.is-spotlight.is-spotlight-auto .map-image {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
}

.extras-mockup .map-viewport.is-slot-frame .map-stage {
  width: var(--frame-width, 390px);
  max-width: 100%;
  margin: 0 auto;
}

.extras-mockup .map-viewport.is-slot-frame .map-image {
  width: var(--frame-width, 390px);
  max-width: 100%;
}

.extras-mockup .map-viewport.is-spotlight.is-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  height: min(840px, 85vh);
  background: #eceff3;
}

.extras-mockup .map-viewport.is-spotlight.is-scroll .map-stage {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
  margin: 0 auto;
}

.extras-mockup .map-viewport.is-spotlight.is-scroll .map-image {
  width: var(--spotlight-width, 430px);
  max-width: 100%;
}

@media (min-width: 768px) {
  .map-viewport { height: 520px; }
  .map-viewport.is-spotlight:not(.is-scroll) { height: 360px; }
}

.map-stage {
  position: relative;
  width: 100%;
  line-height: 0;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.map-dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.map-dim.is-visible { opacity: 1; }

.map-dim-piece {
  position: absolute;
  z-index: 1;
  background: rgba(255, 255, 255, 0.62);
}

.map-dim-ring {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgba(43, 135, 236, 0.7),
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(15, 23, 42, 0.1);
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease;
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: #f9fafb;
}

.side-panel {
  background: var(--surface);
}

.side-panel-head {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.side-list { display: block; }

.side-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s;
}

.side-row:last-child { border-bottom: none; }
.side-row:hover { background: #f9fafb; }

.side-row.selected {
  background: var(--selected-bg);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-row-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.side-row-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.4;
}

.side-row-badge {
  display: inline-block;
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 8px;
}

.btn-link {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover { color: var(--accent-hover); }

.empty-panel {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.product-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.product-picker label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.product-picker select {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  padding: 9px 32px 9px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}

.product-picker select:focus {
  outline: 2px solid rgba(43, 135, 236, 0.25);
  border-color: var(--accent);
}

.order-section-head--split {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.extras-hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
  margin-bottom: 6px;
}

.extras-hero-title em {
  font-style: normal;
  color: var(--accent);
}

.extras-hero-caption {
  font-size: 13px;
  color: var(--muted);
}

.extras-hero {
  padding: 16px 20px 0;
}

/* 얇은 스크롤바 — 평소엔 거의 안 보이고, 호버·스크롤 시만 표시 */
.scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.3) transparent;
}

.scroll-area::-webkit-scrollbar {
  width: 6px;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.22);
  border-radius: 999px;
}

.scroll-area:hover::-webkit-scrollbar-thumb,
.scroll-area:focus-within::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.45);
}
