* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Noto Sans TC", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f4ede6;
  /* 淺奶咖啡紙張色 */
  color: #3e2f25;
  /* 深咖啡文字，避免刺眼 */
}

/* 導覽列 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
}

.logo {
  font-weight: bold;
  font-size: 1.2rem;
}

.navbar nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #333;
  padding-bottom: 4px;
}

.navbar nav a.active {
  border-bottom: 2px solid #333;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #222;
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
}

/* 通用 main */
main {
  flex: 1;
  padding-top: 80px;
  padding-bottom: 80px;
}

/* 首頁 */
.hero {
  position: relative;
  /* 必須有，讓 ::before 能定位 */
  height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* 避免 ::before 超出 */
}

.hero-content {
  position: relative;
  /* 文字置於 ::before 上方 */
  z-index: 1;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* top:0; right:0; bottom:0; left:0 */
  background-image: url("../img/shop.png");
  background-size: cover;
  background-position: center;
  filter: blur(8px);
  transform: scale(1.1);
  /* 模糊會縮小，放大補償 */
  z-index: 0;
}

.hero h1 {
  color: rgb(254, 223, 131);
  font-size: 3rem;
  margin-bottom: 20px;
}

.btn {
  padding: 10px 25px;
  background: #f6b84d;
  color: #000000;
  text-decoration: none;
  transition: background 0.3s;
}

.btn:hover {
  background: #555;
}

.home-gallery {
  display: flex;
  gap: 20px;
  padding: 40px;
  justify-content: center;
}

.image-box {
  width: 200px;
  height: 200px;
  background: #ccc;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.image-box:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* 菜單 */
.menu h2 {
  text-align: center;
  margin-bottom: 30px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 0 40px;
}

.menu-item {
  background: #f5f5f5;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}

/* 關於我們 */
.about {
  max-width: 700px;
  margin: auto;
  padding: 20px;
  padding-top: 100px; /* 修正：增加頂部內距，避免被導覽列遮擋 */
  line-height: 1.8;
  background: rgba(255, 250, 245, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 160px);
  /* 扣掉 header 60 + footer 100 */
}

/* RWD */
@media (max-width: 768px) {
  .home-gallery {
    flex-direction: column;
    align-items: center;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}

/* Old menu styles removed/replaced by new ones at bottom */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #f7f1eb;
  width: 90%;
  max-width: 800px;
  border-radius: 10px;
  padding: 20px;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* 內容左右排 */
.modal-content {
  display: flex;
  gap: 20px;
}

.modal-image img {
  width: 250px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.modal-text {
  flex: 1;
}

.skeleton-card {
  height: 260px;
  border-radius: 12px;
  background: linear-gradient(100deg, #e6e0d8 40%, #f3eee8 50%, #e6e0d8 60%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

@keyframes skeleton {
  to {
    background-position: -200% 0;
  }
}

/* ===== 標籤篩選玻璃按鈕 ===== */
#tagFilter button {
  padding: 8px 16px;
  margin: 6px;
  border-radius: 999px;
  /* 完全圓角 */
  border: 1px solid rgba(255, 255, 255, 0.35);

  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  color: #3b2f2f;
  /* 咖啡色字 */
  font-size: 14px;
  cursor: pointer;

  transition: all 0.3s ease;
}

/* hover 效果 */
#tagFilter button:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* 點擊中的狀態（可選） */
#tagFilter button.active {
  background: rgba(120, 90, 70, 0.5);
  color: #fff;
  font-weight: 600;

  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.25);

  transform: scale(1.05);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
}

.nav a {
  position: relative;
  padding: 4px 0;
}

/* 底線本體 */
.nav-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: #333;
  transition: all 0.3s ease;
  width: 0;
  left: 0;
}

/* 購物車紅點 */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background-color: #ff4757;
  color: white;
  font-size: 0.75rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 99px;
  padding: 0 4px;
  font-weight: bold;
  pointer-events: none;
  border: 1px solid #fff;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.bump {
  transform: scale(1.4);
}

/* 手機版 */
@media (max-width: 768px) {
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
  }

  .modal-overlay.active {
    display: flex;
  }

  .modal-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    width: 90%;
    max-height: 93vh;
    /* ⭐ 手機關鍵 */
    overflow: hidden;
    /* 卡片本身不滾 */
  }

  .modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    /* ⭐ 滑動發生在這 */
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
    /* iOS 滑動順 */
  }

  .modal-image img {
    width: 100%;
    max-height: 40vh;
    object-fit: cover;
    border-radius: 12px;
  }

  .modal-card {
    animation: slideUp 0.25s ease;
  }
}

/* ========================= */
/* 菜單卡片優化 */
/* ========================= */
.menu-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  cursor: pointer;
}

.menu-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 正方形 */
  overflow: hidden;
  border-radius: 8px;
  /* 圓角 */
  margin-bottom: 12px;
}

.menu-img-square {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.menu-item:hover .menu-img-square {
  transform: scale(1.1);
}

.menu-info h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #3e2f25;
}

.menu-desc {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;

  /* 多行截斷 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 顯示行數 */
  line-clamp: 2;
  /* 標準屬性 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-price {
  font-weight: bold;
  color: #8b5e3c;
  margin-bottom: 10px;
}

.btn-add-cart {
  width: 100%;
  padding: 8px;
  background-color: #f6b84d;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-add-cart:hover {
  background-color: #e0a035;
}

/* ========================= */
/* 購物車頁面 */
/* ========================= */
.cart-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  padding-top: 100px;
  /* offset navbar */
  width: 100%;
}

.cart-page h2 {
  text-align: center;
  margin-bottom: 30px;
}

.cart-container {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cart-item {
  display: flex;
  flex-wrap: wrap;
  /* RWD */
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  gap: 15px;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 2;
  min-width: 250px;
}

.cart-item-info img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info h4 {
  margin-bottom: 5px;
}

.cart-item-note {
  flex: 2;
  min-width: 200px;
}

.cart-item-note input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.btn-remove {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-qty {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  color: #3e2f25;
  font-weight: bold;
  margin: 0 2px;
  transition: all 0.2s;
}

.btn-qty:hover {
  background: #f6b84d;
  border-color: #f6b84d;
  color: #fff;
}

.btn-remove:hover {
  background: #e65252;
}

.cart-summary {
  margin-top: 30px;
  border-top: 2px solid #ddd;
  padding-top: 20px;
}

.customer-info {
  text-align: left;
  margin-bottom: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}

.customer-info h3 {
  margin-bottom: 15px;
  color: #3e2f25;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

.total-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: #8b5e3c;
  margin-bottom: 15px;
  text-align: right;
}

.btn-submit {
  float: right; /* Align button to right */
  padding: 12px 30px;
  font-size: 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  border: none;
}

/* Clear float */
.cart-summary::after {
  content: "";
  display: table;
  clear: both;
}

/* RWD for Cart */
@media (max-width: 600px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-info,
  .cart-item-note {
    width: 100%;
  }

  .btn-remove {
    width: 100%;
  }

  .cart-summary {
    text-align: center;
  }
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.item-qty-display {
  font-size: 0.9em;
  color: #8b5e3c;
}

/* Order Status Popup */
.order-status-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border-radius: 12px;
  padding: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.order-status-popup.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.order-status-title {
  font-weight: bold;
  color: #3e2f25;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4757;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
  }
}

.order-status-msg {
  color: #8b5e3c;
  font-size: 0.95rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5e3c, #c4a484);
  width: 0%;
  transition: width 0.5s ease;
}

/* RWD for Cart Popup */
@media (max-width: 480px) {
  .order-status-popup {
    width: calc(100% - 40px);
    right: 20px;
    bottom: 80px; /* Avoid footer */
  }
}
/* ========================= */
/* 關於我們 (Enhanced) */
/* ========================= */
.about-hero {
  text-align: center;
  margin-bottom: 40px;
}

.about-hero h2 {
  font-size: 2.5rem;
  color: #3e2f25;
  margin-bottom: 10px;
}

.about-hero p {
  color: #666;
  font-size: 1.1rem;
}

.about-section {
  margin-bottom: 60px;
}

.about-section h3 {
  font-size: 1.8rem;
  color: #8b5e3c;
  margin-bottom: 20px;
  border-left: 5px solid #f6b84d;
  padding-left: 15px;
}

.about-section p {
  margin-bottom: 15px;
  text-align: justify;
  line-height: 1.8;
}

.about-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 團隊介紹 */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.team-card {
  background: rgba(255, 255, 255, 0.6);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s;
}

.team-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.team-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 4px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.team-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: #3e2f25;
  margin-bottom: 5px;
}

.team-title {
  color: #8b5e3c;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 10px;
  display: block;
}

.team-desc {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}
