* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  background: #f8f4e8;
  color: #2f2a23;
  padding-bottom: 90px;
}

.hero, .sub-hero {
  background: linear-gradient(135deg, #21432f, #4f7c46);
  color: white;
  padding: 34px 22px;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.hero h1, .sub-hero h1 {
  margin: 6px 0;
  font-size: 40px;
  letter-spacing: 2px;
}

.sub-hero {
  padding-top: 24px;
}

.back {
  display: inline-block;
  color: white;
  text-decoration: none;
  background: rgba(255,255,255,.18);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.tag {
  margin: 0;
  background: rgba(255,255,255,.18);
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
}

.slogan, .info {
  margin: 5px 0 0;
  font-size: 17px;
  opacity: .94;
}

.container, .order-page {
  max-width: 1100px;
  margin: 22px auto;
  padding: 0 16px;
}

.notice, .order-card {
  background: white;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.order-page {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.menu-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tab {
  border: 0;
  padding: 11px 18px;
  border-radius: 999px;
  background: white;
  color: #30543a;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  white-space: nowrap;
}

.tab.active {
  background: #30543a;
  color: white;
}

.menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: white;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.1);
}

.food-img {
  height: 118px;
  background: linear-gradient(135deg, #e9c46a, #f4a261);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.card-body {
  padding: 15px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.badge {
  display: inline-block;
  background: #e7f2df;
  color: #315d35;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 10px;
}

.method-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.method-row button {
  flex: 1;
  border: 1px solid #d6d6d6;
  background: #fafafa;
  color: #333;
  padding: 8px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.method-row button.active {
  border-color: #30543a;
  background: #30543a;
  color: white;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-size: 22px;
  font-weight: 900;
  color: #c45b2d;
}

.add-btn {
  border: 0;
  background: #30543a;
  color: white;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.cart-float {
  position: fixed;
  right: 16px;
  bottom: 18px;
  background: #d66b2f;
  color: white;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  z-index: 20;
}

.cart-float span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: white;
  color: #d66b2f;
  border-radius: 999px;
  margin-left: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff7df;
  color: #2f2a23;
  padding: 14px 18px;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(0,0,0,.28);
  z-index: 50;
  min-width: 260px;
  animation: pop .25s ease;
}

.toast-icon {
  width: 36px;
  height: 36px;
  background: #4f7c46;
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
}

.toast b {
  display: block;
  font-size: 16px;
}

.toast span {
  font-size: 13px;
  opacity: .9;
}

@keyframes pop {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.order-items {
  display: grid;
  gap: 10px;
}

.empty {
  color: #888;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.item-name {
  display: grid;
  gap: 2px;
}

.item-name small {
  color: #777;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  border: 0;
  background: #eee;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 900;
}

label {
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-family: inherit;
  font-size: 16px;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.total.big {
  font-size: 20px;
}

.total strong {
  color: #c45b2d;
  font-size: 28px;
}

.submit {
  width: 100%;
  border: 0;
  background: #d66b2f;
  color: white;
  padding: 15px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.result {
  margin-top: 12px;
  background: #f4f4f4;
  padding: 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .hero h1, .sub-hero h1 {
    font-size: 31px;
  }

  .menu {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .food-img {
    height: 98px;
    font-size: 38px;
  }

  .card-body {
    padding: 12px;
  }

  .card h3 {
    font-size: 17px;
  }

  .cart-float {
    left: 16px;
    right: 16px;
    text-align: center;
  }

  .toast {
    width: calc(100% - 32px);
    bottom: 86px;
  }

  .method-row {
    gap: 6px;
  }

  .method-row button {
    padding: 7px 4px;
  }
}


.clear-btn {
  width: 100%;
  border: 1px solid #ddd;
  background: #fff;
  color: #8a3b20;
  padding: 12px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  margin-top: 8px;
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(42, 35, 25, .32);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 999;
}

.modal-box {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #fffaf0, #ffffff);
  border-radius: 28px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  border: 1px solid rgba(214, 107, 47, .18);
  animation: modalPop .22s ease;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #4f7c46;
  color: white;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(79,124,70,.32);
}

.modal-box h2 {
  margin: 8px 0;
  color: #24422e;
}

.modal-box p {
  margin: 8px 0 18px;
  line-height: 1.6;
  color: #5b5144;
}

.modal-btn {
  width: 100%;
  border: 0;
  background: #06c755;
  color: white;
  padding: 14px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

@keyframes modalPop {
  from {
    transform: translateY(18px) scale(.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}


.modal-link {
  display: block;
  margin-top: 12px;
  color: #4f7c46;
  font-weight: 900;
  text-decoration: none;
}


.reservation-fields {
  display: grid;
  gap: 10px;
  background: #fff7df;
  border: 1px solid rgba(214, 107, 47, .18);
  border-radius: 16px;
  padding: 12px;
}

/* 漂亮通知框：取代瀏覽器黑色 alert */
.toast {
  border: 1px solid rgba(255, 255, 255, .7);
  backdrop-filter: blur(10px);
}
.toast.toast-success { background: linear-gradient(135deg, #fff9e8, #e9f7df); }
.toast.toast-success .toast-icon { background: #3f8f4d; }
.toast.toast-warning { background: linear-gradient(135deg, #fff7df, #ffe8bf); }
.toast.toast-warning .toast-icon { background: #d98b22; }
.toast.toast-error { background: linear-gradient(135deg, #fff0ea, #ffe1dc); }
.toast.toast-error .toast-icon { background: #d64b3f; }

/* 品項搜尋 */
.menu-search-card {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(214, 107, 47, .16);
  border-radius: 22px;
  padding: 14px;
  margin: 14px 0 12px;
  box-shadow: 0 10px 24px rgba(71, 46, 24, .08);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff7df;
  border: 1px solid rgba(214, 107, 47, .22);
  border-radius: 18px;
  padding: 10px 12px;
}

.search-icon {
  font-size: 18px;
}

#menuSearch {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: #2f2418;
  min-width: 0;
}

#menuSearch::placeholder {
  color: #9b8063;
}

.clear-search {
  border: 0;
  background: #d66b2f;
  color: white;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

#searchHint {
  display: block;
  margin-top: 8px;
  color: #8b7159;
  font-weight: 700;
}

.menu-result-count {
  margin: 10px 2px 12px;
  color: #4f7c46;
  font-weight: 900;
}

.empty-search {
  grid-column: 1 / -1;
  text-align: center;
  background: #fffaf0;
  border: 1px dashed rgba(214, 107, 47, .35);
  border-radius: 24px;
  padding: 34px 18px;
  color: #6b5844;
}

.empty-search div {
  font-size: 36px;
}

.empty-search h3 {
  margin: 8px 0 6px;
  color: #2f2418;
}

.empty-search p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 520px) {
  .search-wrap {
    padding: 9px 10px;
  }

  #menuSearch {
    font-size: 15px;
  }

  .clear-search {
    padding: 7px 10px;
  }
}
