/* ======= 主題變數 ======= */
:root {
  --bg: #0b0b0b;
  --text: #f2f2f2;
  --muted: #aaa;
  --brand: #d4af37;
  --brand-light: #f5d56e;
  --brand-dark: #b8941f;
  --border: #222;
  --panel: #111;
  --panel-light: #1a1a1a;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --gradient: linear-gradient(135deg, #d4af37 0%, #f5d56e 100%);
  --header-height: 80px;
  --container-width: 1200px;
}

/* ======= 全局重置與基礎樣式 ======= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ======= 捲軸樣式 ======= */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-light);
}

/* ======= 標頭與導航 ======= */
.header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(0, 0, 0, 0.98);
  box-shadow: var(--shadow);
}

.header .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--brand);
  cursor: pointer;
}

.brand-content {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.brand strong {
  font-size: 20px;
  color: var(--brand);
  font-weight: 700;
}

.brand .sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

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

.nav a {
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.nav a:hover {
  color: var(--brand);
  background: rgba(212, 175, 55, 0.1);
}

.nav a.active {
  color: var(--brand);
  background: rgba(212, 175, 55, 0.15);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
}

.nav .badge {
  background: var(--panel);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav .badge:hover {
  background: var(--brand);
  color: #000;
  transform: translateY(-2px);
}

/* ======= 漢堡選單 (Mobile Menu) ======= */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1101;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--panel);
    flex-direction: column;
    padding: 100px 40px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 1300;
    align-items: flex-start;
  }

  .nav.active {
    right: 0;
  }

  .nav a {
    width: 100%;
    padding: 15px 0;
    font-size: 1.2rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a.active::after {
    display: none;
  }
}



/* ======= Mobile Menu Overlay（避免阻擋頁面/與購物車衝突） ======= */
.menu-overlay{
  position: fixed;
  inset: 0;
  /* iOS Safari 對 backdrop-filter 容易把整頁渲染成又暗又糊；手機版直接不用 blur */
  background: rgba(0,0,0,0.35);
  z-index: 1290;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .20s ease, visibility .20s ease;
}
.menu-overlay.show{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* menu 開啟時禁止背景滑動（iOS 也比較穩） */
body.no-scroll{
  overflow: hidden;
  touch-action: none;
}
/* ======= Hero 區域 ======= */
.hero {
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a1a 100%);
  padding: 140px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero .kicker {
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0 0 20px 0;
  background: linear-gradient(135deg, #ffffff 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero p {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ======= 按鈕樣式 ======= */
.btn {
  background: var(--gradient);
  color: #000;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--panel);
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn-outline:hover {
  background: var(--brand);
  color: #000;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* ======= 版面容器 ======= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 800px;
}

/* ======= 卡片樣式 ======= */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border-color: var(--brand);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.card:hover img {
  transform: scale(1.05);
}

.card .body {
  padding: 20px;
}

.card .body h3 {
  font-size: 18px;
  margin: 0 0 8px 0;
  color: var(--text);
  font-weight: 600;
}

.card .body p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.card .price {
  color: var(--brand);
  font-weight: 700;
  font-size: 20px;
  margin: 8px 0;
}

.card .category {
  display: inline-block;
  background: rgba(212, 175, 55, 0.1);
  color: var(--brand);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ======= 網格系統 ======= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

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

.grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.section-title .divider {
  width: 60px;
  height: 3px;
  background: var(--gradient);
  margin: 0 auto;
  border-radius: 2px;
}

.section-title p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 16px auto 0;
}

/* ======= 表單樣式 ======= */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--panel);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

/* ======= 購物車側欄 ======= */
.cart-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100%;
  background: var(--panel);
  box-shadow: -5px 0 30px rgba(0,0,0,0.5);
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1201;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.cart-sidebar.show {
  right: 0;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-overlay.show {
  opacity: 1;
  visibility: visible;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-light);
}

.cart-header h3 {
  color: var(--brand);
  font-size: 1.5rem;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.cart-close:hover {
  color: var(--brand);
  background: rgba(212, 175, 55, 0.1);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.cart-item:hover {
  background: var(--panel-light);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

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

.cart-item-info h4 {
  font-size: 14px;
  margin: 0 0 4px 0;
  color: var(--text);
  font-weight: 600;
}

.cart-item-info .price {
  font-size: 14px;
  color: var(--brand);
  font-weight: 600;
}

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

.quantity-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.quantity-btn:hover {
  background: var(--brand);
  color: #000;
  border-color: var(--brand);
}

.cart-item-quantity {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 18px;
}

.cart-remove:hover {
  background: rgba(231, 76, 60, 0.1);
  transform: scale(1.1);
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--panel-light);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
}

.cart-total .amount {
  color: var(--brand);
  font-size: 24px;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ======= 頁尾 ======= */
footer {
  background: #000;
  color: var(--muted);
  padding: 40px 0 20px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand {
    align-items: center;
    display: flex;
    flex-direction: column;
  }
}


.footer-brand img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.footer-brand h3 {
  color: var(--brand);
  margin-bottom: 8px;
}

.footer-links h4 {
  color: var(--text);
  margin-bottom: 16px;
  font-size: 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* ======= Modal 彈出視窗 ======= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1002;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transition: all 0.3s ease;
  font-size: 20px;
}

.modal-close:hover {
  background: var(--brand);
  color: #000;
}

.modal-inner {
  display: flex;
  flex-wrap: wrap;
  min-height: 400px;
}

.modal-image {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal-image img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
}

.modal-info {
  flex: 1;
  min-width: 300px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-info {
    padding: 20px;
  }
}


.modal-info h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text);
}

.modal-category {
  display: inline-block;
  background: rgba(212, 175, 55, 0.1);
  color: var(--brand);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-description {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-price {
  font-size: 2.5rem;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quantity-selector label {
  margin-bottom: 0;
  font-weight: 600;
}

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

.quantity-controls button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.quantity-controls button:hover {
  background: var(--brand);
  color: #000;
  border-color: var(--brand);
}

.quantity-controls input {
  width: 60px;
  text-align: center;
  margin: 0;
  padding: 8px;
}

/* ======= 提示訊息 ======= */
.toast {
  position: fixed;
  top: 100px;
  right: 20px;
  background: var(--brand);
  color: #000;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 1003;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: #2ecc71;
  color: #000;
}

.toast.error {
  background: #e74c3c;
  color: #fff;
}

.toast.warning {
  background: #f39c12;
  color: #000;
}

/* ======= 載入動畫 ======= */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: var(--brand);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======= 購物車動畫 ======= */
@keyframes cartBounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

.cart-bounce {
  animation: cartBounce 1s ease;
}

/* ======= 商品圖片點擊效果 ======= */
.product-image {
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-image:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

/* ======= 後台管理樣式 ======= */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 20px 0;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--panel-light);
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tr:hover {
  background: var(--panel-light);
}

.admin-table img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.admin-table img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-section {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.admin-tab {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.admin-tab.active {
  background: var(--brand);
  color: #000;
  border-color: var(--brand);
}

.admin-tab:hover:not(.active) {
  background: var(--panel-light);
  border-color: var(--brand);
}

/* ======= 後台訂單管理增強 ======= */
.order-status-select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.quantity-input {
  width: 60px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
}

.status-updated {
  background: rgba(46, 204, 113, 0.1) !important;
  border-left: 4px solid #2ecc71 !important;
}

/* ======= 狀態標籤 ======= */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: #f39c12;
  color: #000;
}

.status-processing {
  background: #3498db;
  color: #fff;
}

.status-completed {
  background: #2ecc71;
  color: #000;
}

.status-cancelled {
  background: #e74c3c;
  color: #fff;
}

.status-confirmed {
  background: #9b59b6;
  color: #fff;
}

.status-shipped {
  background: #34495e;
  color: #fff;
}

/* ======= 響應式設計 ======= */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .nav {
    gap: 4px;
  }
  
  .nav a {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }
  
  .modal-inner {
    flex-direction: column;
  }
  
  .modal-image,
  .modal-info {
    flex: none;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  
  .admin-table {
    font-size: 14px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 12px 8px;
  }
  
  .brand strong {
    font-size: 16px;
  }
  
  .brand .sub {
    font-size: 10px;
  }
  
  .admin-actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .admin-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 120px 20px 60px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .brand strong {
    font-size: 16px;
  }
  
  .brand .sub {
    font-size: 10px;
  }
  
  .nav a {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* ======= 工具類 ======= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ======= 圖片 Lazy Loading ======= */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[data-src].loaded {
  opacity: 1;
}

/* ======= 隱藏前台後台按鈕 ======= */
a[href="admin.html"] {
    display: none !important;
}

.badge[href="admin.html"] {
    display: none !important;
}

#adminBtn {
    display: none !important;
}

.nav a[href="admin.html"] {
    display: none !important;
}

/* ======= 修復：隱藏 input[type=number] 原生上下箭頭 ======= */
.quantity-controls input[type=number]::-webkit-inner-spin-button,
.quantity-controls input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-controls input[type=number] {
    -moz-appearance: textfield;
}

.quantity-controls input[type=number] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 48px;
    height: 48px;
    text-align: center;
    font-size: 18px;
    border-radius: 6px;
    padding: 0;
}

/* =========================================================
   🎯 後台管理 - 狀態顯示增強樣式
   ========================================================= */

/* 狀態標籤樣式 */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.status-new {
    background: #ff4444;
    color: white;
}

.status-processing {
    background: #ffaa00;
    color: white;
}

.status-processed {
    background: #00aa00;
    color: white;
}

.status-default {
    background: #666;
    color: white;
}

/* 統計標籤樣式 */
.stats-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

.stats-badge.new {
    background: #ff4444;
    color: white;
}

.stats-badge.processing {
    background: #ffaa00;
    color: white;
}

.stats-badge.processed {
    background: #00aa00;
    color: white;
}

.stats-badge.total {
    background: #0066cc;
    color: white;
}

/* 卡片樣式增強 */
.admin-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    background: var(--panel);
    transition: all 0.3s ease;
}

.card-processed {
    background: rgba(0, 170, 0, 0.05);
    border-color: #00aa00;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    color: var(--text);
}

.customer-name {
    font-weight: bold;
    color: var(--brand);
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-content {
    line-height: 1.6;
}

/* 網格佈局 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.info-item {
    padding: 8px 0;
}

.info-item strong {
    color: var(--brand);
}

/* 訊息內容區域 */
.notes-section,
.message-section {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid var(--brand);
}

.notes-content,
.message-content {
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.5;
    color: var(--text);
}

/* 時間軸資訊 */
.timeline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}

.timeline strong {
    color: var(--text);
}

/* 檔案連結 */
.file-link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.file-link:hover {
    text-decoration: underline;
}

/* 按鈕樣式增強 */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-success {
    background: #00aa00;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #008800;
    transform: translateY(-1px);
}

.btn-warning {
    background: #ffaa00;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #dd8800;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ff4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    background: inherit;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-actions {
        margin-top: 12px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-badge {
        display: inline-block;
        margin: 4px 4px 4px 0;
    }
    
    .admin-card {
        padding: 16px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 區塊標題統計樣式 */
.admin-section h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 載入狀態 */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    flex-direction: column;
    gap: 16px;
}

.loading-container .loading {
    width: 32px;
    height: 32px;
    border-width: 4px;
}

/* 空狀態提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 卡片懸停效果 */
.admin-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 表單操作按鈕組 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* 圖片預覽 */
#imagePreview {
    margin-top: 12px;
}

#previewImg {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: none;
}

#previewImg:not([src=""]) {
    display: block;
}

/* ======= 信任元素與 CTA 優化樣式 ======= */
.btn-primary {
  padding: 16px 40px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
}

/* 信任徽章 */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.trust-badge svg {
  width: 16px;
  height: 16px;
  fill: var(--brand);
}

/* 信任區塊 */
.trust-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 30px 0;
  padding: 25px;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.trust-item {
  text-align: center;
  padding: 15px;
  transition: transform 0.3s ease;
}

.trust-item:hover {
  transform: translateY(-5px);
}

.trust-item-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.trust-item-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  font-size: 14px;
}

.trust-item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* 快速添加購物車按鈕 */
.quick-add-btn {
  padding: 10px 20px;
  font-size: 14px;
  background: var(--brand);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quick-add-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

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

/* 產品卡片快速操作 */
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.card-actions button,
.card-actions a {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

.card-actions .btn-add {
  background: var(--brand);
  color: #000;
}

.card-actions .btn-add:hover {
  background: var(--brand-light);
}

.card-actions .btn-view {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.card-actions .btn-view:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* 移動端優化 - 更大的點擊區域 */
@media (max-width: 768px) {
  .btn {
    padding: 14px 24px;
    font-size: 15px;
  }

  .btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
  }

  .trust-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
  }

  .card-actions {
    gap: 8px;
  }

  .card-actions button,
  .card-actions a {
    padding: 12px 8px;
    font-size: 12px;
  }
}

/* 產品頁面購買流程指示 */
.purchase-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 30px 0;
  padding: 20px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: var(--radius);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--brand);
  color: #000;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* 產品詳情頁面 - 快速購買區塊 */
.quick-purchase-section {
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  padding: 25px;
  margin: 30px 0;
  position: sticky;
  top: 100px;
  z-index: 50;
}

.quick-purchase-section h3 {
  color: var(--brand);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.quick-purchase-section .price {
  font-size: 28px;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 15px;
}

.quick-purchase-section .btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .quick-purchase-section {
    position: static;
    margin: 20px 0;
  }
}

/* 評價與信任指標 */
.rating-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 15px 0;
  padding: 15px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: 8px;
}

.rating-stars {
  display: flex;
  gap: 4px;
  font-size: 18px;
}

.rating-text {
  font-size: 13px;
  color: var(--muted);
}

.rating-count {
  font-weight: 600;
  color: var(--text);
}

/* 庫存狀態指示 */
.stock-indicator {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.stock-available {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.stock-limited {
  background: rgba(241, 196, 15, 0.1);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.stock-unavailable {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}
/* ============================
   Admin Button System v2
============================ */

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 主按钮（金色） */
.btn-primary {
    background: linear-gradient(135deg, #d4af37, #b9922e);
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e5c75f, #c7a23b);
}

/* 边框按钮 */
.btn-outline {
    background: transparent;
    border: 1px solid #d4af37;
    color: #d4af37;
}

.btn-outline:hover {
    background: #d4af37;
    color: #000;
}

/* 危险按钮 */
.btn-danger {
    background: #d63b3b;
    color: #fff;
}

.btn-danger:hover {
    background: #ff4c4c;
}

/* 小按钮 */
.btn-small {
    padding: 4px 10px;
    font-size: 13px;
}


@media (max-width: 992px){
  /* 讓購物車按鈕在手機上固定在右下角，避免與漢堡重疊 */
  #cartBtn{
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1300;
    border-radius: 999px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  }
  /* 手機側邊選單層級高於 overlay */
  .nav{ z-index: 1400; }
  .menu-toggle{ z-index: 1401; }
}


@media (max-width: 480px){
  .cart-sidebar{
    width: 100%;
    right: -100%;
  }
  .cart-item{
    display: grid;
    grid-template-columns: 56px 1fr auto;
    column-gap: 12px;
    align-items: center;
    padding: 14px 16px;
  }
  .cart-item img{
    width: 56px;
    height: 56px;
    margin-right: 0;
  }
  .cart-item-info{
    min-width: 0;
  }
  .cart-item-info h4{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cart-item-controls{
    gap: 6px;
  }
  .quantity-btn{
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .cart-item-quantity{
    min-width: 22px;
  }
}


/* ======= Cart item layout (mobile-friendly, tidy) ======= */
.cart-item{
  display: grid;
  grid-template-columns: 64px 1fr auto;
  grid-template-areas:
    "img info price"
    "img controls controls";
  gap: 10px 12px;
  align-items: center;
}
.cart-item > img{ grid-area: img; width:64px; height:64px; border-radius:10px; object-fit:cover; }
.cart-item-info{ grid-area: info; min-width:0; }
.cart-item-name{ font-weight:700; font-size:1rem; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-item-meta{ color: var(--muted); font-size:.9rem; margin-top:4px; }
.cart-item-price{ grid-area: price; font-weight:800; color: var(--brand); white-space:nowrap; justify-self:end; }
.cart-item-controls{ grid-area: controls; display:flex; align-items:center; gap:10px; flex-wrap:nowrap; }
.cart-item-quantity{ min-width:26px; text-align:center; font-weight:700; }
.quantity-btn, .remove-btn{
  appearance:none;
  border:none;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 18px;
  font-weight: 800;
  cursor:pointer;
}
.quantity-btn:active, .remove-btn:active{ transform: scale(0.98); }
.remove-btn{
  background: rgba(212,175,55,0.18);
  border: 1px solid rgba(212,175,55,0.45);
}
@media (max-width: 480px){
  .cart-item{
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "img info"
      "img price"
      "img controls";
  }
  .cart-item > img{ width:56px; height:56px; }
  .cart-item-price{ justify-self:start; }
  .cart-item-controls{ gap:8px; }
  .quantity-btn, .remove-btn{ width:36px; height:36px; border-radius:10px; }
}

/* ======= Mobile nav visibility hardening ======= */
@media (max-width: 992px){
  .nav{ right:-110%; }
  .nav.active{ right:0 !important; }
  /* cart button stays as floating FAB on mobile; hide it inside the slide-in menu */
  .nav #cartBtn{ display:none; }
}



/* ======= Mobile clarity fixes: avoid iOS blur/stacking issues ======= */
@media (max-width: 992px){
  /* iOS 上 backdrop-filter 容易造成導覽/遮罩「整頁模糊」或層級錯亂，手機直接關掉 */
  .header{
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(0,0,0,0.98) !important;
  }
  .menu-overlay{
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(0,0,0,0.72) !important;
  }
}

/* ======= Home page compact layout (reduce scrolling) ======= */
.page-home .hero{
  padding: 120px 20px 56px;
}
.page-home .section{
  padding: 56px 0;
}
.page-home .section-title{
  margin-bottom: 28px;
}
.page-home .grid-lg{
  gap: 18px;
}
.page-home .grid-md{
  gap: 14px;
}
.page-home .lead{
  margin-bottom: 18px;
}

@media (max-width: 768px){
  .page-home .hero{
    padding: 104px 16px 44px;
  }
  .page-home .section{
    padding: 36px 0;
  }
  .page-home .section-title{
    margin-bottom: 18px;
  }
  .page-home .section-title h2{
    font-size: 1.85rem;
  }
  .page-home p{
    line-height: 1.55;
  }
  .page-home .btn-row{
    gap: 10px;
    margin-top: 18px;
  }
}



/* ======= Mobile clarity & compactness patch (2026-02-20) ======= */
@media (max-width: 992px){
  /* iOS Safari: avoid heavy blur causing fuzzy/dim menu */
  .header{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0,0,0,0.92) !important;
  }

  #menuOverlay.menu-overlay{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* less dark so page isn't "too dim" */
    background: rgba(0,0,0,0.35) !important;
  }

  /* Make the slide-in nav crisp and readable */
  .nav{
    background: rgba(18,18,18,0.98) !important;
  }
  .nav a{
    color: #fff !important;
    font-weight: 600;
    letter-spacing: .2px;
  }
  .nav a:hover{
    background: rgba(255,255,255,0.06) !important;
  }
  .nav a.active{
    background: rgba(212,175,55,0.18) !important;
  }

  /* Reduce overall scroll length */
  .hero{ padding: 108px 0 42px !important; }
  .hero h1{ font-size: 34px !important; line-height: 1.12 !important; margin-bottom: 12px !important; }
  .hero p{ font-size: 15px !important; margin-bottom: 18px !important; }
  .hero .btn{ padding: 12px 14px !important; font-size: 15px !important; }

  .section{ padding: 44px 0 !important; }
  .section-title{ margin-bottom: 22px !important; }
  .section-title p{ margin-top: 8px !important; }

  .grid{ gap: 12px !important; }
  .card{ border-radius: 14px !important; }
  .card .body{ padding: 14px !important; }
  .card h3{ font-size: 16px !important; margin-bottom: 8px !important; }
  .card p{ font-size: 14px !important; line-height: 1.5 !important; }

  .divider{ margin: 10px auto 0 !important; }
  .mt-4{ margin-top: 14px !important; }
}
@media (max-width: 420px){
  .hero h1{ font-size: 30px !important; }
  .nav{ width: 86% !important; padding: 88px 26px !important; }
}


/* ======= Compact layout (desktop + mobile) - reduce scrolling without changing font sizes ======= */
.hero{ padding: 110px 20px 56px; }
.section{ padding: 56px 0; }
.section .section-header{ margin-bottom: 18px; }
.section .section-title{ margin-bottom: 10px; }
.section .section-subtitle{ margin-bottom: 0; }

.trust-section{ gap: 12px; margin-top: 14px; }
.trust-item{ padding: 14px 14px; }
.trust-badge{ padding: 8px 12px; }

.cards-grid, .features-grid, .services-grid{ gap: 12px; }
.card, .feature-card, .service-card{ padding: 14px; }

.faq-item{ padding: 12px 14px; }
.process-step{ padding: 12px 14px; }

@media (max-width: 768px){
  .hero{ padding: 92px 16px 40px; }
  .section{ padding: 40px 0; }
  .trust-item{ padding: 12px; }
}
