/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #E8553A;
  --primary-dark: #D4432A;
  --primary-light: #FFF0EC;
  --secondary: #2D6A4F;
  --secondary-light: #E8F5EE;
  --bg: #FAFAF7;
  --bg-gray: #F3F4F6;
  --text-dark: #1F2937;
  --text-mid: #4B5563;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --accent: #F59E0B;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

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

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.logo-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: -2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions a {
  color: var(--text-mid);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.header-actions a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.btn-login {
  border: 1px solid var(--primary) !important;
  color: var(--primary) !important;
}

.btn-register {
  background: var(--primary) !important;
  color: var(--white) !important;
}

.btn-register:hover {
  background: var(--primary-dark) !important;
}

.btn-username {
  font-weight: 600 !important;
  color: var(--text-dark) !important;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-username:hover {
  color: var(--primary) !important;
}

.btn-orders {
  position: relative;
}

.btn-cart {
  position: relative;
}

@media (max-width: 768px) {
  .header-actions {
    gap: 8px;
  }
  .header-actions a {
    padding: 6px 8px;
    font-size: 13px;
  }
  .btn-username {
    max-width: 80px;
  }
}

/* ===== Navigation ===== */
.nav {
  background: var(--white);
  border-top: 1px solid var(--border);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-list li a {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  color: var(--text-mid);
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--primary);
}

.nav-list li a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 1px;
  transition: var(--transition);
}

/* ===== Footer ===== */
.footer {
  background: var(--text-dark);
  color: #9CA3AF;
  padding: 40px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h4 {
  color: var(--white);
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-section p,
.footer-section a {
  font-size: 14px;
  line-height: 2;
  color: #9CA3AF;
}

.footer-section a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #6B7280;
}

.footer-bottom p {
  margin-bottom: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: #245A42;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-mid);
  background: var(--white);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

.card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}

.card-price .unit {
  font-size: 13px;
  font-weight: 400;
}

.card-price .original {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-more {
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-more:hover {
  color: var(--primary);
}

/* ===== Grid ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===== Banner ===== */
.banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.banner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,85,58,0.7) 0%, rgba(0,0,0,0.1) 100%);
  display: flex;
  align-items: center;
  padding: 40px;
}

.banner-text h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.banner-text p {
  font-size: 16px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 20px;
  max-width: 400px;
}

/* ===== Tag ===== */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.tag-hot {
  background: #FEE2E2;
  color: #DC2626;
}

.tag-new {
  background: var(--secondary-light);
  color: var(--secondary);
}

.tag-sale {
  background: #FEF3C7;
  color: #D97706;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,85,58,0.1);
}

.form-input::placeholder {
  color: #9CA3AF;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ===== Page Header ===== */
.page-header {
  background: var(--white);
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  color: var(--border);
}

/* ===== Shop Card ===== */
.shop-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.shop-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.shop-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.shop-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.shop-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.shop-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--secondary-light);
  color: var(--secondary);
  font-size: 12px;
  border-radius: 4px;
  margin-top: 4px;
}

.shop-stats {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.shop-stat {
  text-align: center;
}

.shop-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.shop-stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-tag {
  padding: 4px 10px;
  background: var(--bg-gray);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-mid);
}

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ===== Product Card ===== */
a.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid transparent;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-gray);
}

.product-body {
  padding: 14px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-shop {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.product-price .symbol {
  font-size: 13px;
}

.product-sales {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Join Page ===== */
.join-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  color: var(--white);
  text-align: center;
  margin-bottom: 40px;
}

.join-hero h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.join-hero p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto;
}

.join-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.join-step {
  text-align: center;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.join-step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.join-step h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.join-step p {
  font-size: 14px;
  color: var(--text-light);
}

.join-form-wrapper {
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.join-form-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

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

/* ===== Privacy Page ===== */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 40px;
}

.privacy-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text-dark);
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 12px;
}

.privacy-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.privacy-content ul li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
  position: relative;
  padding-left: 12px;
}

.privacy-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

/* ===== Category Banner ===== */
.category-banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  margin-bottom: 32px;
  height: 240px;
}

.category-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(45,106,79,0.75) 0%, rgba(0,0,0,0.15) 100%);
  display: flex;
  align-items: center;
  padding: 40px;
}

.category-banner-text h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.category-banner-text p {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-content {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  
  .nav-list.open {
    display: flex;
  }
  
  .nav-list li a {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-list li a.active::after {
    display: none;
  }
  
  .nav {
    position: relative;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .banner img {
    height: 200px;
  }
  
  .banner-text h2 {
    font-size: 24px;
  }
  
  .banner-overlay {
    padding: 24px;
  }
  
  .join-steps {
    grid-template-columns: 1fr;
  }
  
  .join-form-wrapper {
    padding: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .header-actions a {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 24px;
  }
  
  .auth-card {
    padding: 24px;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  .join-hero {
    padding: 32px 20px;
  }
  
  .join-hero h2 {
    font-size: 24px;
  }
  
  .privacy-content {
    padding: 24px;
  }
  
  .shop-stats {
    gap: 16px;
  }
  
  .category-banner {
    height: 180px;
  }
}
