/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1a1a1a;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Promo bar */
.promo-bar {
  background: #1a1a2e;
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.logo span { color: #ff6b35; }
.search-box {
  flex: 1;
  display: flex;
  max-width: 520px;
}
.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 0.95rem;
  outline: none;
}
.search-box input:focus { border-color: #ff6b35; }
.search-box button {
  padding: 10px 18px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  cursor: pointer;
}
.search-box button:hover { background: #e55a2b; }
.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.icon-btn {
  font-size: 1.3rem;
  position: relative;
}
.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #ff6b35;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category nav */
.cat-nav {
  background: #fff;
  border-bottom: 1px solid #eee;
}
.cat-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.cat-link {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.cat-link:hover,
.cat-link.active {
  color: #ff6b35;
  border-bottom-color: #ff6b35;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 50%, #ffb347 100%);
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}
.hero-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.hero-content p {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 20px;
}
.btn-primary {
  display: inline-block;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.15s;
}
.btn-primary:hover { transform: scale(1.03); }

/* Sections */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}
.timer {
  background: #1a1a2e;
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Flash deals */
.flash-deals {
  max-width: 1200px;
  margin: 28px auto 0;
  padding: 0 20px;
}
.deals-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.deal-card {
  min-width: 160px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.deal-card .img-wrap {
  height: 140px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.deal-card .info {
  padding: 10px;
}
.deal-card .price {
  font-weight: 800;
  color: #e63946;
  font-size: 1.05rem;
}
.deal-card .old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.8rem;
  margin-left: 6px;
}
.deal-card .badge {
  display: inline-block;
  background: #e63946;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Product grid */
.products-section {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
}
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.sort-controls select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.product-card .img-wrap {
  height: 180px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}
.product-card .discount-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e63946;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}
.product-card .info {
  padding: 12px;
}
.product-card .title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.product-card .price {
  font-weight: 800;
  color: #e63946;
  font-size: 1.1rem;
}
.product-card .old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.8rem;
}
.product-card .rating {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}
.product-card .add-btn {
  width: 100%;
  padding: 8px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.product-card .add-btn:hover { background: #e55a2b; }
.product-card .add-btn.added {
  background: #2a9d8f;
}

/* Footer */
.footer {
  background: #1a1a2e;
  color: #ccc;
  margin-top: 48px;
  padding: 40px 20px 20px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
}
.footer-col h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 1rem;
}
.footer-col a {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #aaa;
}
.footer-col a:hover { color: #ff6b35; }
.footer-col p { font-size: 0.9rem; color: #aaa; }
.footer-bottom {
  max-width: 1200px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid #333;
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}

/* Responsive */
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .hero-content h1 { font-size: 1.7rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card .img-wrap { height: 140px; font-size: 2.2rem; }
}
