:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.sticky-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 12px 0; flex-wrap: wrap; }
.logo { height: 48px; width: auto; }
.search-form { flex: 1; display: flex; max-width: 500px; }
.search-form input { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px 0 0 8px; font-size: 14px; }
.search-form button { padding: 10px 20px; background: var(--primary); color: #fff; border: none; border-radius: 0 8px 8px 0; cursor: pointer; }
.main-nav { display: flex; gap: 16px; }
.main-nav a { font-weight: 500; color: var(--text); }
.ad-header, .ad-incontent, .ad-footer { text-align: center; margin: 16px 0; min-height: 90px; }

/* Hero */
.hero { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff; padding: 80px 0; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 24px; }
.hero-search { display: flex; max-width: 600px; margin: 0 auto; }
.hero-search input { flex: 1; padding: 14px 20px; border: none; border-radius: 8px 0 0 8px; font-size: 16px; }
.hero-search button { padding: 14px 28px; background: #1e293b; color: #fff; border: none; border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; }

/* Grids */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.cat-card { background: var(--surface); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; transition: transform .2s, box-shadow .2s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.cat-card h3 { margin-bottom: 8px; }
.cat-card span { color: var(--text-dim); font-size: 14px; }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 24px 0; }
.item-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: box-shadow .2s; }
.item-card:hover { box-shadow: var(--shadow); }
.card-img { height: 180px; background: #f1f5f9; position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.no-img { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); }
.badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.7); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.card-body { padding: 16px; }
.card-cats { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.card-body h3 { font-size: 15px; margin-bottom: 10px; line-height: 1.4; }
.card-body h3 a { color: var(--text); }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.card-actions { display: flex; gap: 8px; }
.btn { display: inline-block; padding: 8px 16px; background: var(--primary); color: #fff; border-radius: 6px; font-size: 13px; font-weight: 500; text-align: center; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.subcat-pill { background: var(--surface); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.subcat-pill:hover { background: var(--primary); color: #fff; text-decoration: none; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 32px 0; }
.pagination a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.page-header { margin: 32px 0 16px; }
.page-header h1 { font-size: 1.8rem; }
.search-form.large { max-width: 700px; margin: 20px 0; }

.item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 32px 0; }
.item-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.item-info h1 { font-size: 1.8rem; margin: 12px 0; }
.meta { display: flex; gap: 20px; color: var(--text-dim); margin: 12px 0; font-size: 14px; }
.description { margin: 16px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.tag { background: #f1f5f9; padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.actions { display: flex; gap: 12px; margin-top: 20px; }
.no-results { text-align: center; padding: 40px; color: var(--text-dim); }

/* Footer */
.site-footer { background: #1e293b; color: #cbd5e1; margin-top: 60px; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-logo { height: 40px; margin-bottom: 12px; filter: brightness(0) invert(1); }
.footer-col h4 { color: #fff; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 20px; text-align: center; font-size: 14px; }

@media (max-width: 768px) {
  .item-detail { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: stretch; }
  .hero h1 { font-size: 1.8rem; }
  .hero-search { flex-direction: column; }
  .hero-search input, .hero-search button { border-radius: 8px; }
}
