:root {
  --bg: #0f1117;
  --bg-elevated: #161922;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --text: #f4f4f5;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.45);
  --gold: #fbbf24;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-hover);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(251, 191, 36, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(99, 102, 241, 0.12), transparent),
    var(--bg);
  pointer-events: none;
}

.container {
  width: min(1280px, 100% - 2.5rem);
  margin-inline: auto;
  padding-bottom: 4rem;
}

/* ——— Header ——— */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.site-header__brand {
  width: 100%;
  max-width: 40rem;
}

.site-header h1.site-header__badge {
  display: inline-block;
  margin: 0 0 1.75rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: 1px solid rgba(129, 140, 248, 0.45);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.12),
    0 8px 32px rgba(99, 102, 241, 0.18);
}

.site-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  text-align: center;
}

.site-header__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.12rem 0.5rem;
  font-weight: 500;
  color: var(--accent-light);
  text-decoration: none;
  vertical-align: baseline;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 6px;
  transition:
    color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.site-header__link svg {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s var(--ease-spring);
}

.site-header__link:hover {
  color: #fff;
  background: rgba(99, 102, 241, 0.28);
  border-color: var(--accent-light);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.site-header__link:hover svg {
  transform: translate(1px, -1px);
  opacity: 1;
}

.site-header__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.site-header__link--insta:hover {
  color: #fff;
  background: rgba(225, 48, 108, 0.2);
  border-color: rgba(225, 48, 108, 0.45);
  box-shadow: 0 0 12px rgba(225, 48, 108, 0.2);
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.meta-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.meta-pill--count {
  font-weight: 600;
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
}

.meta-status {
  font-size: 0.8rem;
  color: var(--accent-light);
}

/* ——— Toolbar ——— */
.toolbar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.toolbar__main {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.toolbar__main .field--search {
  flex: 1;
  min-width: 0;
}

.toolbar__advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  height: 2.65rem;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.toolbar__advanced-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.toolbar__advanced-toggle.is-open {
  color: var(--accent-light);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
}

.toolbar__advanced-toggle.has-active-filters {
  color: var(--accent-light);
  border-color: rgba(99, 102, 241, 0.4);
}

.toolbar__advanced-badge {
  min-width: 1.1rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  background: var(--accent);
  border-radius: 999px;
}

.toolbar__advanced-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease-out);
}

.toolbar__advanced-toggle.is-open .toolbar__advanced-chevron {
  transform: rotate(180deg);
}

.toolbar__advanced {
  display: grid;
  gap: 0.75rem;
}

.toolbar__advanced[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .toolbar__main .field__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .toolbar__main .field--search input {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

@media (min-width: 768px) {
  .toolbar {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    padding: 1.25rem;
    align-items: end;
  }

  .toolbar__main {
    display: contents;
  }

  .toolbar__advanced-toggle {
    display: none;
  }

  .toolbar__advanced {
    display: contents;
  }

  .toolbar__advanced[hidden] {
    display: contents;
  }
}

.field--reset {
  min-width: 0;
}

.btn-reset {
  width: 100%;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.btn-reset:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.btn-reset:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.field--serie {
  position: relative;
  z-index: 10;
}

/* ——— Sélecteur de séries (style Pokecardex) ——— */
.serie-picker {
  position: relative;
}

.serie-picker.is-open {
  z-index: 100;
}

.serie-picker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.serie-picker__trigger:hover,
.serie-picker.is-open .serie-picker__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.serie-picker__trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serie-picker__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease-out);
}

.serie-picker.is-open .serie-picker__chevron {
  transform: rotate(180deg);
}

.serie-picker__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  max-height: min(420px, 60vh);
  background: #f8f9fc;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: serie-panel-in 0.2s var(--ease-out);
}

.serie-picker__panel[hidden] {
  display: none;
}

@keyframes serie-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.serie-picker__search {
  flex-shrink: 0;
  margin: 0.65rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
}

.serie-picker__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.serie-picker__eras {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 0.5rem;
  scrollbar-width: thin;
}

.serie-picker__all {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  background: #eef2ff;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
}

.serie-picker__all:hover {
  background: #e0e7ff;
}

.serie-picker__era {
  border-bottom: 1px solid #e5e7eb;
}

.serie-picker__era-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.serie-picker__era-header:hover {
  background: #e5e7eb;
}

.serie-picker__era-chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s var(--ease-out);
}

.serie-picker__era.is-expanded .serie-picker__era-chevron {
  transform: rotate(180deg);
}

.serie-picker__era-list {
  display: none;
  background: #fff;
}

.serie-picker__era.is-expanded .serie-picker__era-list {
  display: block;
}

.serie-picker__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 1.25rem;
  font: inherit;
  font-size: 0.88rem;
  color: #1f2937;
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
}

.serie-picker__item:hover {
  background: #f9fafb;
}

.serie-picker__item.is-selected {
  background: #eef2ff;
  color: var(--accent);
  font-weight: 600;
}

.serie-picker__item-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.serie-picker__item-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
}

.serie-picker__item.is-selected .serie-picker__item-count {
  color: var(--accent);
}

.serie-picker__empty {
  padding: 1.5rem 1rem;
  font-size: 0.88rem;
  color: #6b7280;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s var(--ease-out);
}

.field--search input {
  padding-left: 2.5rem;
}

input,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

input:hover,
select:hover {
  border-color: var(--border-hover);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.field--search:focus-within .field__icon {
  color: var(--accent-light);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* ——— Grid ——— */
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
  }
}

@media (max-width: 639px) {
  .card-body {
    padding: 0.65rem 0.65rem 0.75rem;
    gap: 0.35rem;
  }

  .card h2 {
    font-size: 0.78rem;
    -webkit-line-clamp: 3;
  }

  .card-nom {
    font-size: 0.68rem;
    -webkit-line-clamp: 1;
  }

  .card-tag {
    font-size: 0.58rem;
    padding: 0.12rem 0.35rem;
  }

  .card a.btn {
    padding: 0.5rem 0.45rem;
    font-size: 0.7rem;
  }

  .card-price-tag {
    bottom: 0.45rem;
    left: 0.45rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.85rem;
  }
}

/* ——— Cards ——— */
.card {
  --card-delay: 0ms;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(16px);
  animation: card-enter 0.5s var(--ease-out) var(--card-delay) forwards;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out);
}

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(99, 102, 241, 0.4) 50%,
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 2;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.card:hover::before {
  opacity: 1;
}

.card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(145deg, #1e2130 0%, #12141c 100%);
  cursor: pointer;
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 17, 23, 0.85) 0%,
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
}

.card:hover .card-media::after {
  opacity: 1;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease-out);
}

.card:hover .card-media img {
  transform: scale(1.06);
}

.card-price-tag {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.35rem 0.7rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 17, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  transform: translateY(4px);
  opacity: 0.9;
  transition:
    transform 0.35s var(--ease-spring),
    background 0.25s var(--ease-out);
}

.card:hover .card-price-tag {
  transform: translateY(0);
  background: rgba(99, 102, 241, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  padding: 1rem 1rem 1.1rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag {
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
}

.card-tag:last-child {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.card-nom {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.card h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s var(--ease-out);
}

.card:hover h2 {
  color: #fff;
}

.card-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: auto;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
  transition:
    transform 0.25s var(--ease-spring),
    box-shadow 0.25s var(--ease-out),
    gap 0.25s var(--ease-out);
}

.card a.btn::after {
  content: "→";
  display: inline-block;
  transition: transform 0.25s var(--ease-spring);
}

.card a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  gap: 0.6rem;
}

.card a.btn:hover::after {
  transform: translateX(3px);
}

.card a.btn:active {
  transform: translateY(0);
}

.card.inactive {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.card.inactive:hover {
  transform: none;
}

/* ——— States ——— */
.state-message,
.empty,
.error {
  grid-column: 1 / -1;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

.error {
  color: #f87171;
}

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

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .card,
  .card-media img,
  .card a.btn,
  .card-price-tag {
    transition: none;
  }

  .card:hover {
    transform: none;
  }

  .card:hover .card-media img {
    transform: none;
  }
}

/* ——— Modale produit ——— */
body.modal-open,
body.lightbox-open {
  overflow: hidden;
}

.modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden],
.lightbox[hidden] {
  display: none;
}

.modal__backdrop,
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  animation: fade-in 0.25s var(--ease-out);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 880px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #1c1f2e 0%, #12141c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.15),
    0 32px 80px rgba(0, 0, 0, 0.65);
  animation: modal-slide 0.4s var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease-spring);
}

.modal__close:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.05);
}

.modal__layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(92vh, 880px);
  overflow: hidden;
}

@media (min-width: 720px) {
  .modal__layout {
    flex-direction: row;
  }
}

.modal__visual {
  flex-shrink: 0;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 720px) {
  .modal__visual {
    width: 42%;
    max-width: 380px;
    padding: 1.5rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
}

.modal__hero {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #252836 0%, #14161f 100%);
  cursor: zoom-in;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    transform 0.25s var(--ease-out);
}

.modal__hero:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25);
  transform: scale(1.01);
}

.modal__hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.5rem;
}

.modal__hero-zoom {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}

.modal__hero:hover .modal__hero-zoom {
  opacity: 1;
  transform: translateY(0);
}

.modal__thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal__gallery-thumb {
  position: relative;
  flex: 1;
  min-width: 64px;
  max-width: calc(50% - 0.25rem);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #1a1d28;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s var(--ease-out),
    opacity 0.2s;
}

.modal__gallery-thumb.is-active {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.modal__gallery-thumb:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.modal__gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal__visual-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

@media (min-width: 720px) {
  .modal__body {
    padding: 1.5rem 1.75rem;
  }
}

.modal__header {
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.modal__tags .card-tag {
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.modal__tags .card-tag:nth-child(1) {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
}

.modal__tags .card-tag:nth-child(2) {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
}

.modal__tags .card-tag:nth-child(3) {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.modal__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.modal__nom {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--accent-light);
  font-style: normal;
  font-weight: 500;
}

.modal__price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(79, 70, 229, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 10px;
}

.modal__specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.modal__spec {
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.modal__spec-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.modal__spec-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.modal__section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.modal__section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.modal__description-wrap {
  margin-bottom: 1.25rem;
}

.modal__description {
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #d4d4d8;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.modal__description--empty {
  color: var(--text-muted);
  font-style: italic;
}

.modal__desc-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal__desc-row:last-of-type {
  border-bottom: none;
}

.modal__desc-key {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--accent-light);
  white-space: nowrap;
}

.modal__desc-val {
  font-size: 0.88rem;
  color: var(--text);
}

.modal__desc-line {
  margin: 0 0 0.5rem;
}

.modal__desc-line:last-child {
  margin-bottom: 0;
}

.modal__desc-sep {
  margin: 0.75rem 0;
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.modal__footer {
  position: sticky;
  bottom: 0;
  padding-top: 0.5rem;
  background: linear-gradient(to top, #12141c 70%, transparent);
}

.modal__vinted {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transition:
    transform 0.2s var(--ease-spring),
    box-shadow 0.2s;
}

.modal__vinted:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.55);
}

.modal__vinted svg {
  transition: transform 0.2s var(--ease-spring);
}

.modal__vinted:hover svg {
  transform: translate(2px, -2px);
}

@media (max-width: 719px) {
  .modal {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.5rem 0.5rem 0;
  }

  .modal__panel {
    width: 100%;
    max-height: calc(100vh - 0.5rem);
    border-radius: 16px;
  }

  .modal__close {
    top: 0.65rem;
    right: 0.65rem;
    width: 2.15rem;
    height: 2.15rem;
  }

  .modal__layout {
    max-height: calc(100vh - 0.5rem);
  }

  .modal__visual {
    display: block;
    padding: 0.75rem 1rem 0.65rem;
  }

  .modal__hero {
    width: 100%;
    height: min(200px, 38vh);
    margin: 0 0 0.65rem;
    aspect-ratio: auto;
    border-radius: 12px;
  }

  .modal__hero img {
    padding: 0.35rem;
  }

  .modal__thumbs {
    display: flex;
    flex-flow: row wrap;
    gap: 0.5rem;
    width: auto;
  }

  .modal__gallery-thumb {
    flex: 1;
    min-width: 64px;
    max-width: calc(50% - 0.25rem);
    width: auto;
    max-height: none;
  }

  .modal__visual-hint {
    margin: 0.5rem 0 0;
    font-size: 0.68rem;
    text-align: center;
  }

  .modal__body {
    padding: 0.85rem 1rem 1rem;
  }

  .modal__header {
    margin-bottom: 0.75rem;
    padding-right: 1.75rem;
  }

  .modal__tags {
    margin-bottom: 0.5rem;
  }

  .modal__title {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .modal__nom {
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
  }

  .modal__price {
    font-size: 1.2rem;
    padding: 0.25rem 0.65rem;
  }

  .modal__specs {
    margin-bottom: 0.75rem;
    gap: 0.35rem;
  }

  .modal__spec {
    padding: 0.45rem 0.55rem;
  }

  .modal__description-wrap {
    position: relative;
    margin-bottom: 0.75rem;
  }

  .modal__description {
    min-height: 6.5rem;
    max-height: 10rem;
    overflow-y: auto;
    padding: 0.85rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
  }

  .modal__description-wrap::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1.5rem;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(18, 20, 28, 0.92));
  }

  .modal__footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
    background: none;
  }

  .modal__vinted {
    width: auto;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  }

  .modal__vinted svg {
    width: 14px;
    height: 14px;
  }
}

/* ——— Lightbox ——— */
.lightbox {
  z-index: 1100;
  padding: 0;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox__close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s, transform 0.2s var(--ease-spring);
}

.lightbox__nav:hover {
  background: rgba(99, 102, 241, 0.85);
  transform: translateY(-50%) scale(1.08);
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

.lightbox__nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4rem 5rem;
  pointer-events: none;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: lightbox-img 0.3s var(--ease-out);
}

@keyframes lightbox-img {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  z-index: 3;
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  transform: translateX(-50%);
}

@media (max-width: 600px) {
  .lightbox__stage {
    padding: 3.5rem 1rem;
  }

  .lightbox__nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .lightbox__nav--prev {
    left: 0.5rem;
  }

  .lightbox__nav--next {
    right: 0.5rem;
  }
}
