:root {
  --navy: #0a2540;
  --navy-light: #15385c;
  --blue: #0066cc;
  --orange: #ff6b00;
  --orange-hover: #e55e00;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a202c;
  --muted: #5a6678;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(10, 37, 64, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1260px; margin: 0 auto; padding: 0 16px; }

/* Idealo-style Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(10, 37, 64, 0.06);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 800; color: var(--navy); white-space: nowrap; }
.brand-badge { background: var(--orange); color: #fff; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; }

/* Central Search + Live Autocomplete (z-index: 9999) */
.header-search-wrap { position: relative; flex: 1; max-width: 600px; }
.search-box {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2px 4px 2px 12px;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--blue); background: #fff; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 0.95rem; padding: 8px 6px; color: var(--text); }
.clear-btn { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 0 8px; }
.search-submit { background: var(--orange); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.search-submit:hover { background: var(--orange-hover); }

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(10, 37, 64, 0.18);
  z-index: 9999;
  max-height: 420px;
  overflow-y: auto;
}
.autocomplete-dropdown[hidden] { display: none; }
.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.ac-item:hover { background: #f8fafc; }
.ac-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.ac-info { flex: 1; min-width: 0; }
.ac-title { font-weight: 600; font-size: 0.9rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-cat { font-size: 0.78rem; color: var(--muted); }
.ac-price { font-weight: 800; color: var(--orange); font-size: 0.92rem; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 14px; font-size: 0.86rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.header-actions a:hover { color: var(--orange); }
.fav-count { background: var(--orange); color: #fff; font-size: 0.72rem; padding: 1px 6px; border-radius: 999px; margin-left: 2px; }

/* Horizontal Scrollable Category Bar */
.cat-bar-wrap { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.cat-bar-inner { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.cat-scroll-btn { background: #f1f5f9; border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-weight: 700; color: var(--navy); flex-shrink: 0; }
.cat-bar { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; flex: 1; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  cursor: pointer;
}
.cat-chip.active, .cat-chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* AdSense CLS = 0 */
.ad-section { margin: 16px auto; }
.ad-slot { background: #edf2f7; border: 1px dashed #cbd5e1; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; }
.ad-leaderboard { min-height: 90px; }
.ad-rectangle { min-height: 250px; }

/* Section Headers & 4-Column Grid */
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 0 14px; }
.section-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--navy); min-width: 0; }
.products-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10, 37, 64, 0.1); }
.product-img-wrap { position: relative; border-radius: 8px; overflow: hidden; background: #ffffff; border: 1px solid #f1f5f9; }
.product-img-wrap img { width: 100%; height: 180px; object-fit: contain; background: #ffffff; padding: 12px; display: block; }
.discount-badge { position: absolute; top: 8px; left: 8px; background: #dc2626; color: #fff; font-size: 0.74rem; font-weight: 800; padding: 3px 7px; border-radius: 4px; }
.fav-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.92); border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 0.95rem; }
.product-cat { font-size: 0.72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; }
.product-title { font-size: 0.96rem; font-weight: 700; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rating-row { font-size: 0.8rem; color: #f59e0b; font-weight: 700; }
.rating-row span { color: var(--muted); font-weight: 500; }
.price-from { font-size: 0.75rem; color: var(--muted); }
.price-best { font-size: 1.35rem; font-weight: 800; color: var(--orange); }
.price-old { font-size: 0.84rem; color: var(--muted); text-decoration: line-through; margin-left: 6px; }
.btn-store { display: inline-block; background: var(--orange); color: #fff !important; font-weight: 700; font-size: 0.84rem; padding: 8px 12px; border-radius: 6px; text-align: center; }
.btn-store:hover { background: var(--orange-hover); }
.btn-blue { background: var(--blue); color: #fff; border: none; border-radius: 6px; padding: 8px 12px; font-weight: 600; cursor: pointer; font-size: 0.84rem; text-align: center; }

/* Live Search Panel */
.universal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 18px 0; box-shadow: var(--shadow); }
.badge-live { display: inline-block; background: #dcfce7; color: #166534; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; margin-bottom: 6px; }
.offer-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.88rem; }
.offer-table th, .offer-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.offer-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

/* Footer */
.site-footer { background: var(--navy); color: #cbd5e1; padding: 36px 0 24px; margin-top: 48px; font-size: 0.88rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 24px; }
.footer-grid h4 { color: #fff; margin-bottom: 10px; }
.footer-grid a { display: block; padding: 3px 0; color: #cbd5e1; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 16px; text-align: center; font-size: 0.82rem; }

@media (max-width: 1024px) { .products-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .products-grid-4 { grid-template-columns: 1fr; }
  .header-actions { display: none; }
}
