*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2d8f6e;
  --primary-dark: #1f6b52;
  --primary-light: #e8f5ef;
  --accent: #f5a623;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --bg: #f8f9fa;
  --white: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --max-width: 1200px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-top { background: var(--primary-dark); color: #fff; font-size: 13px; padding: 6px 0; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top a { opacity: 0.9; transition: opacity 0.2s; }
.header-top a:hover { opacity: 1; }
.header-main { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.logo { font-size: 26px; font-weight: 800; color: var(--primary); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo svg { width: 32px; height: 32px; }
.search-bar { flex: 1; display: flex; max-width: 500px; }
.search-bar input { flex: 1; padding: 10px 16px; border: 2px solid var(--border); border-right: none; border-radius: 8px 0 0 8px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.search-bar input:focus { border-color: var(--primary); }
.search-bar button { background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 0 8px 8px 0; display: flex; align-items: center; transition: background 0.2s; }
.search-bar button:hover { background: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.header-action { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--text-light); position: relative; transition: color 0.2s; }
.header-action:hover { color: var(--primary); }
.header-action svg { width: 24px; height: 24px; }
.cart-badge { position: absolute; top: -6px; right: -8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: none; align-items: center; justify-content: center; padding: 0 4px; }
.nav { border-top: 1px solid var(--border); background: var(--white); }
.nav-list { display: flex; gap: 4px; align-items: center; overflow-x: auto; }
.nav-item { padding: 12px 16px; font-size: 14px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; transition: all 0.2s; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.hero { position: relative; height: 340px; border-radius: 0 0 20px 20px; overflow: hidden; background: linear-gradient(135deg, #1f6b52, #2d8f6e, #3cb371); display: flex; align-items: center; }
.hero::before { content: ''; position: absolute; inset: 0; background: url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?w=1200') center/cover; opacity: 0.15; }
.hero-content { position: relative; z-index: 1; padding: 0 48px; color: #fff; max-width: 560px; }
.hero-content h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; line-height: 1.2; }
.hero-content p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }
.hero-btn { background: var(--accent); color: #fff; padding: 14px 36px; border-radius: 30px; font-size: 16px; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s; display: inline-block; }
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.4); }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.hero-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: background 0.2s; }
.hero-dots span.active { background: #fff; }
.section { padding: 40px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-title { font-size: 22px; font-weight: 700; position: relative; padding-left: 14px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 24px; background: var(--primary); border-radius: 3px; }
.section-link { font-size: 14px; color: var(--primary); font-weight: 500; display: flex; align-items: center; gap: 4px; transition: gap 0.2s; }
.section-link:hover { gap: 8px; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.category-card { background: var(--white); border-radius: var(--radius); padding: 24px 16px; text-align: center; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.category-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.category-icon svg { width: 28px; height: 28px; color: var(--primary); }
.category-card h3 { font-size: 15px; font-weight: 600; }
.category-card p { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.product-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.product-img-wrap { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #f0f0f0; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.discount-tag { position: absolute; top: 8px; right: 8px; background: #e74c3c; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.product-info { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.product-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; min-height: 39px; }
.product-author { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.product-rating { font-size: 13px; display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.star { color: #ddd; }
.star.filled { color: #f5a623; }
.review-count { color: var(--text-light); font-size: 12px; }
.product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.price-now { font-size: 16px; font-weight: 700; color: var(--primary); }
.price-old { font-size: 13px; color: var(--text-light); text-decoration: line-through; }
.btn-add-cart { margin-top: auto; background: var(--primary-light); color: var(--primary); padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s; }
.btn-add-cart:hover { background: var(--primary); color: #fff; }
.promo-banner { background: linear-gradient(135deg, #f5a623, #ff8c42); border-radius: var(--radius); padding: 32px; display: flex; align-items: center; justify-content: space-between; color: #fff; margin: 40px 0; }
.promo-banner h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.promo-banner p { opacity: 0.9; }
.promo-btn { background: #fff; color: #e67e22; padding: 12px 32px; border-radius: 30px; font-weight: 700; font-size: 15px; transition: transform 0.2s; }
.promo-btn:hover { transform: scale(1.05); }
.footer { background: #1a1a2e; color: #b0b0c0; padding: 48px 0 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand .logo { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; font-weight: 600; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; transition: color 0.2s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding: 20px 0; font-size: 13px; }
.social-icons { display: flex; gap: 12px; margin-top: 12px; }
.social-icons a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.social-icons a:hover { background: var(--primary); }
.social-icons svg { width: 18px; height: 18px; }
.listing-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px 0; }
.sidebar { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); height: fit-content; }
.sidebar h3 { font-size: 16px; margin-bottom: 16px; font-weight: 700; }
.filter-group { margin-bottom: 24px; }
.filter-group h4 { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; color: var(--text-light); cursor: pointer; transition: color 0.2s; }
.filter-option:hover { color: var(--primary); }
.filter-option input { accent-color: var(--primary); }
.filter-option.active { color: var(--primary); font-weight: 600; }
.price-range input[type="range"] { width: 100%; accent-color: var(--primary); margin: 8px 0; }
.price-display { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-light); }
.listing-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; background: var(--white); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.listing-toolbar span { font-size: 14px; color: var(--text-light); }
.sort-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; cursor: pointer; }
.detail-layout { display: grid; grid-template-columns: 400px 1fr; gap: 32px; padding: 32px 0; }
.detail-img { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center; }
.detail-img img { max-height: 420px; margin: 0 auto; border-radius: 8px; }
.detail-info h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.detail-author { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.detail-rating { margin-bottom: 16px; }
.detail-price-row { background: var(--primary-light); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; display: flex; align-items: baseline; gap: 12px; }
.detail-price-now { font-size: 28px; font-weight: 800; color: var(--primary); }
.detail-price-old { font-size: 16px; color: var(--text-light); text-decoration: line-through; }
.detail-discount { background: #e74c3c; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.detail-desc { font-size: 14px; color: var(--text-light); line-height: 1.8; margin-bottom: 24px; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 24px; }
.qty-control { display: flex; align-items: center; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-control button { padding: 12px 16px; font-size: 18px; font-weight: 700; transition: background 0.2s; }
.qty-control button:hover { background: var(--primary-light); }
.qty-control span { padding: 0 16px; font-size: 16px; font-weight: 600; min-width: 40px; text-align: center; }
.btn-cart-detail { flex: 1; background: var(--primary); color: #fff; padding: 14px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.2s; }
.btn-cart-detail:hover { background: var(--primary-dark); }
.btn-buy-now { background: var(--accent); color: #fff; padding: 14px 32px; border-radius: 8px; font-size: 15px; font-weight: 600; transition: background 0.2s; }
.btn-buy-now:hover { background: #e0941a; }
.detail-meta { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.detail-meta h3 { font-size: 16px; margin-bottom: 16px; }
.detail-meta li { display: flex; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.detail-meta li span:first-child { color: var(--text-light); min-width: 120px; }
.cart-layout { padding: 32px 0; }
.cart-header-row { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr 40px; gap: 16px; padding: 12px 16px; background: var(--white); border-radius: var(--radius) var(--radius) 0 0; font-size: 13px; font-weight: 600; color: var(--text-light); text-transform: uppercase; }
.cart-item { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr 40px; gap: 16px; padding: 16px; background: var(--white); border-top: 1px solid var(--border); align-items: center; }
.cart-item-img { display: flex; gap: 12px; align-items: center; }
.cart-item-img img { width: 50px; height: 70px; object-fit: cover; border-radius: 4px; }
.cart-item-title { font-size: 14px; font-weight: 600; }
.cart-item-author { font-size: 12px; color: var(--text-light); }
.cart-item-price { font-size: 14px; font-weight: 600; color: var(--primary); }
.cart-qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; width: fit-content; }
.cart-qty button { padding: 4px 10px; font-size: 16px; }
.cart-qty span { padding: 0 12px; font-size: 14px; }
.cart-remove { color: #e74c3c; font-size: 18px; transition: transform 0.2s; }
.cart-remove:hover { transform: scale(1.2); }
.cart-summary { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 24px; display: flex; justify-content: space-between; align-items: center; }
.cart-total { font-size: 20px; font-weight: 700; }
.cart-total span { color: var(--primary); font-size: 24px; }
.btn-checkout { background: var(--accent); color: #fff; padding: 14px 40px; border-radius: 8px; font-size: 16px; font-weight: 600; transition: background 0.2s; }
.btn-checkout:hover { background: #e0941a; }
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state svg { width: 80px; height: 80px; color: var(--border); margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 24px; }
.btn-continue { background: var(--primary); color: #fff; padding: 12px 32px; border-radius: 8px; font-weight: 600; display: inline-block; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--text); color: #fff; padding: 14px 28px; border-radius: 30px; font-size: 14px; font-weight: 500; z-index: 9999; opacity: 0; transition: all 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .detail-layout { grid-template-columns: 320px 1fr; }
}
@media (max-width: 768px) {
  .header-main { flex-wrap: wrap; gap: 12px; }
  .search-bar { order: 3; max-width: 100%; flex: 1 1 100%; }
  .header-actions { gap: 14px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .listing-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-img img { max-height: 320px; }
  .hero { height: 240px; }
  .hero-content { padding: 0 24px; }
  .hero-content h1 { font-size: 24px; }
  .promo-banner { flex-direction: column; text-align: center; gap: 16px; padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-header-row, .cart-item { grid-template-columns: 2fr 1fr 1fr 30px; }
  .cart-item-price:nth-child(3) { display: none; }
  .cart-header-row span:nth-child(3) { display: none; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-list { gap: 0; }
  .nav-item { padding: 10px 10px; font-size: 13px; }
  .detail-actions { flex-direction: column; }
  .cart-summary { flex-direction: column; gap: 16px; text-align: center; }
}
