/* ============================================================
   style.css – くまげらメニュー main styles
   Design: warm paper background, bold Japanese typography,
   subtle ink-brushwork accents. Signature: ink-stamp category headers.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Noto+Serif+JP:wght@400;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --ink: #1a1108;
  --ink-soft: #3d2f1e;
  --paper: #faf7f2;
  --paper-warm: #f3ede3;
  --paper-deep: #e8dfd0;
  --accent: #b5370a;
  --accent-light: #f5ece7;
  --gold: #c9930a;
  --border: #d5cbbf;
  --muted: #8a7a6a;
  --card-bg: #fffefb;
  --shadow: rgba(40,24,8,.08);

  --font-ja: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --font-serif: 'Noto Serif JP', 'Yu Mincho', serif;

  --radius: 10px;
  --radius-sm: 6px;
  --gap: 16px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-ja);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Site Header ─────────────────────────────────────────────── */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
}
.site-header__brand span {
  font-size: 12px;
  font-weight: 400;
  color: var(--paper-deep);
  margin-left: 8px;
  letter-spacing: .02em;
}
.site-header__nav { display: flex; gap: 12px; align-items: center; }
.header-link {
  font-size: 13px;
  color: var(--paper-deep);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.header-link:hover { background: rgba(255,255,255,.12); }
.header-link--active { color: #fff; background: var(--accent); }

/* ── Entry Page (index.html) ──────────────────────────────────── */
.entry-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--paper);
  text-align: center;
}
.entry-logo {
  font-family: var(--font-serif);
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .06em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.entry-sub {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .1em;
  margin-bottom: 48px;
}
.mode-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
}
.mode-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  width: 260px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-align: left;
}
.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--accent);
}
.mode-card__icon { font-size: 36px; margin-bottom: 16px; }
.mode-card__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.mode-card__desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.mode-card--order { border-color: var(--accent-light); }
.mode-card--order:hover { border-color: var(--accent); }
.entry-footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
}

/* ── Notice Banner ───────────────────────────────────────────── */
.notice-banner {
  background: #fffbf0;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px;
}
.notice-banner__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notice-lang {
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--paper-deep);
}
.notice-lang__label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.notice-lang__text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.notice-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Layout ──────────────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 56px);
}
@media (min-width: 900px) {
  .page-layout--with-cart {
    grid-template-columns: 1fr 340px;
  }
}

.menu-main {
  padding: 20px;
  max-width: 900px;
}
@media (min-width: 900px) {
  .menu-main { padding: 28px 32px; }
}

/* ── Menu Section ────────────────────────────────────────────── */
.menu-section { margin-bottom: 40px; }
.menu-section__heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 20px;
}
.menu-section__heading-ja {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .05em;
}
.menu-section__heading-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ── Menu Grid ───────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

/* ── Menu Card ───────────────────────────────────────────────── */
.menu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.menu-card:hover { box-shadow: 0 4px 20px var(--shadow); }
.menu-card--soldout { opacity: .6; }
.menu-card__img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--paper-warm);
}
.menu-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.menu-card:hover .menu-card__img img { transform: scale(1.04); }
.menu-card__body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.menu-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.menu-card__name-ja {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
}
.menu-card__name-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.menu-card__allergens { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.allergen {
  font-size: 10px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  padding: 1px 6px;
  border-radius: 3px;
}
.menu-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--paper-deep);
  gap: 8px;
  flex-wrap: wrap;
}
.menu-card__price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.menu-card__soldout-badge {
  font-size: 11px;
  font-weight: 700;
  background: #555;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
}

/* ── Qty Controls ────────────────────────────────────────────── */
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  color: var(--ink);
}
.qty-btn:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.qty-btn:disabled { opacity: .35; cursor: default; }
.qty-val {
  font-weight: 700;
  font-size: 16px;
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Cart Sidebar ────────────────────────────────────────────── */
.cart-sidebar {
  background: var(--paper-warm);
  border-left: 1px solid var(--border);
  padding: 20px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-sidebar__header {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.cart-section { display: flex; flex-direction: column; gap: 10px; }
.cart-section__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.cart-section--delta {
  background: #fffbf0;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.cart-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cart-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.cart-list__name { flex: 1; font-weight: 500; }
.cart-list__qty { color: var(--muted); font-size: 13px; }
.cart-list__sub { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cart-list__badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--gold);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cart-total {
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.cart-total strong { font-size: 20px; color: var(--accent); }
.cart-empty { font-size: 13px; color: var(--muted); font-style: italic; }
.cart-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* ── Share Panel ─────────────────────────────────────────────── */
.share-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.share-panel__qr { flex-shrink: 0; }
.share-panel__qr img { border-radius: 4px; }
.share-panel__info { flex: 1; min-width: 0; }
.share-panel__code {
  font-family: monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--ink);
  margin-bottom: 4px;
}
.share-panel__url {
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: 1.5px solid transparent;
  transition: background .15s, transform .1s;
  cursor: pointer;
  letter-spacing: .03em;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #922b08; }
.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-soft);
}
.btn--outline:hover { background: var(--paper-deep); }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: #a67a08; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--full { width: 100%; }
.btn--danger { background: #c0392b; color: #fff; }
.btn--danger:hover { background: #9b2d22; }

/* ── Toasts ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: 320px;
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--success { background: #2e7d32; }
.toast--error { background: #c0392b; }
.toast--info { background: var(--ink); }

/* ── Loading ─────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250,247,242,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  font-size: 15px;
  color: var(--muted);
  gap: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile cart drawer ───────────────────────────────────────── */
.mobile-cart-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  gap: 8px;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  cursor: pointer;
}
@media (max-width: 899px) {
  .mobile-cart-toggle { display: flex; }
  .cart-sidebar {
    position: fixed;
    right: 0;
    top: 56px;
    height: calc(100vh - 56px);
    width: min(340px, 100vw);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 150;
    box-shadow: -4px 0 20px rgba(0,0,0,.12);
  }
  .cart-sidebar--open { transform: translateX(0); }
  .cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 140;
  }
  .cart-overlay--show { display: block; }
}

/* ── Category Nav ────────────────────────────────────────────── */
.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 90;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav__btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.cat-nav__btn:hover, .cat-nav__btn--active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ── Misc ────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.page-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ── Order mode bottom mobile actions ─────────────────────────── */
.mobile-actions {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper-warm);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  gap: 10px;
  z-index: 130;
}
@media (max-width: 899px) {
  .mobile-actions { display: flex; }
  .menu-main { padding-bottom: 80px; }
}
