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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: #FFF8F0;
  color: #5D4037;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #FF9A76, #FFB088);
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(255, 154, 118, 0.3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.header-text h1 {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.08);
  letter-spacing: 2px;
}

.header-text p {
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  margin-top: 2px;
}

.cart-btn {
  background: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.cart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

#cartCount {
  background: #FF6B6B;
  color: #fff;
  border-radius: 50px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  padding: 24px;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.category-list, .history-section {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.category-list h3, .history-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #795548;
}

.category-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: #FFF3E0;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
  font-family: inherit;
  color: #5D4037;
}

.category-btn:hover {
  background: #FFE0B2;
}

.category-btn.active {
  background: #FF9A76;
  color: #fff;
  font-weight: 700;
}

.history-item {
  padding: 12px;
  background: #FFF8F0;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  border-left: 3px solid #FF9A76;
}

.history-item .time {
  font-size: 12px;
  color: #A1887F;
  margin-bottom: 4px;
}

.history-item .items {
  margin-bottom: 4px;
}

.history-item .total-price {
  font-weight: 700;
  color: #FF6B6B;
}

.menu-section {
  flex: 1;
}

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

.menu-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 154, 118, 0.2);
}

.menu-card .img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #FFF3E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
}

.menu-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-card .info {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-card .name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.menu-card .desc {
  font-size: 13px;
  color: #A1887F;
  margin-bottom: 10px;
  line-height: 1.4;
  flex: 1;
}

.menu-card .bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-card .price {
  font-size: 18px;
  font-weight: 900;
  color: #FF6B6B;
}

.menu-card .price::before {
  content: '$';
  font-size: 14px;
}

.add-btn {
  background: #FF9A76;
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

.add-btn:hover {
  background: #FF8A65;
  transform: scale(1.1);
}

.add-btn:active {
  transform: scale(0.95);
}

.cart-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
}

.cart-overlay.active {
  display: block;
}

.cart-panel {
  position: fixed;
  top: 0; right: -400px;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 300;
  transition: right 0.35s ease;
  display: flex;
  flex-direction: column;
}

.cart-panel.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #FFF3E0;
}

.cart-header h2 {
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #A1887F;
  transition: 0.2s;
}

.close-btn:hover {
  color: #5D4037;
  transform: rotate(90deg);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #FFF3E0;
}

.cart-item .item-emoji {
  font-size: 32px;
  width: 48px;
  text-align: center;
}

.cart-item .item-info {
  flex: 1;
}

.cart-item .item-name {
  font-weight: 700;
  font-size: 15px;
}

.cart-item .item-price {
  font-size: 13px;
  color: #A1887F;
  margin-top: 2px;
}

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

.qty-control button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-control .qty-btn-minus {
  background: #FFF3E0;
  color: #5D4037;
}

.qty-control .qty-btn-plus {
  background: #FF9A76;
  color: #fff;
}

.qty-control .qty-num {
  font-weight: 700;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.cart-item .item-total {
  font-weight: 700;
  color: #FF6B6B;
  min-width: 50px;
  text-align: right;
}

.cart-item .item-total::before {
  content: '$';
}

.cart-summary {
  padding: 20px 24px;
  border-top: 2px solid #FFF3E0;
  background: #FFFAF5;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
}

.summary-row.total {
  font-size: 20px;
  font-weight: 900;
  color: #FF6B6B;
  border-top: 2px dashed #FFE0B2;
  padding-top: 10px;
  margin-top: 4px;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #FF9A76, #FF6B6B);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 2px;
}

.checkout-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.checkout-btn:active {
  transform: scale(0.98);
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #5D4037;
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 400;
  opacity: 0;
  transition: all 0.4s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty-cart {
  text-align: center;
  padding: 40px 0;
  color: #A1887F;
}

.empty-cart .big-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-history {
  text-align: center;
  color: #A1887F;
  font-size: 13px;
  padding: 10px 0;
}

/* ===== Discount Wheel ===== */
.wheel-container {
  position: fixed;
  bottom: 160px;
  left: 20px;
  z-index: 150;
  user-select: none;
}

.wheel-inner {
  position: relative;
  width: 220px;
  height: 260px;
}

#wheelCanvas {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), inset 0 0 0 4px #fff;
  display: block;
}

.wheel-pointer {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  line-height: 1;
}

.pointer-cat {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  display: block;
}

.spin-btn {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF6B6B, #FF9A76);
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
  transition: all 0.2s;
  letter-spacing: 2px;
  white-space: nowrap;
  z-index: 2;
}

.spin-btn:hover {
  transform: translateX(-50%) scale(1.06);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.45);
}

.spin-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: translateX(-50%) scale(1);
}

.wheel-discount-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: #FF6B6B;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(255,107,107,0.3);
  border: 2px solid #fff;
  z-index: 3;
  white-space: nowrap;
}

.wheel-cat-btn {
  display: none;
}

@media (max-width: 768px) {
  .wheel-container {
    display: none !important;
  }

  .wheel-cat-btn {
    display: block;
  }
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  grid-column: 1 / -1;
}

.wheel-section .wheel-inner-wrap {
  position: relative;
  width: 240px;
  height: 300px;
}

.wheel-section .wheel-pointer {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  line-height: 1;
}

.wheel-section .pointer-cat {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  display: block;
}

.wheel-section #wheelCanvasMobile {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), inset 0 0 0 4px #fff;
  display: block;
  margin: 0 auto;
}

.wheel-section .spin-btn {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF6B6B, #FF9A76);
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
  transition: all 0.2s;
  letter-spacing: 2px;
  white-space: nowrap;
  z-index: 2;
}

.wheel-section .spin-btn:hover {
  transform: translateX(-50%) scale(1.06);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.45);
}

.wheel-section .spin-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.wheel-section .spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: translateX(-50%) scale(1);
}

.wheel-section .wheel-discount-badge {
  margin-top: 16px;
  background: #FF6B6B;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(255,107,107,0.3);
  border: 2px solid #fff;
  white-space: nowrap;
}

/* ===== Discount Wheel End ===== */

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }

  .header-text h1 {
    font-size: 20px;
  }

  .logo {
    width: 32px;
    height: 32px;
  }

  .container {
    flex-direction: column;
    padding: 12px;
  }

  .sidebar {
    width: 100%;
  }

  .category-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 14px;
    overflow-x: auto;
  }

  .category-list h3 {
    width: 100%;
    margin-bottom: 2px;
    font-size: 14px;
  }

  .category-btn {
    width: auto;
    margin-bottom: 0;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .history-section {
    display: none;
  }

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

  .menu-card {
    border-radius: 16px;
  }

  .menu-card .info {
    padding: 10px 12px 12px;
  }

  .menu-card .name {
    font-size: 14px;
  }

  .menu-card .desc {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .menu-card .price {
    font-size: 16px;
  }

  .add-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .menu-card .img-wrap {
    font-size: 48px;
  }

  .cart-panel {
    width: 100%;
    right: -100%;
  }

  .cart-header {
    padding: 14px 16px;
  }

  .cart-items {
    padding: 12px 16px;
  }

  .cart-item {
    gap: 8px;
  }

  .cart-item .item-emoji {
    font-size: 28px;
    width: 36px;
  }

  .cart-summary {
    padding: 14px 16px;
  }

  .checkout-btn {
    padding: 12px;
    font-size: 16px;
  }

  .toast {
    font-size: 14px;
    padding: 12px 20px;
    bottom: 20px;
  }
}
