/* 移动端基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #e8e8e8;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* 移动端固定宽度容器 */
.app-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: #f8f8fa;
  display: flex;
  flex-direction: column;
}

.app-body {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  min-height: 0;
}

.sidebar {
  width: 100px;
  background-color: #f5f5f7;
  padding-top: 20px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid #e8e8e8;
  box-shadow: 1px 0 4px rgba(0,0,0,0.03);
}

.menu-content {
  flex-grow: 1;
  background-color: #fff;
  padding: 0px 10px 90px 10px;
  overflow-y: auto;
  min-width: 0;
}

/* Left Side Navigation */
.tab-item {
  position: relative;
  padding: 22px 10px;
  font-size: 16px;
  text-align: center;
  color: #666;
  cursor: pointer;
  margin-bottom: 8px;
  border-radius: 12px 0 0 12px;
  transition: background 0.2s, color 0.2s;
}

.tab-item-active {
  background-color: #fffbe6;
  color: #d48806;
  font-weight: bold;
  box-shadow: 1px 1px 6px rgba(255,195,0,0.08);
}

.tab-item-before {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background-color: #ffc300;
  border-radius: 0 4px 4px 0;
}

/* Category Section */
.category-section {
  margin-bottom: 20px;
}

/* Category Title Inline */
.category-title-inline {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  padding: 20px 10px 10px 10px;
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 10;
  border-bottom: 2px solid #f0f0f0;
}

/* Menu Item Card */
.menu-item {
  display: flex;
  margin-bottom: 20px;
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.04);
  padding: 10px 10px 10px 0;
  align-items: center;
  transition: box-shadow 0.2s;
}

.menu-item:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.menu-item-image {
  width: 60px;
  height: 60px;
  margin-right: 10px;
  border-radius: 8px;
  background-color: #eee;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  object-fit: cover;
  flex-shrink: 0;
}

.menu-item-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  flex-grow: 1;
}

.item-name {
  font-size: 15px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.item-description {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.item-price {
  font-size: 15px;
  font-weight: bold;
  color: #fa541c;
}

.item-price-currency {
  font-size: 11px;
}

/* Quantity Control Inline */
.quantity-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn-inline {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  border: 1px solid #ffd666;
  background: #fff7e6;
  color: #fa8c16;
  box-shadow: 0 1px 3px rgba(250, 140, 22, 0.15);
  user-select: none;
  cursor: pointer;
}

.quantity-btn-inline.plus {
  background: linear-gradient(135deg, #ffd666 0%, #ffa940 100%);
  color: #7a3b00;
  border: none;
}

.quantity-btn-inline.minus {
  background: #fff;
  color: #fa8c16;
}

.quantity-btn-inline:active {
  transform: scale(0.92);
  opacity: 0.9;
}

.quantity-text-inline {
  min-width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

/* Floating Checkout Block */
.checkout-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1002;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  padding: 0 20px;
}

.checkout-info {
  color: #fff;
  font-size: 16px;
  padding: 0 6px;
  font-weight: 600;
  text-shadow: 0 0.5px 1px rgba(0,0,0,0.1);
  flex: 1;
}

.checkout-btn {
  background-color: white !important;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 700;
  border-radius: 25px;
  width: 40%;
  padding: 12px 0;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.checkout-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(255, 107, 53, 0.4);
}

/* Cart Popup */
.cart-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.cart-popup {
  position: fixed;
  bottom: 70px;
  left: 0;
  width: 100%;
  background-color: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 1002;
  padding: 22px 18px 18px 18px;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.10);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

.popup-header-title {
  font-size: 19px;
  font-weight: bold;
  color: #222;
}

.clear-cart-btn {
  padding: 6px 10px;
  background: #fff2e8;
  color: #fa541c;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

.clear-cart-btn:active {
  background: #f5f5f7;
}

.popup-body {
  overflow-y: auto;
}

.popup-item {
  background-color: #fafafa;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.popup-item-details {
  flex-grow: 1;
}

.popup-item-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.popup-item-category {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.popup-item-specs {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.specs-label {
  color: #999;
  margin-right: 4px;
}

.specs-text {
  color: #666;
}

.popup-item-controls {
  display: flex;
  width: 250px;
  justify-content: space-around;
  gap: 10px;
  align-items: center;
}

.popup-item-price {
  font-size: 16px;
  font-weight: bold;
  margin-right: 15px;
  color: #fa541c;
}

.quantity-control-popup {
  display: flex;
  width: 50%;
  align-items: center;
  gap: 10px;
}

.quantity-text {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  min-width: 20px;
  text-align: center;
}

.quantity-btn-popup {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: #fff7e6;
  border: 1px solid #ffd666;
  color: #fa8c16;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quantity-btn-popup:active {
  transform: scale(0.92);
}

.quantity-btn-popup.minus-btn {
  background: #a7a2a1 !important;
}

.quantity-btn-popup.plus-btn {
  background: linear-gradient(135deg, #ffd666 0%, #ffa940 100%);
  border: none;
  color: #7a3b00;
}

/* Page Main Header */
.page-main-header {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.info-block {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.restaurant-name {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
  color: #222;
  line-height: 1.2;
  word-break: break-all;
}

.restaurant-address {
  font-size: 11px;
  color: #888;
  line-height: 1.2;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
  margin-left: 8px;
  transition: background 0.2s;
  height: 24px;
  line-height: 22px;
  display: flex;
  align-items: center;
  max-width: 60px;
  min-width: 36px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.switch-btn:active {
  background: #f5f5f7;
}

.switch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Combo Dishes Popup */
.combo-dishes-popup-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.combo-dishes-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 480px;
  height: 70vh;
  max-height: 600px;
  background-color: #ffffff;
  border-radius: 16px;
  z-index: 1001;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.combo-dishes-popup-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.combo-dishes-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #fafafa;
}

.combo-dishes-popup-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  flex: 1;
}

.combo-dishes-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #666;
  cursor: pointer;
}

.combo-dishes-close-btn:active {
  background-color: #e8e8e8;
}

.combo-dishes-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
  max-height: calc(70vh - 80px);
}

.combo-dishes-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.combo-dishes-loading .loading-text {
  font-size: 16px;
  color: #666;
}

.combo-dishes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 10px;
}

.combo-dish-item {
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.combo-dish-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.combo-dish-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.combo-dish-category {
  font-size: 14px;
  color: #666;
  background-color: #e9ecef;
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.combo-dishes-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.combo-dishes-empty .empty-text {
  font-size: 16px;
  color: #999;
}

/* 移动端固定底部结算栏 */
.checkout-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background-color: #fff;
  border-top: 1px solid #f0f0f0;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.checkout-info {
  font-size: 14px;
  color: #666;
  flex-grow: 1;
}

.checkout-btn {
  background-color: #ffc107;
  color: #333;
  border: none;
  border-radius: 20px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  min-width: 100px;
}

.checkout-btn:disabled {
  background-color: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
}

/* Modal width alignment with 480px container */
#comboModal > div,
#dishModal > div {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 480px !important;
}
