/* ═══════════════════════════════════════════════════════════
   PokeItalia — Pokémon TCG Marketplace Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --poke-yellow: #ffcb05;
  --poke-yellow-light: #ffe566;
  --poke-red: #ee1515;
  --poke-red-dark: #c41212;
  --poke-blue: #3b4cca;
  --poke-blue-dark: #1b2a6b;
  --poke-navy: #0a1628;
  --poke-navy-mid: #111d35;
  --grass: #78c850;
  --electric: #f8d030;

  --bg: var(--poke-navy);
  --surface: rgba(27, 42, 107, 0.45);
  --surface-2: rgba(36, 48, 88, 0.65);
  --surface-solid: #152040;
  --text: #f0f4ff;
  --muted: #94a8c9;
  --accent: var(--poke-yellow);
  --accent-2: #5b9dff;
  --danger: #ef4444;
  --ok: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Fredoka", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --shadow-glow: 0 0 40px rgba(255, 203, 5, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated background ── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 76, 202, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(238, 21, 21, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(255, 203, 5, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0d1a33 0%, var(--poke-navy) 40%, #060d18 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,203,5,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(91,157,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 10%, rgba(255,255,255,.45) 0%, transparent 100%);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.floating-pokeball {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: float-ball var(--dur, 20s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.floating-pokeball::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--poke-red) 47%, #1a1a2e 47%, #1a1a2e 53%, #e8e8e8 53%);
  border: 3px solid #1a1a2e;
  box-shadow: inset 0 0 20px rgba(0,0,0,.3);
}

.floating-pokeball::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 22%;
  background: #fff;
  border: 3px solid #1a1a2e;
  border-radius: 50%;
}

.pb-1 { width: 80px; height: 80px; top: 12%; left: 8%; --dur: 18s; --delay: 0s; }
.pb-2 { width: 50px; height: 50px; top: 60%; right: 10%; --dur: 24s; --delay: -5s; }
.pb-3 { width: 120px; height: 120px; bottom: 15%; left: 15%; --dur: 22s; --delay: -8s; }
.pb-4 { width: 40px; height: 40px; top: 30%; right: 25%; --dur: 16s; --delay: -3s; }
.pb-5 { width: 65px; height: 65px; bottom: 40%; right: 5%; --dur: 20s; --delay: -12s; }

@keyframes float-ball {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-30px) rotate(8deg); }
  50% { transform: translateY(-10px) rotate(-5deg); }
  75% { transform: translateY(-25px) rotate(3deg); }
}

/* ── Scroll progress ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--poke-red), var(--poke-yellow), var(--poke-blue));
  z-index: 100;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(255, 203, 5, 0.6);
}

/* ── Typography ── */
h1, h2, h3, h4, .logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.35rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--poke-yellow-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--poke-red);
  border: 2px solid var(--poke-yellow);
  box-shadow: 0 0 8px rgba(255, 203, 5, 0.5);
  flex-shrink: 0;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,203,5,.4), transparent);
  margin-left: 0.5rem;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--poke-yellow-light); text-decoration: none; }

.container { width: min(1140px, 92vw); margin: 0 auto; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(10, 22, 40, 0.75);
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}

.site-header.scrolled {
  background: rgba(10, 22, 40, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(255, 203, 5, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  transition: transform 0.2s;
}

.logo:hover { transform: scale(1.03); color: var(--text); }

.logo-pokeball {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--poke-red) 47%, #1a1a2e 47%, #1a1a2e 53%, #f5f5f5 53%);
  border: 2.5px solid #1a1a2e;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 203, 5, 0.35);
  animation: logo-pulse 3s ease-in-out infinite;
}

.logo-pokeball::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: #fff;
  border: 2px solid #1a1a2e;
  border-radius: 50%;
}

@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 203, 5, 0.35); }
  50% { box-shadow: 0 0 24px rgba(255, 203, 5, 0.55); }
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: var(--text);
  opacity: 0.85;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, opacity 0.2s, color 0.2s;
}

.nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--poke-yellow);
}

.nav a.nav-cta {
  background: linear-gradient(135deg, var(--poke-yellow), var(--poke-yellow-light));
  color: #1a1200;
  opacity: 1;
  box-shadow: 0 2px 12px rgba(255, 203, 5, 0.3);
}

.nav a.nav-cta:hover {
  background: linear-gradient(135deg, var(--poke-yellow-light), #fff176);
  transform: translateY(-1px);
  color: #1a1200;
}

.nav-logout-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.nav-logout-form button {
  color: var(--text);
  opacity: 0.85;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, opacity 0.2s, color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-logout-form button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--poke-yellow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.2) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.btn:hover::after { transform: translateX(100%); }
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--poke-yellow) 0%, #ffd740 100%);
  color: #1a1200;
  box-shadow: 0 4px 20px rgba(255, 203, 5, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(255, 203, 5, 0.5);
  color: #1a1200;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 203, 5, 0.3);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.3); }

.btn-red {
  background: linear-gradient(135deg, var(--poke-red), var(--poke-red-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(238, 21, 21, 0.3);
}

.btn-red:hover { color: #fff; }

/* ── Main layout ── */
main.container { padding: 2rem 0 5rem; }

/* ── Hero (homepage) ── */
.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(59, 76, 202, 0.25) 0%, rgba(238, 21, 21, 0.08) 50%, rgba(255, 203, 5, 0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,203,5,.08) 0%, transparent 70%);
  animation: hero-glow 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hero-glow {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  100% { transform: translate(-5%, 5%) scale(1.1); opacity: 1; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 203, 5, 0.12);
  border: 1px solid rgba(255, 203, 5, 0.25);
  color: var(--poke-yellow);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.hero h1 {
  margin-top: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.1;
  max-width: 16ch;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--poke-yellow), #fff176, var(--electric));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--muted);
  max-width: 52ch;
  margin: 1rem 0 0;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item { text-align: left; }

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--poke-yellow);
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Trust / feature cards ── */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.trust-item {
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.trust-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--poke-red), var(--poke-yellow), var(--poke-blue));
  opacity: 0;
  transition: opacity 0.3s;
}

.trust-item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 203, 5, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.trust-item:hover::before { opacity: 1; }

.trust-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 8px rgba(255,203,5,.3));
}

/* ── CTA band ── */
.cta-band {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(238,21,21,.15), rgba(59,76,202,.2));
  border: 1px solid rgba(255,255,255,.1);
  margin: 3rem 0;
}

.cta-band h2 { margin-top: 0; }
.cta-band p { color: var(--muted); max-width: 48ch; margin: 0.5rem auto 1.25rem; }

/* ── Card grid & tiles ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.15rem;
}

.card-tile {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), border-color 0.3s, box-shadow 0.3s;
  position: relative;
  display: block;
}

.card-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,.06) 42%,
    rgba(255,203,5,.12) 48%,
    rgba(91,157,255,.1) 54%,
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.card-tile:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 203, 5, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 203, 5, 0.08);
  text-decoration: none;
}

.card-tile:hover::after {
  opacity: 1;
  animation: holo-sweep 2s ease infinite;
}

@keyframes holo-sweep {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.card-tile img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: linear-gradient(180deg, #0d1525, #1a2540);
  transition: transform 0.4s;
}

.card-tile:hover img { transform: scale(1.04); }

.card-tile-body { padding: 1rem; }
.card-tile-body h3 {
  font-size: 1rem;
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.price {
  color: var(--poke-yellow);
  font-weight: 800;
  font-size: 1.15rem;
  font-family: var(--font-display);
}

.price-lg {
  font-size: 2rem;
  color: var(--poke-yellow);
  font-weight: 800;
  font-family: var(--font-display);
  text-shadow: 0 0 20px rgba(255, 203, 5, 0.3);
}

.seller { font-size: 0.82rem; color: var(--muted); margin: 0.25rem 0 0; }
.muted { color: var(--muted); }

/* ── Page header (inner pages) ── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-header .subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Forms ── */
.form-card, .legal-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 520px;
  box-shadow: var(--shadow-card);
}

.legal-page {
  max-width: 760px;
  margin: 0 auto 3rem;
}

.legal-page > h1 {
  margin-bottom: 0.35rem;
}

.legal-page .legal-card {
  max-width: none;
  margin-top: 1.25rem;
}

.legal-page .legal-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.legal-page .legal-card h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.legal-page .legal-card ul,
.legal-page .legal-card ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.legal-page .legal-card li + li {
  margin-top: 0.35rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item .faq-body {
  padding: 0 1.25rem 1.15rem;
  color: var(--muted);
  line-height: 1.6;
}

.faq-item .faq-body p {
  margin: 0;
}

.faq-item .faq-body p + p {
  margin-top: 0.75rem;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.legal-toc a {
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-card input, .form-card select, .form-card textarea,
.filters input, .catalog-filters input, .catalog-filters select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  margin: 0.35rem 0 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 22, 40, 0.6);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card input:focus, .form-card select:focus, .form-card textarea:focus,
.catalog-filters input:focus, .catalog-filters select:focus {
  outline: none;
  border-color: rgba(255, 203, 5, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.12);
}

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filters input { width: auto; min-width: 140px; }

.catalog-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.06);
}

.catalog-filters .filter-grow { flex: 1; min-width: 200px; margin: 0; }
.catalog-filters input[type="number"] { width: 110px; margin: 0; }
.catalog-filters select { min-width: 130px; max-width: 200px; margin: 0; }
.catalog-filters input[type="search"] { margin: 0; }

.form-listing { max-width: 560px; }
.form-listing label { display: block; margin-top: 0.75rem; font-weight: 700; font-family: var(--font-display); }
.form-listing input, .form-listing select, .form-listing textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  margin: 0.3rem 0 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 22, 40, 0.6);
  color: var(--text);
}

/* ── Listing detail ── */
.listing-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 768px) { .listing-detail { grid-template-columns: 1fr; } }

.listing-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid rgba(255, 203, 5, 0.15);
  box-shadow: var(--shadow-card), 0 0 40px rgba(255, 203, 5, 0.06);
}

.listing-media img { width: 100%; display: block; border-radius: var(--radius); }

.listing-info {
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
}

.listing-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  padding: 1rem;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
}

.listing-meta dt { color: var(--muted); font-weight: 600; }
.listing-meta dd { margin: 0; font-weight: 700; }

.actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ── Chat (social style) ── */
.chat-app {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 0;
  height: calc(100vh - var(--header-h) - 4rem);
  min-height: 520px;
  max-height: 820px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

@media (max-width: 768px) {
  .chat-app { grid-template-columns: 1fr; height: auto; min-height: 70vh; max-height: none; }
  .chat-sidebar { max-height: 220px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .chat-main { min-height: 50vh; }
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 22, 40, 0.5);
  overflow: hidden;
}

.chat-sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.chat-sidebar-head .page-title { font-size: 1.25rem; margin: 0; }

.chat-conv-list { overflow-y: auto; flex: 1; }

.chat-conv-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: inherit;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background 0.15s;
  position: relative;
}

.chat-conv-item:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.chat-conv-item.active {
  background: rgba(255, 203, 5, 0.1);
  border-left: 3px solid var(--poke-yellow);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--poke-blue), var(--poke-red));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.chat-avatar-sm { width: 32px; height: 32px; font-size: 0.85rem; }
.chat-avatar-lg { width: 48px; height: 48px; }

.chat-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.chat-conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.chat-conv-name { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-time { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }
.chat-conv-preview { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-listing { font-size: 0.75rem; }

.chat-unread-dot {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--poke-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(15, 25, 45, 0.4);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(8px);
}

.chat-header-info { display: flex; flex-direction: column; gap: 0.1rem; }
.chat-header-listing { font-size: 0.85rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}

.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 78%;
}

.chat-bubble-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-row.theirs { align-self: flex-start; }

.chat-bubble {
  padding: 0.65rem 0.95rem;
  border-radius: 18px;
  word-break: break-word;
}

.chat-bubble-row.theirs .chat-bubble {
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-left-radius: 4px;
}

.chat-bubble-row.mine .chat-bubble {
  background: linear-gradient(135deg, var(--poke-blue), #2d4a9e);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(59, 76, 202, 0.25);
}

.chat-bubble p { margin: 0; line-height: 1.45; }
.chat-bubble time {
  display: block;
  font-size: 0.68rem;
  color: rgba(255,255,255,.45);
  margin-top: 0.35rem;
  text-align: right;
}

.chat-bubble-enter {
  animation: bubble-in 0.3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 22, 40, 0.85);
  align-items: center;
}

.chat-composer input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-size: 0.95rem;
}

.chat-composer input:focus {
  outline: none;
  border-color: rgba(255, 203, 5, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.1);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.chat-placeholder-icon { font-size: 3rem; opacity: 0.5; }
.chat-empty { padding: 1.5rem; text-align: center; }

.nav-messages-link { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; }
.nav-messages-link.has-unread { color: var(--poke-yellow); }

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--poke-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 8px rgba(238, 21, 21, 0.5);
  animation: badge-pop 0.35s cubic-bezier(.34,1.56,.64,1);
}

.nav-badge.hidden { display: none; }
.hero-messages-btn .nav-badge { margin-left: 0.25rem; }

@keyframes badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.chat-box {
  height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-msg { margin-bottom: 0.75rem; max-width: 80%; }
.chat-msg.mine { margin-left: auto; text-align: right; }
.chat-form { display: flex; gap: 0.5rem; }
.chat-form input { flex: 1; }

/* ── Flash messages ── */
.flash-messages { margin-bottom: 1.25rem; }

.flash {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-weight: 600;
  border-left: 4px solid;
  animation: flash-in 0.4s ease;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-success, .flash-info {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--ok);
}

.flash-error, .flash-warning {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  background: rgba(6, 13, 24, 0.6);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,203,5,.3), rgba(238,21,21,.3), transparent);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand strong {
  font-family: var(--font-display);
  color: var(--poke-yellow);
  font-size: 1.1rem;
}

.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--poke-yellow); }

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(21, 32, 64, 0.95);
  backdrop-filter: blur(16px);
  padding: 1.15rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 203, 5, 0.15);
  z-index: 60;
  animation: slide-up 0.5s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ── PWA install banner ── */
.pwa-install-bar {
  display: none;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(255, 203, 5, 0.08), rgba(238, 21, 21, 0.06));
  border: 1px solid rgba(255, 203, 5, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.pwa-install-bar.visible {
  display: flex;
}

.pwa-install-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  flex-wrap: wrap;
}

.pwa-install-text {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}

.pwa-install-text strong { color: var(--text); }

.pwa-install-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-install-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
}

.pwa-install-dismiss:hover { color: var(--text); }

.pwa-ios-share {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 203, 5, 0.25);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.78rem;
  vertical-align: middle;
  color: var(--text);
}

@media (max-width: 600px) {
  .pwa-install-text { font-size: 0.8rem; }
}

/* ── Catalog extras ── */
.catalog-grid .catalog-tile img { aspect-ratio: 3/4; }

.catalog-no-img {
  width: 100%;
  aspect-ratio: 3/4;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--surface-solid), var(--poke-blue-dark));
  color: var(--muted);
  font-size: 2.5rem;
  font-family: var(--font-display);
}

.catalog-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0; }

.tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 203, 5, 0.15);
  color: var(--poke-yellow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-muted {
  background: rgba(148, 168, 201, 0.12);
  color: var(--muted);
}

.catalog-sell-link {
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 700;
}

.catalog-list { list-style: none; padding: 0; }
.catalog-list li { padding: 0.65rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.catalog-img { max-width: 100%; border-radius: var(--radius); }

.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.pagination a {
  padding: 0.6rem 1.25rem;
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s;
}

.pagination a:hover {
  background: rgba(255,203,5,.12);
  border-color: rgba(255,203,5,.3);
  color: var(--poke-yellow);
}

.pagination span { color: var(--muted); font-weight: 600; }

.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .verify-grid { grid-template-columns: 1fr; } }

.profile-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.inbox-list { list-style: none; padding: 0; }
.inbox-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: padding-left 0.2s;
}

.inbox-list li:hover { padding-left: 0.5rem; }

/* ── Card picker (listing form) ── */
.card-picker-wrap { position: relative; margin-bottom: 1rem; }

.card-picker-results {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 30;
  background: var(--surface-solid);
  border: 1px solid rgba(255,203,5,.2);
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-card);
}

.card-picker-results.open { display: block; }

.card-picker-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background 0.15s;
}

.card-picker-item:hover, .card-picker-item.active {
  background: rgba(255,203,5,.08);
}

.card-picker-item img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.card-selected {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  background: rgba(255,203,5,.06);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid rgba(255,203,5,.2);
}

.card-selected img { width: 60px; border-radius: 6px; }
.card-selected.hidden { display: none; }

/* ── Cart & wallet ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 768px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-seller-group {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1rem;
  margin-bottom: 1rem;
}
.cart-seller-name { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--poke-yellow); }
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.cart-item-price { font-family: var(--font-display); font-weight: 700; color: var(--poke-yellow); }

.cart-summary {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,203,5,.15);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}
.cart-summary h3 { margin-top: 0; }
.summary-dl { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem; margin: 1rem 0; }
.summary-dl dt { color: var(--muted); }
.summary-dl dd { margin: 0; font-weight: 700; text-align: right; }

.escrow-note, .escrow-banner {
  background: rgba(59, 76, 202, 0.15);
  border: 1px solid rgba(91, 157, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  margin: 1rem 0;
}

.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

.order-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.order-card-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.order-line-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.order-line-main { display: flex; gap: 1rem; align-items: flex-start; }
.order-line-img { width: 72px; border-radius: 8px; }
.order-line-actions { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.tag-ok { background: rgba(74, 222, 128, 0.15); color: var(--ok); }
.small { font-size: 0.85rem; }

.wallet-balance {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(255,203,5,.12), rgba(59,76,202,.15));
  border-radius: var(--radius);
  border: 1px solid rgba(255,203,5,.2);
  margin-bottom: 1rem;
}
.wallet-balance-label { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.35rem; }
.wallet-balance-amount {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--poke-yellow);
  text-shadow: 0 0 30px rgba(255,203,5,.3);
}

/* ═══════════════════════════════════════════════════════════
   Scroll reveal animations
   ═══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.34,1.56,.64,1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.34,1.56,.64,1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.revealed > *:nth-child(9) { transition-delay: 0.45s; }
.stagger-children.revealed > *:nth-child(10) { transition-delay: 0.5s; }
.stagger-children.revealed > *:nth-child(11) { transition-delay: 0.55s; }
.stagger-children.revealed > *:nth-child(12) { transition-delay: 0.6s; }

.stagger-children.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
  html { scroll-behavior: auto; }
}

/* ── Responsive nav ── */
@media (max-width: 600px) {
  .nav { gap: 0.1rem; }
  .nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .catalog-filters { flex-direction: column; align-items: stretch; }
  .catalog-filters select, .catalog-filters input { max-width: 100%; width: 100%; }
  .filter-grid-3 { grid-template-columns: 1fr; }
  .catalog-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   Catalog Explorer (filtri avanzati + griglia carte)
   ═══════════════════════════════════════════════════════════ */
.catalog-explorer { margin-bottom: 3rem; }

.catalog-explorer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.catalog-active-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.catalog-search-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.catalog-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10, 22, 40, 0.7);
  color: var(--text);
  font-size: 1rem;
}

.filter-accordion { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 2rem; }

.filter-panel {
  background: rgba(27, 42, 107, 0.35);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  overflow: hidden;
}

.filter-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  user-select: none;
  background: rgba(0,0,0,.15);
}

.filter-panel-head::-webkit-details-marker { display: none; }

.filter-chevron {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  position: relative;
  flex-shrink: 0;
}

.filter-chevron::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translate(-50%, -60%) rotate(45deg);
  transition: transform 0.2s;
}

.filter-panel[open] .filter-chevron::after {
  transform: translate(-50%, -30%) rotate(-135deg);
}

.filter-panel-body { padding: 1rem 1.15rem 1.25rem; }

.filter-subsection { margin-bottom: 1.25rem; }
.filter-subsection:last-child { margin-bottom: 0; }

.filter-subsection-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.filter-subsection-head h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--poke-yellow);
  font-family: var(--font-display);
}

.filter-select-all {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-select-all:hover {
  background: rgba(255,203,5,.12);
  color: var(--poke-yellow);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.45rem;
}

.filter-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

.filter-pill { cursor: pointer; display: block; }
.filter-pill input { position: absolute; opacity: 0; pointer-events: none; }

.filter-pill-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid rgba(255,255,255,.08);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 40px;
}

.filter-pill-label {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 600;
}

.filter-pill-count { font-size: 0.72rem; }

.filter-toggle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.filter-pill input:checked + .filter-pill-inner {
  background: rgba(255, 203, 5, 0.12);
  border-color: rgba(255, 203, 5, 0.45);
  box-shadow: 0 0 12px rgba(255, 203, 5, 0.1);
}

.filter-pill input:checked + .filter-pill-inner .filter-toggle {
  background: var(--poke-yellow);
  border-color: var(--poke-yellow);
  box-shadow: inset 0 0 0 3px rgba(15, 25, 45, 0.9);
}

.filter-pill-set .filter-pill-inner { border-radius: var(--radius-sm); }
.set-symbol {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(1.1);
  flex-shrink: 0;
}

.filter-expansions .filter-subsection {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Results */
.catalog-results { margin-top: 0.5rem; }

.catalog-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.catalog-results-label { margin: 0; color: var(--muted); font-size: 0.95rem; }
.catalog-results-label strong { color: var(--text); }

.catalog-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.catalog-sort select {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 600;
}

.catalog-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Risultati catalogo sempre visibili (no scroll-reveal) */
.catalog-cards-grid > * {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) { .catalog-cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .catalog-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; } }

.catalog-card-img {
  position: relative;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: linear-gradient(145deg, #0d1525, #1a2540);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.catalog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.catalog-card-img:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 0 20px rgba(255,203,5,.08);
  text-decoration: none;
}

.catalog-card-img:hover img { transform: scale(1.04); }

.catalog-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.catalog-card-img:hover .catalog-card-overlay { opacity: 1; }

.catalog-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  line-height: 1.2;
}

.catalog-card-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,.7);
  margin-top: 0.15rem;
}

.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(90deg, rgba(59,76,202,.25), rgba(91,157,255,.2));
  border-radius: 999px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.catalog-page-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  transition: background 0.15s;
}

.catalog-page-btn:hover:not(.disabled) {
  background: rgba(255,203,5,.25);
  color: var(--poke-yellow);
  text-decoration: none;
}

.catalog-page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.catalog-page-info {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   Listing status & seller tools
   ═══════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.badge-warning { background: rgba(255, 193, 7, 0.2); color: #ffd54f; }
.badge-muted { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.badge-info { background: rgba(91, 157, 255, 0.2); color: #90caf9; }

.tag-info {
  background: rgba(91, 157, 255, 0.15);
  color: #90caf9;
}

.listing-status-banner,
.listing-qty-banner {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  z-index: 2;
}

.listing-qty-banner { background: rgba(59, 76, 202, 0.85); }

.seller-panel {
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 203, 5, 0.06);
  border: 1px solid rgba(255, 203, 5, 0.15);
}

.section-title-sm {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

.seller-actions,
.my-listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.seller-actions form,
.my-listing-actions form,
.inline-form { display: inline; margin: 0; }

.field-hint { display: block; font-size: 0.82rem; margin-top: 0.25rem; }

.form-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 0.5rem; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.my-listings-list { display: flex; flex-direction: column; gap: 0.85rem; }

.my-listing-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.my-listing-thumb img {
  width: 72px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.my-listing-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.my-listing-head h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.my-listing-meta { margin: 0.35rem 0; font-size: 0.9rem; }

.catalog-empty { grid-column: 1 / -1; text-align: center; padding: 2rem; }

/* Mobile buy bar (listing detail) */
.mobile-buy-bar {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.filters-drawer { margin: 0; }
.filters-drawer-toggle { list-style: none; cursor: pointer; }
.filters-drawer-toggle::-webkit-details-marker { display: none; }
.filters-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}
.filters-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   Mobile-first improvements
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding-left: 1rem; padding-right: 1rem; }

  .nav-toggle { display: flex; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.75rem 1rem 1rem;
    background: rgba(10, 22, 40, 0.98);
    border-bottom: 1px solid rgba(255, 203, 5, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  body.nav-open .nav { display: flex; }

  body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .header-inner { position: relative; flex-wrap: nowrap; }

  .nav a,
  .nav-logout-form button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }

  .nav a.nav-cta { text-align: center; }

  .page-title { font-size: 1.65rem; }
  .page-header { margin-bottom: 1.25rem; }

  .profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .profile-actions .btn { flex: 1 1 calc(50% - 0.25rem); min-width: 0; text-align: center; }

  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .card-tile-body { padding: 0.75rem; }
  .card-tile-body h3 { font-size: 0.9rem; }

  .catalog-filters.filters-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .catalog-search-row { flex-direction: column; }

  .filter-panel-body { max-height: 50vh; overflow-y: auto; }

  .catalog-explorer-head { flex-direction: column; }

  .catalog-results-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .listing-detail { gap: 1.25rem; }

  .listing-info { padding: 1.25rem; }

  .price-lg { font-size: 1.65rem; }

  .actions .btn { flex: 1 1 100%; text-align: center; }

  .mobile-buy-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(10, 22, 40, 0.96);
    border-top: 1px solid rgba(255, 203, 5, 0.15);
    backdrop-filter: blur(12px);
  }

  .mobile-buy-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--container, 1200px);
    margin: 0 auto;
  }

  .mobile-buy-price {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--poke-yellow);
    font-size: 1.25rem;
    white-space: nowrap;
  }

  .mobile-buy-bar form,
  .mobile-buy-bar .btn { flex: 1; margin: 0; }

  .btn-block { width: 100%; display: block; text-align: center; }

  body:has(.mobile-buy-bar) main.container { padding-bottom: 5.5rem; }

  .my-listing-row { grid-template-columns: 56px 1fr; }
  .my-listing-thumb img { width: 56px; }

  .form-card { max-width: none; padding: 1.25rem; }

  .cookie-banner {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .footer-inner { flex-direction: column; text-align: center; gap: 1rem; }
}

@media (max-width: 400px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .logo-text { font-size: 1rem; }
}
