/* =========================================================================
   다낭 빠른예약 — 스타일 (모바일 우선 · 라이트 · 흰색/파란색/노란색)
   ========================================================================= */
:root {
  /* 라이트 전용 고정 — 브라우저가 임의로 어둡게 반전시키지 못하게 막습니다 */
  color-scheme: only light;

  /* 파란색 포인트 */
  --blue: #1f7ae0;
  --blue-bright: #3d96f2;
  --blue-dark: #12569e;
  --blue-soft: rgba(31, 122, 224, 0.10);

  /* 노란색 강조 */
  --yellow: #ffd400;
  --yellow-soft: rgba(255, 212, 0, 0.20);

  /* 흰색 배경 계열 */
  --bg: #eef4fb;
  --card: #ffffff;
  --card-2: #f1f6fc;

  /* 브랜드 버튼 (팔레트와 일치: 카카오=노랑, 텔레그램=파랑) */
  --kakao: #ffe200;
  --kakao-text: #1a1600;
  --telegram: #29a9eb;

  --ink: #1b2735;
  --muted: #78889a;
  --line: #e3ebf4;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(31, 122, 224, 0.10);
  --maxw: 480px;
}

/* -------------------------------------------------------------------------
   색상 고정 (다크모드 대응)

   이 사이트는 라이트 색상 하나로만 갑니다. 그런데 삼성 인터넷·크롬의
   "자동 어둡게" 기능은 다크 대응이 없는 페이지를 임의로 반전시켜서,
   노란 로고가 갈색으로 보이는 등 색이 망가집니다.

   아래 블록은 "이 사이트는 다크모드를 직접 처리한다"고 브라우저에 알려
   자동 반전을 끄기 위한 것입니다. 위 :root 의 색 변수는 그대로 두므로
   다크모드에서도 라이트와 완전히 같은 색이 나옵니다.
   → 색을 바꾸려면 위 :root 한 곳만 고치면 됩니다. 여기는 건드릴 필요 없습니다.
   ------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: only light; }
  html, body, .app {
    background: var(--bg);
    color: var(--ink);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  color-scheme: only light;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* ---------- 공통 헤더 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  border: 1px solid var(--line); background: var(--blue-soft); color: var(--blue-dark);
  width: 38px; height: 38px; border-radius: 12px; font-size: 20px; line-height: 1; flex: 0 0 auto;
}
.topbar .title { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.topbar .title small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- 홈 화면 ---------- */
.home-hero { padding: 30px 20px 8px; text-align: center; }
.home-hero .brand-logo {
  width: min(100%, 320px); height: auto; margin: 0 auto;
}
.home-hero p { margin: 12px 6px 0; color: var(--muted); font-size: 14px; }

/* 2 x 2 버튼 그리드 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 16px 24px; }
.cat-btn {
  position: relative; border: none;
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; border-radius: var(--radius); aspect-ratio: 1 / 0.9; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0; box-shadow: 0 8px 20px rgba(31, 122, 224, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.cat-btn:active { transform: scale(0.97); filter: brightness(1.08); }
.cat-text {
  position: relative; z-index: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px; margin: auto;
}
.cat-btn .emoji { font-size: 40px; line-height: 1; }
.cat-btn .label { font-size: 16px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,0.2); }

.home-note {
  margin: 4px 16px 30px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; color: var(--muted); font-size: 13px; box-shadow: var(--shadow);
  border-left: 4px solid var(--yellow);
}
.home-note b { color: var(--ink); }

/* ---------- 가게 목록 ---------- */
.list { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.shop-card {
  display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; box-shadow: var(--shadow);
  align-items: center; transition: transform 0.12s ease, border-color 0.12s ease;
}
.shop-card:active { transform: scale(0.98); border-color: var(--blue); }
.shop-card .thumb { width: 92px; height: 92px; border-radius: 12px; flex: 0 0 auto; overflow: hidden; }
.shop-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.shop-card .info { min-width: 0; flex: 1; }
.shop-card .info h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.shop-card .info .tagline {
  color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.shop-card .info .area {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700;
  color: var(--blue-dark); background: var(--blue-soft); padding: 2px 8px; border-radius: 999px;
}
.shop-card .chev { color: var(--blue-bright); font-size: 22px; flex: 0 0 auto; }

/* 플레이스홀더 */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #fff; font-size: 30px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}

/* ---------- 가게 상세 ---------- */
.detail { padding-bottom: 96px; }
.hero { position: relative; aspect-ratio: 16 / 10; background: var(--card-2); overflow: hidden; }
.hero img, .hero .ph { width: 100%; height: 100%; object-fit: cover; }
.hero .overlay {
  position: absolute; inset: auto 0 0 0; padding: 40px 18px 16px;
  background: linear-gradient(to top, rgba(18, 40, 70, 0.72), transparent); color: #fff;
}
.hero .overlay h1 { margin: 0; font-size: 22px; font-weight: 900; }
.hero .overlay p { margin: 4px 0 0; font-size: 13px; opacity: 0.95; }

.section {
  background: var(--card); border: 1px solid var(--line);
  margin: 12px; padding: 18px; border-radius: 16px; box-shadow: var(--shadow);
}
.section h2 {
  margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--blue-dark);
  display: flex; align-items: center; gap: 8px;
}
.section p { margin: 0 0 10px; white-space: pre-line; font-size: 14.5px; }
.section p:last-child { margin-bottom: 0; }

/* 갤러리 */
.gallery {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 12px 4px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .g-item {
  flex: 0 0 auto; width: 220px; height: 150px; border-radius: 14px; overflow: hidden;
  scroll-snap-align: start; box-shadow: var(--shadow);
}
.gallery .g-item img, .gallery .g-item .ph { width: 100%; height: 100%; object-fit: cover; }

/* 코스/가격 */
.course {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.course:last-child { border-bottom: none; }
.course .c-name { font-weight: 800; }
.course .c-desc { color: var(--muted); font-size: 13px; }
.course .c-price { font-weight: 900; color: var(--blue-dark); white-space: nowrap; }
.options {
  margin: 10px 0 0; padding: 10px 12px; background: var(--yellow-soft);
  border-radius: 10px; font-size: 13px; color: var(--ink); border: 1px solid rgba(255,212,0,0.5);
}
.options b { display: block; margin-bottom: 2px; color: var(--blue-dark); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: none; }
.faq summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 14.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; color: var(--blue-bright); font-weight: 900; }
.faq details[open] summary::after { content: "－"; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* 위치 */
.addr-box { display: flex; gap: 8px; margin-top: 6px; }
.addr-box input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; background: var(--card-2); color: var(--ink);
}
.addr-box button {
  border: none; border-radius: 10px; padding: 0 14px;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 13px;
}
.btn-grab {
  display: block; text-align: center; margin-top: 10px; padding: 13px; border-radius: 12px;
  background: var(--yellow); color: var(--blue-dark); font-weight: 800; font-size: 14px;
  border: 1px solid rgba(0,0,0,0.05);
}
.btn-dir {
  display: block; text-align: center; margin-top: 10px; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-dark));
  color: #fff; font-weight: 800; font-size: 14px;
}
.btn-map {
  display: block; text-align: center; margin-top: 10px; padding: 12px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--blue-soft); color: var(--blue-dark);
  font-weight: 800; font-size: 14px;
}
.copied { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--blue-dark); opacity: 0; transition: opacity 0.2s; }
.copied.show { opacity: 1; }

/* ---------- 하단 고정 예약 바 ---------- */
.book-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; gap: 10px; padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.book-bar a, .book-bar button {
  flex: 1; text-align: center; padding: 14px 8px; border-radius: 14px;
  font-weight: 800; font-size: 15px; border: none; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.book-bar .kakao { background: var(--kakao); color: var(--kakao-text); }
.book-bar .telegram { background: var(--telegram); color: #fff; }
.book-bar .phone { background: var(--blue); color: #fff; }
.book-bar a:active, .book-bar button:active { filter: brightness(0.95); }

/* 본문 CTA */
.cta-row { display: flex; gap: 10px; }
.cta-row a, .cta-row button {
  flex: 1; text-align: center; padding: 14px; border-radius: 12px;
  font-weight: 800; font-size: 15px; border: none; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cta-row .kakao { background: var(--kakao); color: var(--kakao-text); }
.cta-row .telegram { background: var(--telegram); color: #fff; }
.cta-row a:active, .cta-row button:active { filter: brightness(0.95); }

/* 푸터 */
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 30px; }

/* 화면 전환 */
.view { animation: fade 0.22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* 하단 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(12px);
  max-width: 90%; z-index: 50;
  background: var(--blue-dark); color: #fff; border: 1px solid var(--blue-bright);
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600; text-align: center;
  box-shadow: 0 8px 24px rgba(18, 40, 70, 0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
