/* HelmetsPedia - Dark Theme Styles */
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --bg-glass: rgba(255,255,255,0.05);
  --accent: #ff4d4d;
  --accent-dark: #cc3d3d;
  --text: #ffffff;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: rgba(255,255,255,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ───────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.logo span { color: var(--accent); }

.search-box { flex: 1; max-width: 520px; position: relative; margin: 0 auto; }
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.search-box input:focus { border-color: var(--accent); background: rgba(255,255,255,0.12); }
.search-box input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none; font-size: 1rem;
}

.lang-switcher {
  display: flex; gap: 4px; background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); padding: 3px; flex-shrink: 0;
}
.lang-btn {
  padding: 7px 14px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; border-radius: 6px;
  font-size: 0.85rem; font-weight: 600; transition: all 0.3s ease;
}
.lang-btn.active { background: var(--accent); color: var(--text); }
.lang-btn:hover:not(.active) { color: var(--text); }

/* ─── CONTENT LAYOUT ───────────────────────────── */
.content-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ─── SIDEBAR FILTERS ──────────────────────────── */
.sidebar-filters {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  overflow-y: auto;
  padding: 0;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.sidebar-filters::-webkit-scrollbar { width: 4px; }
.sidebar-filters::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.filter-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.filter-group {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.filter-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Filter checkboxes */
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.filter-check:hover { color: var(--text); }

.filter-check input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.filter-check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.filter-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-check .filter-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 8px;
}

/* Scrollable filter list */
.filter-scroll {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-dim) transparent;
}

.filter-scroll::-webkit-scrollbar { width: 3px; }
.filter-scroll::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 2px; }

/* Mini search inside brand filter */
.filter-search-mini {
  margin-bottom: 8px;
}

.filter-search-mini input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
}

.filter-search-mini input:focus { border-color: var(--accent); }
.filter-search-mini input::placeholder { color: var(--text-dim); }

/* Rating filter */
.rating-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rating-btn {
  padding: 5px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rating-btn:hover { border-color: var(--text-muted); color: var(--text-muted); }

.rating-btn.active {
  background: rgba(255,193,7,0.15);
  border-color: #ffc107;
  color: #ffc107;
}

/* Clear filters */
.btn-clear-filters {
  display: block;
  width: calc(100% - 32px);
  margin: 16px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-filters:hover { border-color: var(--accent); color: var(--accent); }

/* ─── MAIN AREA ────────────────────────────────── */
.main-area {
  flex: 1;
  padding: 24px 32px;
  min-width: 0;
}

.results-info {
  padding: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.helmets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* ─── HELMET CARD ──────────────────────────────── */
.helmet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.helmet-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(255,77,77,0.1);
}

.card-image {
  width: 100%; height: 200px; background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}

.card-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-image .placeholder-icon { color: var(--text-dim); font-size: 3.5rem; opacity: 0.3; }

.card-type-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; background: rgba(0,0,0,0.7);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.card-country-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; background: rgba(0,0,0,0.7);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.65rem; color: var(--text-dim);
}

.card-body { padding: 16px; }
.card-brand {
  font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}
.card-model { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.card-desc {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 12px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-price { font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.card-rating { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: #ffc107; }
.card-rating .star { font-size: 0.9rem; }

/* ─── MODAL ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  z-index: 1000; display: none; align-items: center;
  justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 700px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative;
}

.modal-close {
  position: absolute; top: 12px; right: 16px; background: none;
  border: none; color: var(--text-muted); font-size: 1.5rem;
  cursor: pointer; z-index: 10; transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-image {
  width: 100%; height: 250px; background: #111;
  display: flex; align-items: center; justify-content: center;
}
.modal-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-image .placeholder-icon { font-size: 5rem; opacity: 0.2; color: var(--text-dim); }

.modal-body { padding: 24px; }
.modal-brand { font-size: 0.8rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.modal-model { font-size: 1.5rem; font-weight: 700; margin: 4px 0 12px; }

.modal-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.modal-meta-item {
  padding: 4px 12px; background: rgba(255,255,255,0.06);
  border-radius: 16px; font-size: 0.8rem; color: var(--text-muted);
}

.modal-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }

.modal-features h4 { font-size: 0.9rem; margin-bottom: 10px; color: var(--text); }
.modal-features ul { list-style: none; padding: 0; }
.modal-features li {
  padding: 6px 0; padding-left: 20px; position: relative;
  font-size: 0.9rem; color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.modal-features li::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 8px; height: 8px; background: var(--accent);
  border-radius: 50%; transform: translateY(-50%);
}

/* ─── LOADING & EMPTY ──────────────────────────── */
.loading-state, .empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  grid-column: 1 / -1;
}
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }

/* ─── FOOTER ───────────────────────────────────── */
footer {
  text-align: center; padding: 20px; color: var(--text-dim);
  font-size: 0.85rem; border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ───────────────────────────────── */
@media (max-width: 900px) {
  .sidebar-filters {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 500;
    transition: left 0.3s ease;
    width: 280px;
    padding-top: 0;
  }

  .sidebar-filters.open { left: 0; }

  .filter-toggle { display: block; }

  .content-layout { display: block; }

  .main-area { padding: 16px; }

  .helmets-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 768px) {
  header { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .logo { font-size: 1.2rem; }
  .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
  .modal { max-height: 95vh; }
  .modal-body { padding: 16px; }
}

@media (max-width: 480px) {
  .helmets-grid { grid-template-columns: 1fr; }
  .card-image { height: 180px; }
}

/* ─── SIDEBAR OVERLAY (mobile) ─────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 499;
}

.sidebar-overlay.active { display: block; }

/* Mobile filter toggle button (floating) */
.mobile-filter-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  padding: 14px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 400;
  box-shadow: 0 4px 20px rgba(255,77,77,0.3);
}

@media (max-width: 900px) {
  .mobile-filter-btn { display: block; }
}

/* ─── LOGO LINK ────────────────────────────────── */
.logo-link { text-decoration: none; color: inherit; }

/* ─── HERO SECTION ─────────────────────────────── */
.hero-section {
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border);
}

.hero-section h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 700px;
}

/* ─── SEO NAV (brand/category links) ──────────── */
.seo-brand-nav, .seo-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.seo-brand-link, .seo-cat-link {
  padding: 5px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s;
}

.seo-brand-link:hover, .seo-cat-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── BREADCRUMB ───────────────────────────────── */
.breadcrumb {
  padding: 16px 32px;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ─── HELMET DETAIL PAGE ───────────────────────── */
.helmet-detail { padding: 32px; max-width: 1100px; margin: 0 auto; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.detail-image {
  background: #111;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  overflow: hidden;
}

.detail-image img {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}

.detail-brand {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.detail-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 6px 0 16px;
  line-height: 1.2;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-tag {
  padding: 5px 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
}

a.meta-tag:hover { border-color: var(--accent); color: var(--accent); }
.meta-link { color: var(--accent); }

.detail-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.detail-rating .stars { display: flex; gap: 2px; }
.detail-rating .star { color: var(--text-dim); font-size: 1.2rem; }
.detail-rating .star.filled { color: #ffc107; }

.detail-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.detail-features h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.detail-features ul { list-style: none; padding: 0; }
.detail-features li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.detail-features li::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 8px; height: 8px; background: var(--accent);
  border-radius: 50%; transform: translateY(-50%);
}

.btn-official {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-official:hover { background: var(--accent); color: var(--text); }

/* Related helmets */
.related-section { margin-top: 32px; }
.related-section h2 { font-size: 1.1rem; margin-bottom: 16px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.related-card {
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.related-card:hover { border-color: var(--accent); }

.related-img {
  height: 120px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.related-img .placeholder-icon { font-size: 2rem; opacity: 0.2; color: var(--text-dim); }

.related-info {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.related-model { font-size: 0.85rem; font-weight: 600; }
.related-rating { font-size: 0.8rem; color: #ffc107; }

/* ─── BRAND & CATEGORY PAGES ──────────────────── */
.brand-hero {
  padding: 32px;
  border-bottom: 1px solid var(--border);
}

.brand-hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.brand-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
}

.subcategory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.brand-helmets { padding: 32px; }
.brand-helmets h2 { font-size: 1.1rem; margin-bottom: 20px; color: var(--text-muted); }

.helmet-card-link { text-decoration: none; color: inherit; }
.helmet-card-seo h3 a { color: var(--accent); }

/* ─── 404 PAGE ─────────────────────────────────── */
.page-404 {
  text-align: center;
  padding: 100px 20px;
}

.icon-404 { font-size: 5rem; opacity: 0.2; margin-bottom: 16px; }
.page-404 h1 { font-size: 3rem; margin-bottom: 8px; }
.page-404 p { color: var(--text-muted); margin-bottom: 24px; }

.btn-home {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-home:hover { background: var(--accent-dark); }

/* ─── FOOTER ENHANCED ──────────────────────────── */
.footer-content { max-width: 900px; margin: 0 auto; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--accent); }

/* ─── RESPONSIVE (detail pages) ────────────────── */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-image { min-height: 250px; }
  .detail-info h1 { font-size: 1.5rem; }
  .helmet-detail { padding: 16px; }
  .brand-hero { padding: 20px 16px; }
  .brand-helmets { padding: 16px; }
  .hero-section { padding: 20px 16px; }
  .breadcrumb { padding: 12px 16px; }
}
