*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color — mirrors website/styles.css (Fillo design system), do not fork values */
  --navy: #010A49;
  --navy-rgb: 1, 10, 73;
  --navy-soft: #131b5e;
  --accent: #F5A623;
  --accent-rgb: 245, 166, 35;
  --accent-soft: #FFE9C2;
  --accent-text: #8a5c0c;
  --bg: #ffffff;
  --bg-alt: #F7F8FC;
  --text: #0B1130;
  --muted: #5B6280;
  --border: #E7E9F5;
  --success: #1E9E6B;
  --danger: #C94B4B;
  --white: #ffffff;
  --white-rgb: 255, 255, 255;

  /* Radius / shadow / border-width */
  --radius-xs: 12px;
  --radius-sm: 14px;
  --radius-md: 16px;
  --radius: 20px;
  --radius-pill: 30px;
  --shadow: 0 24px 60px rgba(var(--navy-rgb), 0.10);
  --border-width: 1px;
  --border-width-thick: 2px;

  /* Motion */
  --transition-snappy: 0.1s;
  --transition-fast: 0.2s;
  --transition-slow: 0.3s;

  /* Type */
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-2xs: 0.5rem;
  --text-xs: 0.72rem;
  --text-80: 0.8rem;
  --text-85: 0.85rem;
  --text-90: 0.9rem;
  --text-92: 0.92rem;
  --text-base: 0.95rem;
  --text-md: 1rem;
  --text-105: 1.05rem;
  --text-110: 1.1rem;
  --text-lg: 1.2rem;

  /* Spacing scale — literal px values, same convention as website/styles.css */
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;

  --size-logo-toolbar: 36px;
  --side-nav-width: 76px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* SHELL — left icon rail (fixed) + main content column, layers.to-style. No right rail. */
.app-shell { display: flex; min-height: 100vh; }

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side-nav-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
  padding: var(--space-20) 0;
  background: var(--bg-alt);
  border-right: var(--border-width) solid var(--border);
  z-index: 100;
}

.side-logo { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.logo-mark { width: var(--size-logo-toolbar); height: var(--size-logo-toolbar); display: block; }

.side-icons { display: flex; flex-direction: column; gap: var(--space-12); flex: 1; }

.side-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.side-icon:hover { background: rgba(var(--navy-rgb), 0.06); color: var(--navy); }
/* Persistent version of the hover look, for the nav item matching the page you're
   already on (this page is always /explore, so the explore icon carries it statically). */
.side-icon.active { background: rgba(var(--navy-rgb), 0.08); color: var(--navy); }

.main-content { flex: 1; min-width: 0; margin-left: var(--side-nav-width); }

/* TOPBAR — sticky "Hot" label + scrollable category chips + search, replaces the
   right-rail search box that layers.to has but that we deliberately don't. */
.content-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-32);
  background: rgba(var(--white-rgb), 0.9);
  backdrop-filter: blur(12px);
  border-bottom: var(--border-width) solid var(--border);
}

.hot-label {
  flex-shrink: 0;
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-8) var(--space-16);
  font-size: var(--text-85);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.chip-row {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--space-10);
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  color: var(--text);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--text-90);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.topbar-search { flex-shrink: 0; width: 240px; }
.topbar-search input {
  width: 100%;
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-8) var(--space-16);
  font-family: inherit;
  font-size: var(--text-90);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus { border-color: var(--navy); }

/* GRID — same density approach Vinted's own grid uses (tight 16px gutters, narrow
   cards) so 5 fit per row instead of 4, without changing the card's own content/shape. */
.item-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-16);
  padding: var(--space-24) var(--space-32);
}

.item-card {
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.item-card:hover { border-color: var(--navy); transform: translateY(-4px); }
.item-card.is-new { border-color: var(--accent); }

.item-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--border);
  display: block;
}

/* Vinted-style hierarchy: brand (bold, primary) + size/condition on the left, price
   pinned to the right and vertically centered against that two-line block -> the
   listing's own title last, full-width, smaller/muted, so we never lose that data. */
.item-body { padding: var(--space-14) var(--space-16) var(--space-18); }
.item-body-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.item-brand-block { min-width: 0; }
.item-brand {
  font-weight: 600;
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta { color: var(--muted); font-size: var(--text-80); margin-top: var(--space-4); }
.item-price { font-size: 14px; font-weight: 600; color: var(--accent-text); flex-shrink: 0; white-space: nowrap; }
.item-title {
  font-weight: 400;
  font-size: var(--text-80);
  color: var(--muted);
  margin-top: var(--space-6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stale-banner {
  margin: 0 var(--space-32) var(--space-16);
  padding: var(--space-10) var(--space-16);
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  font-size: var(--text-90);
}

@media (max-width: 600px) {
  .stale-banner { margin: 0 var(--space-16) var(--space-12); }
}

.load-more-wrap { text-align: center; padding: var(--space-8) var(--space-32) var(--space-24); }
.load-more {
  border: var(--border-width) solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: var(--space-10) var(--space-20);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.load-more:hover { border-color: var(--navy); }
.load-more:disabled { opacity: 0.6; cursor: wait; }

.hidden { display: none; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: var(--space-64) var(--space-24);
}

.footer {
  margin-top: var(--space-24);
  padding: var(--space-20) var(--space-32) var(--space-40);
  color: var(--muted);
  font-size: var(--text-80);
  text-align: center;
  border-top: var(--border-width) solid var(--border);
}
.footer a { color: var(--accent-text); font-weight: 600; }

@media (max-width: 1300px) {
  .item-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1000px) {
  .item-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .side-nav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: var(--space-10) var(--space-16);
    border-right: none;
    border-bottom: var(--border-width) solid var(--border);
  }
  .side-icons { flex-direction: row; flex: 0; }
  .main-content { margin-left: 0; }
  .content-topbar { flex-wrap: wrap; padding: var(--space-14) var(--space-20); }
  .topbar-search { order: 3; flex-basis: 100%; width: 100%; }
}

@media (max-width: 600px) {
  .item-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-14); padding: var(--space-16); }
}
