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

/* Color Variables & Theme Tokens - Healthy Herb & Warm Cream Theme */
:root {
  --font-primary: 'Outfit', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  
  /* Soft Healthy Light Palette (Low contrast, eye-friendly) */
  --bg-main: #fcfaf7; /* Soft warm ivory cream background */
  --bg-card: rgba(255, 255, 255, 0.9); /* Pure white with alpha */
  --bg-card-hover: #ffffff;
  --border-glow: rgba(47, 133, 90, 0.08); /* Soft organic green tint */
  --border-glow-active: rgba(47, 133, 90, 0.25); /* Active green tint */
  
  /* Brand Gradients & Accents - Forest Green & Sage & Warm Gold */
  --primary: #2f855a; /* Forest green */
  --secondary: #d69e2e; /* Warm gold / amber */
  --accent: #319795; /* Sage green / teal */
  --accent-glow: rgba(49, 151, 149, 0.08);
  --text-main: #2d3748; /* Soft deep charcoal (easy on the eyes) */
  --text-muted: #718096; /* Warm slate gray */
  
  /* UI Feedback */
  --success: #38a169;
  --error: #e53e3e;
  --warning: #dd6b20;
  
  /* Shadows & Glassmorphism Blur */
  --shadow-sm: 0 2px 4px rgba(47, 133, 90, 0.04), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px -10px rgba(47, 133, 90, 0.1), 0 8px 12px -8px rgba(0, 0, 0, 0.08);
  --glass-blur: blur(12px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-primary);
  font-size: 12pt; /* APA 6th Standard Body Text Font Size */
  line-height: 1.5; /* APA 6th Standard 1.5 Line Height */
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(47, 133, 90, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(214, 158, 46, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(47, 133, 90, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 250, 247, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glow);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(47, 133, 90, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #1e5a3c;
  box-shadow: 0 6px 15px rgba(47, 133, 90, 0.3);
}

.btn-secondary {
  background: rgba(47, 133, 90, 0.04);
  color: var(--primary);
  border: 1px solid rgba(47, 133, 90, 0.15);
}

.btn-secondary:hover {
  background: rgba(47, 133, 90, 0.08);
  border-color: var(--primary);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.5rem;
}

.btn-text:hover {
  color: var(--text-main);
}

/* Badge/Tag */
.badge {
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
}

/* Main Shop Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 32pt; /* Increased from 20pt for premium visual impact */
  font-weight: bold;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: #1b4332; /* Deep forest green */
}

.hero p {
  font-size: 12pt; /* APA 6th Body Font Size */
  color: #4a5568; /* Slate gray */
  margin-bottom: 2rem;
}

/* Dynamic Product Grid */
.container {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 2rem;
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow-active);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
}

/* Simulated Image Placeholder with Gradient */
.product-image {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(22, 28, 36, 0.8), rgba(45, 55, 72, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 3rem;
  position: relative;
}

.product-discount-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #050505;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.product-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.original-price {
  font-size: 0.9rem;
  text-decoration: line-through;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Shopping Cart Sidebar Overlay */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-glow);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

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

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

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(47, 133, 90, 0.03);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(47, 133, 90, 0.06);
}

.cart-item-img {
  width: 50px;
  height: 50px;
  background: rgba(47, 133, 90, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

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

.cart-item-title {
  font-weight: 500;
  font-size: 0.95rem;
}

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

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-item-qty button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-qty button:hover {
  background: var(--primary);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-glow);
  background: rgba(249, 247, 244, 0.9);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  border-top: 1px solid var(--border-glow);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* Modals Overlay (Login, Checkout) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

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

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition-smooth);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-main);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(47, 133, 90, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Payment Selection Radio Group */
.payment-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-option {
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: rgba(255, 255, 255, 0.02);
}

.payment-option input {
  display: none;
}

.payment-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.payment-option.active {
  border-color: var(--primary);
  background: rgba(47, 133, 90, 0.08);
  color: var(--primary);
  font-weight: 600;
}

/* Enterprise Special Verification Form Styles */
.enterprise-card {
  max-width: 480px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.enterprise-logo {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-glow-active);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Simulated Payment Animation Screen */
.payment-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--success);
  margin-bottom: 1.5rem;
  animation: scaleUp 0.3s ease-out forwards;
}

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

@keyframes scaleUp {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* User Account Info Bar */
.user-info-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
  font-size: 0.9rem;
}

.user-points {
  color: var(--accent);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 1.25rem;
  }
  .hero h1 {
    font-size: 22pt;
  }
  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }
  .nav-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
  }
  .nav-actions button, .nav-actions a {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  .container {
    padding: 0 1rem;
  }
  .news-columns-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Latest News Grid Layout */
.news-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.news-column-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.news-column-card h3 {
  font-size: 12pt; /* APA 6th Heading Size */
  font-weight: bold;
  border-left: 3px solid var(--accent);
  padding-left: 0.5rem;
  margin-bottom: 0.25rem;
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Latest News Styles */
.news-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}
.news-item:last-child {
  border-bottom: none;
}
.news-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}
.news-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.news-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.news-tag.promo {
  background: rgba(168, 85, 247, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.news-tag.new-product {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent);
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.news-tag.announcement {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.news-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  flex-grow: 1;
}
.news-title:hover {
  color: var(--accent);
}

/* Star Product Premium Card */
.star-product-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid var(--border-glow-active);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.15);
  backdrop-filter: var(--glass-blur);
}
.star-product-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
  pointer-events: none;
}
.star-product-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.star-product-img {
  font-size: 5rem;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.star-product-info {
  flex-grow: 1;
}
.star-product-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.star-product-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .star-product-card {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding-top: 3.5rem;
  }
  .star-product-badge {
    right: 50%;
    transform: translateX(50%);
  }
}

/* Store Two-Column Layout Grid & Left Banner Ads Sidebar */
.store-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.ad-sidebar {
  position: sticky;
  top: 100px;
}
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur);
}
.sidebar-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.ad-banners-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ad-banner-link {
  text-decoration: none;
  color: inherit;
}
.ad-banner-placeholder {
  background: linear-gradient(135deg, rgba(47, 133, 90, 0.04), rgba(49, 151, 149, 0.04));
  border: 1px dashed rgba(47, 133, 90, 0.15);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition-smooth);
}
.ad-banner-placeholder:hover {
  background: linear-gradient(135deg, rgba(47, 133, 90, 0.08), rgba(49, 151, 149, 0.08));
  border-color: var(--primary);
  transform: translateY(-2px);
}
.ad-banner-placeholder.second {
  background: linear-gradient(135deg, rgba(214, 158, 46, 0.04), rgba(47, 133, 90, 0.04));
  border-color: rgba(214, 158, 46, 0.15);
}
.ad-banner-placeholder.second:hover {
  background: linear-gradient(135deg, rgba(214, 158, 46, 0.08), rgba(47, 133, 90, 0.08));
  border-color: var(--secondary);
  transform: translateY(-2px);
}
.ad-rent-slot {
  background: rgba(0, 0, 0, 0.01);
  border: 1px dashed rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (max-width: 992px) {
  .store-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .ad-sidebar {
    position: static;
    order: 2; /* Move left sidebar to the bottom on mobile/tablet so it doesn't block shopping list */
  }
}
