:root {
  --primary: #232f3e;
  --primary-light: #37475a;
  --accent: #febd69;
  --accent-hover: #f3a847;
  --accent-dark: #cd8c00;
  --bg: #eaeded;
  --white: #fff;
  --text: #0f1111;
  --text-secondary: #565959;
  --star: #de7921;
  --border: #ddd;
  --success: #067d62;
  --danger: #c40000;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Amazon Ember', Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.4; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; }

/* Header */
.header { background: var(--primary); padding: 8px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 1000; }
.logo { color: var(--white); font-size: 24px; font-weight: 700; letter-spacing: -0.5px; white-space: nowrap; }
.logo span { color: var(--accent); }
.search-bar { flex: 1; display: flex; max-width: 700px; }
.search-bar select { padding: 10px 8px; background: var(--bg); border: none; font-size: 12px; border-radius: 4px 0 0 4px; color: var(--text); }
.search-bar input { flex: 1; padding: 10px 14px; border: none; font-size: 15px; outline: none; min-width: 0; }
.search-bar button { padding: 10px 16px; background: var(--accent); border-radius: 0 4px 4px 0; font-size: 18px; }
.search-bar button:hover { background: var(--accent-hover); }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: var(--white); font-size: 13px; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); }

/* Sub nav */
.subnav { background: var(--primary-light); padding: 6px 16px; display: flex; gap: 16px; overflow-x: auto; }
.subnav a { color: var(--white); font-size: 13px; white-space: nowrap; padding: 4px 0; }
.subnav a:hover { color: var(--accent); }

/* Hero Banner */
.hero { position: relative; height: 400px; overflow: hidden; background: linear-gradient(135deg, #1a365d 0%, #2a4365 50%, #232f3e 100%); }
.hero-content { max-width: 1200px; margin: 0 auto; padding: 60px 24px; color: white; position: relative; z-index: 2; }
.hero h1 { font-size: 42px; margin-bottom: 12px; font-weight: 700; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 24px; max-width: 500px; }
.hero-cta { display: inline-block; background: var(--accent); color: var(--text); padding: 14px 32px; border-radius: 8px; font-weight: 600; font-size: 16px; }
.hero-cta:hover { background: var(--accent-hover); }
.hero-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 200px; background: linear-gradient(transparent, var(--bg)); }

/* Section */
.section { max-width: 1200px; margin: 0 auto; padding: 24px; }
.section-title { font-size: 21px; font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; }
.section-title a { color: #007185; font-size: 14px; margin-left: 12px; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--white); border-radius: 4px; padding: 16px; transition: box-shadow 0.2s; position: relative; }
.product-card:hover { box-shadow: var(--shadow); }
.product-card .img-wrap { height: 200px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden; background: #f7f7f7; border-radius: 4px; }
.product-card img { max-height: 200px; object-fit: contain; }
.product-card .title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; line-height: 1.3; }
.product-card .title:hover { color: #c40000; }
.product-card .price { font-size: 21px; font-weight: 700; color: var(--text); }
.product-card .price .symbol { font-size: 13px; vertical-align: top; line-height: 28px; }
.product-card .price .cents { font-size: 13px; vertical-align: top; line-height: 28px; }
.product-card .compare-price { font-size: 13px; color: var(--text-secondary); text-decoration: line-through; margin-left: 8px; }
.product-card .rating { color: var(--star); font-size: 14px; margin: 4px 0; }
.product-card .rating .count { color: #007185; font-size: 12px; }
.product-card .store { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.product-card .badge { position: absolute; top: 8px; left: 8px; background: var(--danger); color: white; font-size: 11px; padding: 2px 8px; border-radius: 2px; font-weight: 600; }

/* Category cards */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card { background: var(--white); border-radius: 8px; padding: 20px; text-align: center; transition: box-shadow 0.2s; }
.category-card:hover { box-shadow: var(--shadow); }
.category-card .icon { font-size: 36px; margin-bottom: 8px; }
.category-card .name { font-size: 14px; font-weight: 600; }
.category-card .count { font-size: 12px; color: var(--text-secondary); }

/* Product Detail */
.product-detail { max-width: 1200px; margin: 0 auto; padding: 24px; }
.pd-main { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: white; padding: 32px; border-radius: 8px; }
.pd-images .main-img { width: 100%; max-height: 500px; object-fit: contain; border-radius: 8px; margin-bottom: 12px; background: #f7f7f7; }
.pd-images .thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-images .thumbs img { width: 60px; height: 60px; object-fit: contain; border: 2px solid transparent; border-radius: 4px; cursor: pointer; background: #f7f7f7; padding: 4px; }
.pd-images .thumbs img:hover, .pd-images .thumbs img.active { border-color: var(--accent); }
.pd-info .pd-title { font-size: 24px; font-weight: 400; margin-bottom: 8px; }
.pd-info .pd-rating { color: var(--star); margin-bottom: 12px; }
.pd-info .pd-rating .count { color: #007185; font-size: 13px; }
.pd-info .pd-price { font-size: 28px; font-weight: 700; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.pd-info .pd-price .compare { font-size: 16px; color: var(--text-secondary); text-decoration: line-through; margin-left: 12px; font-weight: 400; }
.pd-info .pd-desc { margin-bottom: 20px; color: var(--text-secondary); line-height: 1.6; }
.pd-info .pd-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.pd-info .pd-meta a { color: #007185; }
.pd-info .buy-btn { display: inline-block; background: linear-gradient(to bottom, #f7dfa5, #f0c14b); border: 1px solid #a88734; border-radius: 8px; padding: 12px 40px; font-size: 15px; font-weight: 600; color: var(--text); margin-top: 16px; }
.pd-info .buy-btn:hover { background: linear-gradient(to bottom, #f0c14b, #e7a82b); }

/* Search Results */
.search-page { max-width: 1200px; margin: 0 auto; padding: 24px; }
.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.search-header .count { color: var(--text-secondary); font-size: 14px; }
.search-header select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.filters { background: white; padding: 16px; border-radius: 4px; margin-bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.filters label { font-size: 13px; color: var(--text-secondary); }
.filters input, .filters select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.pagination button { padding: 8px 14px; background: white; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.pagination button.active { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pagination button:disabled { opacity: 0.5; }

/* Footer */
.footer { background: var(--primary); color: var(--white); padding: 32px 24px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.footer h4 { margin-bottom: 12px; font-size: 15px; }
.footer a { color: #ddd; font-size: 13px; display: block; padding: 3px 0; }
.footer a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--primary-light); font-size: 12px; color: #999; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-secondary); font-size: 16px; }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; height: 200px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Responsive */
@media (max-width: 768px) {
  .header { flex-wrap: wrap; gap: 8px; }
  .search-bar { order: 3; flex-basis: 100%; }
  .nav-links { display: none; }
  .hero { height: 300px; }
  .hero h1 { font-size: 28px; }
  .pd-main { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card { padding: 10px; }
  .product-card .img-wrap { height: 140px; }
}
