:root {
  --bg: #090909;
  --card: #171717;
  --text: #f4f1e8;
  --muted: #b5aea1;
  --muted-2: #7f786d;
  --line: rgba(244, 241, 232, 0.12);
  --gold: #d8b56d;
  --gold-strong: #f1cf82;
  --danger: #ff6b61;
  --success: #72d391;
  --blue: #83b7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(216, 181, 109, 0.18), transparent 30rem),
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.07), transparent 25rem),
    linear-gradient(180deg, #080808 0%, #101010 46%, #090909 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(9, 9, 9, 0.72);
  border-bottom: 1px solid var(--line);
}

.navbar {
  width: min(var(--max-width), calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-logo {
  height: 54px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.brand-text {
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

main {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 430px;
  display: flex;
  align-items: center;
  padding: 72px 0 46px;
}

.hero-content {
  width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  width: 100%;
  max-width: 1180px;
  margin-bottom: 30px;
  font-size: clamp(3.6rem, 5.25vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;

  border: none;
  outline: none;
  border-radius: 999px;

  font-weight: 900;
  overflow: hidden;
  isolation: isolate;
  background-clip: padding-box;

  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #111;
  background: linear-gradient(135deg, var(--gold), #ffe4a3);
  box-shadow: 0 16px 42px rgba(216, 181, 109, 0.22);
}

.button.ghostig {
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(177, 49, 188, 1) 20%,
    rgba(241, 77, 88, 1) 50%,
    rgba(255, 194, 81, 1) 80%
  );
  box-shadow: 0 16px 42px rgba(241, 77, 88, 0.22);
}

.button.ghosttiktok {
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(37, 244, 238, 1) 20%,
    rgba(254, 44, 85, 1) 80%
  );
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.button.disabled {
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  pointer-events: none;
  box-shadow: none;
}

.catalog-section {
  padding: 42px 0 72px;
  border-top: 1px solid rgba(244, 241, 232, 0.08);
}

.catalog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  align-items: end;
  gap: 28px;
  margin-bottom: 24px;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.catalog-title h2 {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.section-heading.compact {
  align-items: start;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.search-box {
  width: 100%;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
}

.search-box input:focus {
  border-color: rgba(216, 181, 109, 0.65);
  box-shadow: 0 0 0 4px rgba(216, 181, 109, 0.08);
}

.filter-toggle,
.clear-filters,
.sort-box select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-weight: 900;
}

.filter-toggle,
.clear-filters {
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter-toggle:hover,
.filter-toggle.active,
.clear-filters:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 181, 109, 0.55);
  background: rgba(216, 181, 109, 0.12);
}

.advanced-filters {
  margin: -4px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.advanced-filter-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sort-box {
  width: min(100%, 330px);
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.sort-box select {
  width: 100%;
  padding: 0 16px;
  outline: none;
  appearance: none;
}

.tag-filter-area p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-filter-btn {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tag-filter-btn:hover,
.tag-filter-btn.active {
  color: #111;
  border-color: transparent;
  background: var(--gold);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-btn {
  min-height: 42px;
  padding: 0 16px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  color: #111;
  border-color: transparent;
  background: var(--gold);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--card);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(216, 181, 109, 0.34);
}

.product-card.sold {
  opacity: 0.72;
}

.product-card.coming {
  opacity: 0.86;
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #0d0d0d;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card:hover .product-image {
  transform: scale(1.04);
}

.status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
}

.status-badge.available {
  color: #0f2819;
  background: rgba(114, 211, 145, 0.92);
}

.status-badge.sold {
  color: #2b0d0b;
  background: rgba(255, 107, 97, 0.92);
}

.status-badge.coming {
  color: #071628;
  background: rgba(131, 183, 255, 0.92);
}

.product-content {
  padding: 22px;
}

.product-kicker {
  margin-bottom: 8px;
  color: var(--gold-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-title {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.product-edition {
  min-height: 38px;
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.product-description {
  min-height: 72px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.price {
  font-size: 1.35rem;
  font-weight: 950;
  color: var(--text);
}

.condition {
  color: var(--muted);
  font-size: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
}

.card-actions {
  margin-top: 0;
}

.card-actions .button {
  width: 100%;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed rgba(216, 181, 109, 0.4);
  border-radius: var(--radius-xl);
  background: rgba(216, 181, 109, 0.04);
}

.empty-state p {
  color: var(--muted);
}

.how-section,
.contact-section {
  padding: 72px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.steps article,
.contact-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.045);
}

.steps article {
  padding: 28px;
}

.steps span {
  display: inline-flex;
  margin-bottom: 34px;
  color: var(--gold-strong);
  font-size: 0.88rem;
  font-weight: 950;
}

.steps h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.steps p,
.contact-section p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 48px 0 88px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(216, 181, 109, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.045);
}

.contact-section h2 {
  margin-bottom: 12px;
}

.site-footer {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 940px) {
  .product-grid,
  .steps {
    grid-template-columns: 1fr 1fr;
  }

 .catalog-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

 .search-box {
    max-width: 480px;
  }
}

@media (max-width: 720px) {
  main,
  .navbar,
  .site-footer {
    width: min(100% - 22px, var(--max-width));
  }

  .navbar {
    min-height: 68px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 54px 0 42px;
  }

  h1 {
    font-size: clamp(3.05rem, 15vw, 4.8rem);
    line-height: 0.92;
  }

  .catalog-section {
    padding-top: 34px;
  }

  .product-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .catalog-header,
  .section-heading {
    display: grid;
    align-items: start;
  }

 .search-box {
    width: 100%;
    max-width: none;
  }

  .catalog-section,
  .how-section,
  .contact-section {
    padding-bottom: 54px;
  }

  .contact-section {
    display: grid;
    margin-bottom: 56px;
  }

  .site-footer {
    display: grid;
  }
}


@media (max-width: 720px) {
 .brand-logo {
    height: 44px;
    max-width: 210px;
  }
}


/* --- v8: dropdown personalizzato, card allineate e paginazione --- */

.sort-box {
  position: relative;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 0 46px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    #171717;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.custom-select-button::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-button {
  border-color: rgba(216, 181, 109, 0.58);
  box-shadow: 0 0 0 4px rgba(216, 181, 109, 0.08);
}

.custom-select.open .custom-select-button::after {
  transform: translateY(-30%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(216, 181, 109, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    #141414;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
}

.sort-option {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.sort-option:hover,
.sort-option.active {
  color: #111;
  background: var(--gold);
}

/* Card più coerenti anche con descrizioni e tag diversi */
.product-grid {
  align-items: stretch;
}

.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-image-wrap {
  flex: 0 0 auto;
}

.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-edition {
  min-height: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  min-height: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  min-height: 36px;
  max-height: 78px;
  overflow: hidden;
}

.card-actions {
  margin-top: auto;
  padding-top: 6px;
}

/* Paginazione */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.pagination[hidden] {
  display: none;
}

.page-btn,
.page-status {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.page-btn {
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.page-btn:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(216, 181, 109, 0.48);
}

.page-btn.active {
  color: #111;
  border-color: transparent;
  background: var(--gold);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.page-status {
  color: var(--text);
  background: rgba(216, 181, 109, 0.08);
}

/* Nasconde il vecchio select se rimane in cache o in copie vecchie */
.sort-box select {
  color: var(--text);
  background: #171717;
}

@media (max-width: 720px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    max-width: 100%;
  }

  .pagination {
    justify-content: flex-start;
  }

  .page-btn,
  .page-status {
    min-height: 40px;
    padding: 0 13px;
  }

  .product-description {
    -webkit-line-clamp: 4;
  }
}


/* --- v9: conteggi filtri e riepilogo risultati --- */

.count-pill {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(244, 241, 232, 0.12);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
}

.filter-btn.active .count-pill,
.filter-btn:hover .count-pill,
.tag-filter-btn.active .count-pill,
.tag-filter-btn:hover .count-pill {
  color: #111;
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(17, 17, 17, 0.16);
}

.result-summary {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.result-summary strong {
  color: var(--gold-strong);
}

.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

@media (max-width: 720px) {
  .result-summary {
    margin-top: -4px;
  }

  .count-pill {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 0.72rem;
  }
}


/* --- v10: link TikTok e azioni contatti --- */

.contact-links,
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-links {
  margin-top: 14px;
}

.contact-links a {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.9rem;
  font-weight: 900;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.contact-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 181, 109, 0.48);
  background: rgba(216, 181, 109, 0.10);
}

.contact-actions {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .contact-actions {
    justify-content: flex-start;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }
}


/* --- Fix Collection + card espandibile per tag lunghi --- */

.product-card .tags {
  transition: max-height 0.25s ease;
}

.product-card:hover,
.product-card:focus-within,
.product-card.expanded {
  z-index: 8;
}

.product-card:hover .tags,
.product-card:focus-within .tags,
.product-card.expanded .tags {
  max-height: none;
  overflow: visible;
}

.product-card:hover .product-description,
.product-card:focus-within .product-description,
.product-card.expanded .product-description,
.product-card:hover .product-edition,
.product-card:focus-within .product-edition,
.product-card.expanded .product-edition {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  overflow: visible;
}

.product-card {
  cursor: pointer;
}

.product-card a,
.product-card button {
  cursor: pointer;
}

.product-card:focus {
  outline: none;
  border-color: rgba(216, 181, 109, 0.42);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(216, 181, 109, 0.08);
}

@media (max-width: 720px) {
  .product-card:hover,
  .product-card.expanded {
    transform: none;
  }
}
