/* Host site fixed footer height (set by embed side if needed) */
:root {
  --host-footer-offset: 0px;
}

@font-face {
  font-family: "TamanegiKaisho";
  src: url("/assets/fonts/tamanegi-kaisho.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "TamanegiKaisho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.landing-page {
  display: flex;
  justify-content: center;
  background: #f5f5f5;
}

.app {
  width: 100%;
  max-width: 390px;
  height: calc(100vh - var(--host-footer-offset));
  height: calc(100dvh - var(--host-footer-offset));
  background: #ffffff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.landing-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.landing-slider-track {
  width: 200%;
  height: 100%;
  display: flex;
  animation: landing-slide-loop 24s linear infinite;
}

.landing-slider-image {
  width: 50%;
  height: 100%;
  flex: 0 0 50%;
  object-fit: cover;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 1;
}

.title {
  margin: 0;
  font-size: 40px;
  text-align: center;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8);
}

.button-area {
  position: relative;
  z-index: 2;
}

.start-btn {
  border: none;
  border-radius: 16px;
  background: #b07b45;
  color: #111;
  font-size: 32px;
  padding: 18px 30px;
  cursor: pointer;
}

@keyframes landing-slide-loop {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-slider-track {
    animation: none;
  }
}

.menu-page {
  display: flex;
  justify-content: center;
  background: #e7e4e0;
}

.menu-screen {
  width: 100%;
  max-width: 390px;
  height: calc(100vh - var(--host-footer-offset));
  height: calc(100dvh - var(--host-footer-offset));
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
  flex-shrink: 0;
  position: relative;
}

.menu-toggle {
  border: none;
  background: transparent;
  width: 30px;
  height: 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.menu-toggle-line {
  display: block;
  width: 100%;
  height: 2px;
  background: #111;
  border-radius: 999px;
}

.menu-title {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  white-space: nowrap;
}

.category-nav {
  display: none;
  position: absolute;
  top: 56px;
  left: 14px;
  z-index: 20;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.category-nav-item {
  border: none;
  background: #f3efe6;
  color: #111;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
}

.cart-icon-btn {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  padding: 0;
  position: relative;
  color: #111;
  cursor: pointer;
}

.cart-icon-btn svg {
  width: 100%;
  height: 100%;
}

.cart-count {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #b07b45;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  font-family: sans-serif;
}

.menu-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.menu-content::-webkit-scrollbar {
  display: none;
}

.menu-block {
  margin-bottom: 18px;
}

.menu-block-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1;
}

.menu-subtitle {
  margin: 8px 0 10px;
  font-size: 20px;
  line-height: 1;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-card {
  background: #f4f4f4;
  border-radius: 14px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  padding-bottom: 30px;
}

.menu-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.menu-card.has-qty {
  border-color: #b07b45;
  background: #f1eadf;
}

.menu-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.menu-tags {
  display: none;
}

.menu-price {
  margin: 0;
  font-size: 16px;
  line-height: 1;
}

.qty-control {
  position: absolute;
  right: 8px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  border: none;
  background: #b07b45;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.qty-value {
  min-width: 12px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
}

.menu-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
  flex-shrink: 0;
}

.action-btn {
  border: none;
  border-radius: 16px;
  font-size: 32px;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
}

.checkout-btn {
  background: #b07b45;
  color: #111;
  min-width: 124px;
  white-space: nowrap;
}

.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 30;
}

.cart-panel {
  display: none;
  position: fixed;
  right: 0;
  top: 0;
  width: min(340px, 90vw);
  height: calc(100vh - var(--host-footer-offset));
  height: calc(100dvh - var(--host-footer-offset));
  background: #fff;
  z-index: 40;
  padding: 16px;
  flex-direction: column;
  gap: 14px;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cart-panel::-webkit-scrollbar {
  display: none;
}

.cart-panel[style*='display: flex'] {
  flex-direction: column;
  gap: 14px;
}

.order-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 45;
}

.order-modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  z-index: 50;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.order-title {
  margin: 0 0 10px;
  font-size: 24px;
}

.order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.order-empty,
.order-total {
  margin: 10px 0 0;
  font-size: 14px;
}

.order-total {
  font-weight: 700;
}

.order-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.order-cancel-btn,
.order-confirm-btn {
  border: none;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}

.order-cancel-btn {
  background: #ece8e2;
  color: #111;
}

.order-confirm-btn {
  background: #b07b45;
  color: #111;
}

.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-panel-title {
  margin: 0;
  font-size: 26px;
}

.cart-close-btn {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cart-section {
  background: #f8f6f1;
  border-radius: 12px;
  padding: 12px;
}

.cart-section-title {
  margin: 0 0 8px;
  font-size: 20px;
}

.history-checkout-btn {
  border: none;
  border-radius: 16px;
  background: #b07b45;
  color: #111;
  font-size: 32px;
  line-height: 1;
  padding: 10px 14px;
  min-width: 124px;
  white-space: nowrap;
  cursor: pointer;
  align-self: flex-end;
}

.cart-list,
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-row,
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}

.history-row {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.history-meta {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.history-items {
  margin: 4px 0 0;
  font-size: 12px;
  color: #333;
  line-height: 1.35;
}

.cart-empty,
.history-empty,
.cart-total,
.history-total {
  margin: 8px 0 0;
  font-size: 14px;
}

.cart-total,
.history-total {
  font-weight: 700;
}

.modal-open {
  overflow: hidden;
}

.result-page {
  min-height: calc(100vh - var(--host-footer-offset));
  min-height: calc(100dvh - var(--host-footer-offset));
}

.result-screen {
  justify-content: flex-start;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.result-heading {
  font-size: 30px;
  text-align: center;
}

.result-card {
  background: #f8f6f1;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.result-image {
  width: min(200px, 70%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.result-name {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.result-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-weight: 700;
}

.result-share {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.result-share-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.result-qr {
  display: grid;
  place-items: center;
}

.result-barcode {
  width: min(280px, 100%);
  height: 64px;
}

.result-receipt-code {
  margin: 8px 0 0;
  font-size: 14px;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-weight: 700;
}

.result-actions {
  margin-top: auto;
  justify-content: center;
}

.result-back-btn {
  display: inline-block;
  text-decoration: none;
}

.result-message {
  margin-top: auto;
  padding-bottom: 8px;
  text-align: center;
}

.result-note {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
}

@media (max-width: 420px) {
  .menu-title {
    font-size: 32px;
  }

  .menu-block-title {
    font-size: 26px;
  }

  .menu-name,
  .menu-price {
    font-size: 15px;
  }

  .action-btn {
    font-size: 30px;
  }

  .result-heading {
    font-size: 28px;
  }

  .result-name {
    font-size: 28px;
  }

  .result-text {
    font-size: 16px;
  }

  .result-note {
    font-size: 18px;
  }
}
