* {
  box-sizing: border-box;
}

html {
  width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input, select, textarea {
  font: inherit;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@supports (height: 100dvh) {
  .order-detail-modal {
    max-height: calc(100dvh - 36px);
  }

  .product-modal-card {
    max-height: calc(100dvh - 36px);
  }

  @media (max-width: 560px) {
    .product-modal-card {
      max-height: 88dvh;
    }
  }
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(255,226,183,.55), transparent 34%), #fff6e9;
  color: #3b2617;
  padding-bottom: 90px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12px 12px, rgba(139, 78, 36, .045) 2px, transparent 2px);
  background-size: 28px 28px;
  z-index: -1;
}

.hero, .sub-hero {
  position: relative;
  overflow: hidden;
}

.hero::after, .sub-hero::after {
  content: "🥐 🍞 🍰";
  position: absolute;
  right: 18px;
  bottom: 12px;
  font-size: 42px;
  opacity: .18;
  letter-spacing: 8px;
}

.notice, .order-card, .card, .menu-search-card {
  border: 1px solid rgba(154, 86, 42, .12);
}

.card {
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(107, 58, 24, .16);
}

.hero, .sub-hero {
  background: linear-gradient(135deg, #7b3f22 0%, #c46d36 48%, #f2b36d 100%);
  color: white;
  padding: 34px 22px;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 14px 34px rgba(96, 48, 18, .24);
}

.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: #8a4b24;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  white-space: nowrap;
}

.tab.active {
  background: #9b552a;
  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 {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: linear-gradient(135deg, #fff1d8, #e7a760);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
  border-bottom: 1px solid rgba(142, 78, 34, .12);
}

.food-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 15px;
}

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

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

.method-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.method-row button {
  border: 1px solid #d6d6d6;
  background: #fafafa;
  color: #333;
  padding: 8px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
.method-row button:only-child {
  grid-column: 1 / -1;
}
.method-row button.active {
  border-color: #8a4b24;
  background: #9b552a;
  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: #9b552a;
  color: white;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}


.product-card {
  cursor: pointer;
}

.product-card.active {
  box-shadow: 0 10px 28px rgba(138, 75, 36, .20);
}

.min-price {
  font-size: 20px;
}

.buy-open-btn {
  white-space: nowrap;
}

.option-panel {
  display: none;
  margin-top: 12px;
  margin-bottom: 0;
}

.option-panel.show {
  display: grid;
}

.option-panel .buy-option-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border-color: #e1c8a8;
  background: #fffaf2;
}

.option-panel .buy-option-btn b {
  color: #c45b2d;
  font-size: 13px;
  white-space: nowrap;
}

.option-panel .buy-option-btn:hover {
  border-color: #8a4b24;
  background: #fff0d6;
}

.cart-float {
  position: fixed;
  right: 16px;
  bottom: 18px;
  background: #b85f2d;
  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: #b85f2d;
  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: #3b2617;
  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: #a85d2d;
  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: #b85f2d;
  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 {
    aspect-ratio: 1 / 1;
    height: auto;
    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;
  }

  .min-price {
    font-size: 16px;
  }

  .buy-open-btn {
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
  }

  .option-panel .buy-option-btn {
    font-size: 13px;
  }
}


.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: #a85d2d;
  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: #a85d2d;
  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: #b85f2d;
  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: #a85d2d;
  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;
  }
}

/* 訂單後台 */
.admin-page {
  max-width: 1180px;
  margin: 22px auto;
  padding: 0 16px 80px;
  display: grid;
  gap: 16px;
}

.admin-toolbar {
  grid-template-columns: 1.4fr 1fr auto auto;
  align-items: end;
}

.admin-toolbar label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-toolbar input {
  width: 100%;
  border: 1px solid #e6d6c5;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  background: #fffaf4;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  background: white;
  border: 1px solid rgba(154, 86, 42, .12);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.summary-card span {
  display: block;
  color: #8a4b24;
  font-weight: 800;
  margin-bottom: 8px;
}

.summary-card strong {
  font-size: 30px;
}

.admin-list-card {
  display: block;
}

.admin-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-list-head h2 {
  margin: 0;
}

#adminMessage.ok {
  color: #16823a;
  font-weight: 800;
}

#adminMessage.error {
  color: #c42828;
  font-weight: 800;
}

.admin-orders {
  display: grid;
  gap: 12px;
}

.admin-order {
  background: #fffaf4;
  border: 1px solid #edd8c0;
  border-radius: 18px;
  padding: 14px;
}

.admin-order-top,
.admin-order-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-order-top strong {
  font-size: 24px;
}

.admin-order-top small {
  display: block;
  margin-top: 4px;
  color: #80614a;
}

.order-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pending { background: #fff1c7; color: #8a5a00; }
.status-making { background: #dff0ff; color: #145c94; }
.status-completed { background: #ddf7e4; color: #147233; }
.status-cancelled { background: #ffe0e0; color: #a51d1d; }

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.admin-meta span {
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  color: #67422a;
  font-weight: 700;
}

.admin-items {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  background: white;
  border-radius: 12px;
  padding: 9px 10px;
}

.admin-item em {
  font-style: normal;
  font-weight: 900;
}

.admin-note {
  background: #fff1d6;
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
}

.admin-order-bottom strong {
  font-size: 24px;
  color: #8a4b24;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-actions button {
  border: 0;
  background: #9b552a;
  color: white;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

.admin-actions button:nth-child(4) {
  background: #b33434;
}

@media (max-width: 820px) {
  .admin-toolbar,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-order-top,
  .admin-order-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

/* 訂單確認 / 成功明細彈窗 */
.order-detail-modal {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  text-align: left;
}

.order-detail-modal .modal-icon,
.order-detail-modal h2,
.order-detail-modal .modal-subtitle {
  text-align: center;
}

.modal-subtitle {
  color: #6b5949;
  line-height: 1.6;
  margin: 6px 0 14px;
}

.order-modal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.order-modal-info div,
.order-number-box,
.order-modal-note {
  background: #fff3df;
  border: 1px solid rgba(184, 95, 45, .18);
  border-radius: 14px;
  padding: 10px 12px;
}

.order-modal-info span {
  display: block;
  font-size: 12px;
  color: #8b6b53;
  margin-bottom: 3px;
}

.order-number-box {
  text-align: center;
  font-size: 18px;
  margin: 12px 0;
}

.order-number-box strong {
  color: #b85f2d;
  font-size: 28px;
}

.order-modal-list {
  border: 1px solid #ead8c6;
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 0;
  background: #fff;
}

.order-modal-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px dashed #ead8c6;
}

.order-modal-item:last-child {
  border-bottom: 0;
}

.order-modal-item small {
  display: block;
  color: #8b6b53;
  margin-top: 3px;
}

.order-modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff8ef;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 900;
  margin-top: 10px;
}

.order-modal-total strong {
  color: #b85f2d;
  font-size: 24px;
}

.order-modal-warning {
  background: #fff1d6;
  border: 1px solid #ffd596;
  color: #6b431e;
  border-radius: 14px;
  padding: 11px 12px;
  line-height: 1.6;
  margin: 12px 0;
}

.order-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn-secondary {
  width: 100%;
  border: 1px solid #d8c2a8;
  background: #fff;
  color: #8a3b20;
  padding: 14px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.order-modal-empty {
  padding: 14px;
  color: #8b6b53;
  text-align: center;
}

/* 店家客製化資訊顯示 */
.store-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.store-logo {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 22px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 10px 26px rgba(0,0,0,.16);
  border: 2px solid rgba(255,255,255,.42);
  flex: 0 0 auto;
}

.store-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  font-weight: 800;
}

.store-status.open {
  background: rgba(204,255,218,.28);
}

.store-status.closed {
  background: rgba(255,235,210,.3);
}

.store-info-grid {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: 14px;
  margin-bottom: 16px;
}

.store-info-card {
  background: #fff;
  border: 1px solid rgba(154, 86, 42, .12);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.store-info-card b {
  display: block;
  margin-bottom: 10px;
  color: #6b351b;
}

.business-hours-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.business-hours-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: #fff8ef;
  border-radius: 12px;
  padding: 9px 10px;
  color: #62402b;
}

.business-hours-row.today {
  background: #ffe8c9;
  font-weight: 900;
  color: #7b3f22;
}

#storeLineLink {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: #1e7a33;
  font-weight: 900;
  text-decoration: none;
  word-break: break-all;
}

@media (max-width: 720px) {
  .store-hero-main {
    align-items: flex-start;
  }

  .store-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .store-info-grid {
    grid-template-columns: 1fr;
  }

  .business-hours-list {
    grid-template-columns: 1fr;
  }
}


/* 修正：店家 Logo 強制小尺寸，避免原圖撐爆首頁 */
#storeLogo.store-logo,
.store-hero-main > .store-logo {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  object-fit: cover !important;
  border-radius: 18px !important;
  display: block !important;
  flex: 0 0 72px !important;
}

.store-hero-main {
  align-items: center !important;
}

@media (max-width: 720px) {
  #storeLogo.store-logo,
  .store-hero-main > .store-logo {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    flex-basis: 64px !important;
  }
}


/* 商品多圖輪播 */
.food-img-gallery {
  position: relative;
}

.food-img-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  z-index: 2;
}

.food-img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: #6b351a;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  z-index: 2;
}

.food-img-nav.prev {
  left: 8px;
}

.food-img-nav.next {
  right: 8px;
}

.food-img-nav:active {
  transform: translateY(-50%) scale(.96);
}

/* 我的訂單紀錄 */
.history-user{margin:0 0 12px;color:#7a6253;font-size:14px}.my-orders.empty{padding:18px;text-align:center;color:#7a6253;background:#fff8ef;border-radius:14px}.my-order-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px dashed #ead8c6}.my-order-row:first-child{border-top:0}.my-order-row b{color:#3a2415}.my-order-row small{display:block;margin-top:4px;color:#8b7464}.my-order-row p{margin:6px 0 0;color:#5b4638;font-size:14px;line-height:1.5}.my-order-row strong{white-space:nowrap;color:#8b4b22}.order-history-card.hidden{display:none!important}

.history-load-btn{width:100%;border:0;border-radius:14px;padding:12px 14px;margin:4px 0 12px;background:#8b4b22;color:#fff;font-weight:800;cursor:pointer}.history-load-btn:disabled{opacity:.65;cursor:not-allowed}

body.modal-open {
  overflow: hidden;
}

.product-modal.hidden {
  display: none;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 18, 10, .58);
  backdrop-filter: blur(3px);
}

.product-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fffaf2;
  border: 1px solid rgba(154, 86, 42, .18);
  border-radius: 28px;
  box-shadow: 0 22px 70px rgba(51, 27, 10, .34);
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 242, .92);
  color: #7b3f22;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(80, 42, 18, .16);
}

.modal-product-image .food-img {
  height: 245px;
  border-radius: 28px 28px 0 0;
}

.modal-product-info {
  padding: 20px;
}

.modal-product-info h2 {
  margin: 10px 0 4px;
  font-size: 26px;
  color: #3b2617;
}

.modal-hint {
  margin: 0 0 14px;
  color: #8a6b52;
  font-weight: 700;
}

.modal-option-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.modal-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e1c8a8;
  background: #fff;
  color: #4a2b16;
  border-radius: 16px;
  padding: 14px 15px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.modal-option-btn b {
  color: #c45b2d;
  white-space: nowrap;
}

.modal-option-btn.active {
  border-color: #9b552a;
  background: #fff0d6;
  box-shadow: 0 0 0 3px rgba(155, 85, 42, .12);
}

.modal-buy-btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #9b552a;
  color: #fff;
  padding: 15px 18px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 720px) {
  .product-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .product-modal-card {
    width: 100%;
    max-height: 88vh;
    border-radius: 24px;
  }

  .modal-product-image .food-img {
    height: 210px;
    border-radius: 24px 24px 0 0;
  }

  .modal-product-info {
    padding: 16px;
  }

  .modal-product-info h2 {
    font-size: 22px;
  }
}


/* 商品選購彈窗：詳情頁不顯示圖片 */
.modal-product-info.no-image {
  padding: 24px 20px 20px;
}

.modal-product-info.no-image h2 {
  margin-top: 10px;
}

.modal-product-image {
  display: none;
}

@media (max-width: 720px) {
  .modal-product-info.no-image {
    padding: 22px 16px 16px;
  }
}


/* LINE WebView 與一般瀏覽器顯示一致化 */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px;
  }

  .product-modal {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

/* 手機小版介面：讓 LINE WebView 跟一般瀏覽器都更接近 Chrome 那種小一點的比例 */
@media (max-width: 720px) {
  body {
    font-size: 14px;
    padding-bottom: 78px;
  }

  .hero, .sub-hero {
    padding: 26px 18px 28px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }

  .store-hero-main {
    gap: 14px !important;
    max-width: 100%;
  }

  #storeLogo.store-logo,
  .store-hero-main > .store-logo {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    flex-basis: 56px !important;
    border-radius: 15px !important;
  }

  .tag {
    padding: 6px 10px;
    font-size: 13px;
  }

  .hero h1, .sub-hero h1 {
    font-size: 30px;
    line-height: 1.18;
    margin: 8px 0 6px;
    letter-spacing: 1px;
  }

  .slogan, .info {
    font-size: 15px;
    line-height: 1.45;
  }

  .store-status {
    margin-top: 8px;
    padding: 7px 10px;
    font-size: 14px;
    line-height: 1.25;
  }

  .container, .order-page {
    margin: 16px auto;
    padding: 0 14px;
  }

  .store-info-card,
  .notice,
  .order-card,
  .menu-search-card {
    border-radius: 18px;
    padding: 14px;
  }

  .store-info-card b {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .business-hours-row {
    padding: 10px 12px;
    border-radius: 13px;
    font-size: 16px;
  }

  .menu-tabs {
    padding: 14px 0;
    gap: 8px;
  }

  .tab {
    padding: 9px 14px;
    font-size: 14px;
  }

  .card {
    border-radius: 18px;
  }

  .card h3 {
    font-size: 16px;
    line-height: 1.3;
  }

  .badge {
    font-size: 11px;
    padding: 3px 8px;
    margin-bottom: 8px;
  }

  .price {
    font-size: 18px;
  }

  .cart-float {
    bottom: 14px;
    padding: 13px 16px;
    font-size: 17px;
  }

  .cart-float span {
    min-width: 25px;
    height: 25px;
    font-size: 15px;
  }
}

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

  .slogan, .info {
    font-size: 14px;
  }

  .business-hours-row {
    font-size: 15px;
  }
}

/* 手機更小版介面 */
@media (max-width: 560px) {
  body {
    padding-bottom: 74px;
    font-size: 14px;
  }

  .hero, .sub-hero {
    padding: 20px 16px 22px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .hero::after, .sub-hero::after {
    right: 12px;
    bottom: 8px;
    font-size: 28px;
    letter-spacing: 4px;
  }

  .hero h1, .sub-hero h1 {
    font-size: 26px !important;
    line-height: 1.18;
    letter-spacing: 1px;
    margin: 4px 0;
  }

  .tag {
    padding: 5px 10px;
    font-size: 13px;
  }

  .slogan, .info {
    font-size: 14px;
    line-height: 1.45;
  }

  .container, .order-page, .admin-page {
    margin: 14px auto;
    padding: 0 12px;
  }

  .notice, .order-card, .menu-search-card {
    padding: 12px;
    border-radius: 15px;
  }

  .menu-tabs {
    padding: 12px 0;
    gap: 7px;
  }

  .tab {
    padding: 8px 12px;
    font-size: 13px;
  }

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

  .card {
    border-radius: 16px;
  }

  .card-body {
    padding: 9px;
  }

  .card h3 {
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 5px;
  }

  .badge {
    font-size: 10px;
    padding: 3px 7px;
    margin-bottom: 7px;
  }

  .food-img {
    font-size: 28px;
  }

  .price-row {
    gap: 6px;
  }

  .price, .min-price {
    font-size: 14px !important;
  }

  .buy-open-btn, .add-btn {
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 12px;
  }

  .cart-float {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 11px 14px;
    font-size: 16px;
    text-align: center;
  }

  .cart-float span {
    min-width: 22px;
    height: 22px;
    font-size: 13px;
  }

  input, select, textarea {
    padding: 10px;
    border-radius: 10px;
    font-size: 15px;
  }

  .submit, .clear-btn, .modal-btn {
    padding: 12px;
    border-radius: 13px;
    font-size: 15px;
  }

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

  .total strong {
    font-size: 22px;
  }

  .modal {
    padding: 12px;
  }

  .modal-box, .product-modal-card, .order-detail-modal {
    border-radius: 20px;
    padding: 18px 15px;
  }

  .product-modal-card h2,
  .modal-box h2 {
    font-size: 20px;
  }

  .toast {
    width: calc(100% - 24px);
    bottom: 74px;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .toast-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

@media (max-width: 390px) {
  .hero h1, .sub-hero h1 {
    font-size: 24px !important;
  }

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

  .buy-open-btn, .add-btn {
    font-size: 11px;
    padding: 6px 7px;
  }
}
