@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;700;900&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* --- 變數系統 --- */
:root {
  --primary: #2d5a27;       /* 深森林綠，代表水稻葉 */
  --primary-hover: #1e3f1a;
  --primary-light: rgba(45, 90, 39, 0.08);
  --secondary: #c6a052;     /* 金黃稻穗色 */
  --secondary-hover: #aa853c;
  --secondary-light: #fdfaf2;
  --accent: #d9534f;        /* 警示紅，用於刪除或特價 */
  --bg-primary: #fcfbfa;    /* 暖米白 */
  --bg-secondary: #f4efeb;  /* 柔砂色 */
  --card-bg: #ffffff;
  --text-dark: #2c2927;     /* 深木炭黑 */
  --text-muted: #79716b;    /* 灰褐 */
  --border-color: #e6dfd9;
  
  --shadow-sm: 0 4px 12px rgba(45, 90, 39, 0.04);
  --shadow-md: 0 10px 30px rgba(45, 90, 39, 0.08);
  --shadow-lg: 0 20px 50px rgba(45, 90, 39, 0.15);
  
  --font-serif: 'Noto Serif TC', 'Playfair Display', serif;
  --font-sans: 'Noto Sans TC', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --sidebar-width: 420px;
}

/* --- 基礎設定 --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* --- 網頁捲軸自訂 --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* --- 排版與基本元件 --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
  border: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white, #fff);
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 90, 39, 0.3);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(198, 160, 82, 0.2);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 160, 82, 0.3);
}

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

.btn-outline:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-danger:hover {
  background-color: rgba(217, 83, 79, 0.08);
  color: #c9302c;
}

/* --- 導覽列 Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(252, 251, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  cursor: pointer;
}

.logo span {
  color: var(--secondary);
}

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

.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
  background: var(--bg-secondary);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.cart-icon-wrapper:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- 主畫面內容 --- */
.main-content {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  transition: var(--transition);
}

/* 賣家模式與前台模式切換隱藏 */
body.admin-mode .store-view {
  display: none;
}

body:not(.admin-mode) .admin-view {
  display: none;
}

/* --- 顧客前台 (Store View) --- */

/* Hero 區塊 */
.hero {
  position: relative;
  padding: 80px 5% 100px 5%;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #f7f1eb 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -20%;
  width: 500px;
  height: 500px;
  background-radial-gradient: circle, rgba(198, 160, 82, 0.08) 0%, transparent 70%;
  z-index: 1;
}

.hero-text {
  max-width: 550px;
  z-index: 2;
}

.hero-tagline {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 15px;
}

.hero h1 {
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 35px;
}

.hero-image-container {
  width: 45%;
  position: relative;
  z-index: 2;
}

.hero-image-card {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  transition: var(--transition);
}

.hero-image-card:hover {
  transform: rotate(0deg) scale(1.02);
}

.hero-image-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* 篩選與搜尋 */
.filter-search-section {
  padding: 40px 5% 20px 5%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .filter-search-section {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.search-bar {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.categories-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 30px;
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}

.category-tab:hover {
  background-color: var(--border-color);
}

.category-tab.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(45, 90, 39, 0.15);
}

/* 商品展示 */
.products-section {
  padding: 20px 5% 80px 5%;
}

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

.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary-light);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.08);
}

.product-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-origin {
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7rem;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--bg-secondary);
}

.product-price-spec {
  display: flex;
  flex-direction: column;
}

.product-spec {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-serif);
}

.product-price::before {
  content: "$";
  font-size: 0.95rem;
  margin-right: 2px;
}

.add-to-cart-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* 購物車抽屜 Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-left: 1px solid var(--border-color);
}

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

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

.close-cart-btn {
  background: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.close-cart-btn:hover {
  color: var(--text-dark);
  transform: scale(1.1);
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-empty-message {
  text-align: center;
  color: var(--text-muted);
  margin-top: 80px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--bg-secondary);
  align-items: center;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-secondary);
}

.cart-item-detail {
  flex-grow: 1;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 700;
}

.cart-item-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--border-color);
}

.qty-num {
  font-size: 0.9rem;
  min-width: 15px;
  text-align: center;
}

.remove-cart-item-btn {
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 10px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.remove-cart-item-btn:hover {
  color: var(--accent);
}

.cart-footer {
  padding: 24px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: 700;
}

.checkout-btn {
  width: 100%;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- 賣家後台管理 (Admin View) --- */

.admin-header-bar {
  background: linear-gradient(135deg, #1e3f1a 0%, var(--primary) 100%);
  color: white;
  padding: 40px 5%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .admin-header-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.admin-title-desc h2 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 5px;
}

.admin-title-desc p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* 儀表板數據 */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 30px 5%;
  margin-top: -30px;
  z-index: 10;
  position: relative;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-serif);
}

/* 後台主排版：新增商品 + 商品列表 */
.admin-main-layout {
  padding: 20px 5% 80px 5%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 1024px) {
  .admin-main-layout {
    grid-template-columns: 350px 1fr;
  }
}

.admin-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 25px;
}

.admin-card-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 新增商品表單 */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background-color: white;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.file-upload-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: var(--bg-primary);
  transition: var(--transition);
  overflow: hidden;
}

.file-upload-wrapper:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
}

.file-upload-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.btn-submit {
  width: 100%;
  margin-top: 10px;
}

/* 定價管理表格 */
.pricing-table-container {
  overflow-x: auto;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.pricing-table th, 
.pricing-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.pricing-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  background-color: var(--bg-secondary);
}

.pricing-table tr:hover {
  background-color: rgba(240, 234, 225, 0.3);
}

.table-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-secondary);
}

.table-product-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.table-product-origin {
  font-size: 0.75rem;
  color: var(--secondary);
}

.price-input-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 130px;
}

.price-input-currency {
  font-weight: 700;
  color: var(--primary);
}

.price-edit-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  transition: var(--transition);
}

.price-edit-input:focus {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: #2b2a28;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  10%, 90% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

/* --- 彈窗 Modal 系統 --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  position: relative;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-dark);
  transform: scale(1.1);
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  border-bottom: 1.5px solid var(--bg-secondary);
  padding-bottom: 10px;
}

/* 結帳明細框 */
.checkout-summary-box {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.summary-row:last-child {
  margin-bottom: 0;
}

.summary-row.grand-total {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1.5px dashed var(--border-color);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* --- 收據專用樣式 --- */
.receipt-card {
  max-width: 480px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 35px 30px;
}

.receipt-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(92, 184, 92, 0.1);
  color: #5cb85c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 15px auto;
}

.receipt-divider {
  text-align: center;
  position: relative;
  margin: 25px 0;
}

.receipt-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  z-index: 1;
}

.receipt-divider span {
  position: relative;
  z-index: 2;
  background-color: #fff;
  padding: 0 15px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 4px;
}

.receipt-details {
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.receipt-detail-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.receipt-detail-row:last-child {
  margin-bottom: 0;
}

.r-label {
  color: var(--text-muted);
  width: 90px;
  flex-shrink: 0;
}

.r-value {
  color: var(--text-dark);
  font-weight: 500;
}

.receipt-items-list {
  max-height: 150px;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  margin-bottom: 20px;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.receipt-item-row:last-child {
  margin-bottom: 0;
}

.receipt-total-box {
  padding: 0 5px;
  margin-bottom: 25px;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.receipt-total-row.receipt-grand-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--border-color);
}

.receipt-actions {
  display: flex;
  gap: 15px;
}

/* --- 訂單狀態標籤 Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.status-shipped {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.status-completed {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-cancelled {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* --- 7-11 門市卡片選取器樣式 --- */
.store-list-container::-webkit-scrollbar {
  width: 6px;
}
.store-list-container::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
.store-list-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.store-card {
  background-color: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.store-card:hover {
  border-color: #e05e00;
  background-color: rgba(224, 94, 0, 0.02);
}

.store-card.selected {
  border-color: #e05e00;
  background-color: #fff6f0;
  box-shadow: 0 4px 12px rgba(224, 94, 0, 0.08);
}

.store-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.store-id-badge {
  background-color: #e05e00;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: monospace;
}

.store-address {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.store-card-check {
  font-size: 1.25rem;
  color: #e05e00;
  opacity: 0;
  transition: var(--transition);
}

.store-card.selected .store-card-check {
  opacity: 1;
}

/* 響應式微調 */
@media (max-width: 767px) {
  .hero {
    flex-direction: column;
    padding: 60px 5% 60px 5%;
    gap: 40px;
    text-align: center;
  }
  .hero-text {
    max-width: 100%;
  }
  .hero h2 {
    font-size: 2.2rem;
  }
  .hero-image-container {
    width: 80%;
  }
  .cart-sidebar {
    width: 100vw;
    right: -100vw;
  }
  .pricing-table th:nth-child(4),
  .pricing-table td:nth-child(4) {
    display: none; /* 手機端隱藏類別 */
  }
}

/* --- 訂單管理擴充樣式 --- */
.edit-order-btn {
  border-color: var(--secondary) !important;
  color: var(--secondary) !important;
  background-color: transparent;
  transition: var(--transition);
}

.edit-order-btn:hover {
  background-color: var(--secondary-light) !important;
  transform: translateY(-1px);
}

.delete-order-btn {
  transition: var(--transition);
}

.delete-order-btn:hover {
  background-color: rgba(219, 68, 85, 0.08) !important;
  transform: translateY(-1px);
}

#export-orders-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  transition: var(--transition);
}

#export-orders-btn:hover {
  background-color: var(--primary);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(45, 90, 39, 0.15);
}

/* 編輯 Modal 內的 7-11 門市詳細資訊細節 */
#edit-selected-store-details {
  border-left: 4px solid #e05e00;
  background-color: var(--bg-secondary);
}

/* ==================== 13. Google 登入與下拉選單樣式 ==================== */
#auth-status-container {
  display: flex;
  align-items: center;
}

#google-signin-btn-container {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.user-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 30px;
  background-color: var(--card-bg);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.dropdown-trigger:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.user-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.user-display-name-txt {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 170px;
  display: none;
  flex-direction: column;
  padding: 6px 0;
  z-index: 200;
  animation: fadeInScale 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.user-dropdown.open .dropdown-menu-list {
  display: flex;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item-btn {
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.dropdown-item-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--primary);
}

.dropdown-item-btn.logout-btn:hover {
  color: var(--accent);
  background-color: #fff2f1;
}

/* ==================== 14. 我的訂單列表樣式 ==================== */
.my-orders-list-wrapper {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 5px;
}

.my-order-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.my-order-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.my-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
}

.my-order-id {
  font-family: monospace;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.my-order-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.my-order-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.my-order-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.my-order-summary {
  font-size: 0.85rem;
  color: var(--text-dark);
}

.my-order-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.my-order-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.my-orders-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

