:root {
  --bg-dark: #17181a;
  --bg-darker: #101112;
  --accent: #e8452e;
  --accent-hover: #d13a25;
  --text-light: #f2f2f2;
  --text-muted: #b7b7b7;
  --border: #2a2b2d;
  --card-bg: #1f2022;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f4f5;
  color: #1c1c1e;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: var(--bg-darker);
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar a { color: var(--text-muted); }

.header {
  background: var(--bg-dark);
  padding: 16px 0;
}
.header .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.logo { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.logo .accent { color: var(--accent); }
.search-form { flex: 1; display: flex; min-width: 220px; }
.search-form input {
  flex: 1; min-width: 0; padding: 10px 14px; border: none; border-radius: 4px 0 0 4px;
  background: #2b2c2e; color: #fff;
}
.search-form button {
  background: var(--accent); color: #fff; border: none; padding: 0 20px;
  border-radius: 0 4px 4px 0; cursor: pointer; font-weight: 600; flex-shrink: 0;
}
.header-actions { display: flex; gap: 20px; color: #fff; font-size: 13px; text-align: center; flex-shrink: 0; }

.nav { background: #202124; }
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-links {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: #ddd; padding: 14px 16px; display: block; font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; border-bottom-color: var(--accent); }
.nav-phone { color: var(--accent); font-weight: 700; white-space: nowrap; padding: 0 16px; flex-shrink: 0; }
.has-dropdown { position: relative; flex-shrink: 0; }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: #26272a;
  min-width: 220px; max-width: 90vw; z-index: 20; box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: block; }
.dropdown a { padding: 10px 16px; border-bottom: 1px solid #333; white-space: normal; }

.hero { background: var(--bg-dark); color: #fff; padding: 48px 0; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--text-muted); max-width: 640px; line-height: 1.6; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 4px; font-weight: 700;
  cursor: pointer; border: none; font-size: 15px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: #fff; border: 1px solid #444; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.feature-card { background: #232427; padding: 16px; border-radius: 6px; }
.feature-card strong { display: block; color: #fff; margin-bottom: 4px; }
.feature-card span { color: var(--text-muted); font-size: 13px; }

.section { padding: 40px 0; }
.section h2 { font-size: 24px; margin-bottom: 20px; }

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cat-card {
  background: #fff; border: 1px solid #e5e5e7; border-radius: 6px; padding: 18px;
  text-align: center; font-weight: 700;
}
.cat-card span { display: block; font-weight: 400; color: #777; margin-top: 4px; font-size: 13px; }
.cat-card:hover { border-color: var(--accent); }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card { background: #fff; border: 1px solid #e5e5e7; border-radius: 6px; overflow: hidden; }
.product-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee; }
.product-card .body { padding: 12px; }
.product-card .tag { font-size: 11px; color: #888; text-transform: uppercase; }
.product-card .title { font-weight: 600; font-size: 14px; margin: 6px 0; min-height: 40px; }
.product-card .price { color: var(--accent); font-weight: 700; font-size: 17px; margin-bottom: 8px; }

.layout-2col { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.filters { background: #fff; border: 1px solid #e5e5e7; border-radius: 6px; padding: 16px; }
.filters h3 { font-size: 13px; text-transform: uppercase; color: #888; margin: 16px 0 8px; }
.filters h3:first-child { margin-top: 0; }
.filters a, .filters label { display: block; padding: 4px 0; font-size: 14px; }
.filters input[type=number] { width: 45%; padding: 6px; border: 1px solid #ddd; border-radius: 4px; }

.product-detail { display: grid; grid-template-columns: 420px 1fr; gap: 32px; background: #fff; padding: 24px; border-radius: 8px; }
.product-detail img.main { width: 100%; border-radius: 6px; background: #eee; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid #ddd; }
.spec-box { background: #f7f7f8; border-radius: 6px; padding: 14px; margin: 12px 0; font-size: 14px; }
.spec-box div { margin-bottom: 4px; }

.cart-table { width: 100%; border-collapse: collapse; background: #fff; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }
.cart-table input[type=number] { width: 60px; padding: 6px; }

.form-box { background: #fff; padding: 24px; border-radius: 8px; max-width: 560px; }
.form-box label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.form-box input, .form-box textarea, .form-box select {
  width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; margin-top: 6px; font-size: 14px;
}
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fde8e6; color: #a3251a; }
.alert-success { background: #e6f7ec; color: #1a7a3c; }

.footer { background: var(--bg-darker); color: var(--text-muted); padding: 40px 0 20px; margin-top: 40px; }
.footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.footer a { color: var(--text-muted); display: block; padding: 3px 0; font-size: 14px; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid #2a2b2d; font-size: 13px; }

.floating-cta {
  position: fixed; right: 20px; bottom: 20px; background: var(--accent); color: #fff;
  padding: 14px 20px; border-radius: 30px; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.3);
  z-index: 30;
}

@media (max-width: 900px) {
  .features, .cat-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-2col, .product-detail { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }

  .topbar { font-size: 12px; }
  .topbar .container { flex-direction: column; gap: 2px; }

  .header { padding: 12px 0; }
  .header .container { gap: 10px; }
  .logo { font-size: 22px; flex: 1 0 auto; }
  .search-form { order: 3; flex: 1 1 100%; min-width: 0; }
  .header-actions { order: 2; gap: 14px; font-size: 12px; }

  .nav-links a { padding: 12px 12px; font-size: 13px; }
  .nav-phone { display: none; }
  .dropdown { left: auto; right: 0; }

  .hero { padding: 28px 0; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .btn { padding: 10px 16px; font-size: 14px; }

  .features, .cat-grid, .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .feature-card { padding: 12px; }
  .section { padding: 24px 0; }
  .section h2 { font-size: 19px; }

  .product-detail { padding: 14px; gap: 14px; }
  .product-card .title { min-height: 0; }

  .cart-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .cart-table th, .cart-table td { padding: 8px 10px; }

  .form-box { padding: 16px; }

  .footer .container { grid-template-columns: 1fr; gap: 20px; text-align: center; }

  .floating-cta { right: 12px; bottom: 12px; padding: 10px 16px; font-size: 14px; }
}
