:root {
  --variant-warning-border-color: rgba(255, 193, 7, 0.45);
  --variant-warning-background: rgba(255, 193, 7, 0.08);
}

.card {
  position: relative;
  overflow: visible !important;
  z-index: 1;
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 1rem rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.card-title-uniform {
  --card-title-max-size: 1.1;
  --card-title-min-size: 0.85;
  --card-title-step-size: 0.05;
  --card-title-line-height: 1.25;
  display: block;
  width: 100%;
  color: rgb(100, 255, 203) !important;
  cursor: pointer;
  font-size: calc(var(--card-title-max-size) * 1rem);
  line-height: var(--card-title-line-height);
  min-height: calc(var(--card-title-line-height) * 1.1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-size 0.2s ease;
}

.card-title-uniform.card-title-truncated {
  text-overflow: ellipsis;
}

.dropdown-menu {
  z-index: 1055 !important;
  position: absolute;
}

.btn-custom {
  color: rgb(100, 255, 203) !important;
  border: 1px solid rgb(100, 255, 203) !important;
  background-color: transparent;
}

.btn-custom:hover,
.btn-custom:focus {
  background-color: rgba(100, 255, 203, 0.1) !important;
  color: rgb(100, 255, 203) !important;
  border-color: rgb(100, 255, 203) !important;
}

.pagination .page-link {
  color: rgb(100, 255, 203) !important;
  background-color: transparent;
  border: 1px solid rgb(100, 255, 203) !important;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
  background-color: rgba(100, 255, 203, 0.1) !important;
  color: rgb(100, 255, 203) !important;
  border-color: rgb(100, 255, 203) !important;
}

.pagination .page-item.active .page-link {
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
  border-color: rgb(100, 255, 203) !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.4);
  background-size: 100% 100%;
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

#modifierImagesExistantes {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 100px;
  padding: 5px;
}

#modifierImagesExistantes img {
  max-height: 80px;
  border: 2px solid limegreen;
  display: block;
}

:root {
  --accent: rgb(100, 255, 203);
  --accent-weak: rgba(100,255,203,.15);
  --ring: rgba(100,255,203,.35);
}

[data-bs-theme="dark"] .modal-content-elevated,
.modal-content-elevated {
  background: radial-gradient(1200px 400px at 10% -10%, var(--accent-weak), transparent 30%) #0f1115;
  color: #e7ecef;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset;
}

/* petit “tag” à côté du titre */
.modal-pill {
  display:inline-block;
  font-size:.75rem;
  letter-spacing:.02em;
  padding:.25rem .5rem;
  border-radius:999px;
  border:1px solid var(--accent);
  color:#000;
  background: var(--accent);
}

/* panneau visuel pour les médias */
.media-panel {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: .75rem;
  overflow: hidden;
}

/* zoom doux sur les images */
.media-panel img {
  border-radius: 12px;
  transition: transform .3s ease, box-shadow .3s ease;
  cursor: zoom-in;
}
.media-panel img:hover {
  transform: scale(1.01);
  box-shadow: 0 18px 25px rgba(0,0,0,.35);
}

/* modale d'estimation harmonisée avec la modale élément */
.estimation-modal .estimation-form-panel,
#itemModal .estimation-form-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}

.estimation-modal .form-label,
#itemModal .form-label {
  font-weight: 600;
  color: #cdd6db;
}

.estimation-modal .form-control,
.estimation-modal .form-select,
#itemModal .form-control,
#itemModal .form-select {
  background: rgba(15,17,21,.85);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: #e7ecef;
  padding: .75rem 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.estimation-modal .form-control:focus,
.estimation-modal .form-select:focus,
#itemModal .form-control:focus,
#itemModal .form-select:focus {
  background: rgba(15,17,21,.95);
  border-color: rgba(100,255,203,.55);
  box-shadow: 0 0 0 .25rem var(--ring);
}

#itemModal .seller-highlight {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  padding: 1rem;
}

#itemModal .seller-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.35rem;
}

#itemModal .seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#itemModal .seller-note {
  border-radius: .85rem;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: inherit;
}

#itemModal .item-modal-contact {
  margin-top: 1.5rem;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  padding: 1.25rem;
}

#itemModal .item-modal-contact .contact-seller-form textarea {
  min-height: 120px;
}

#itemModal .item-modal-contact .contact-seller-alert {
  margin-bottom: 0;
}

[data-bs-theme="light"] #itemModal .item-modal-contact {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.08);
}

[data-bs-theme="light"] .estimation-modal .estimation-form-panel,
[data-bs-theme="light"] #itemModal .estimation-form-panel {
  background: #fafafa;
  border-color: rgba(0,0,0,.08);
}

[data-bs-theme="light"] .estimation-modal .form-label,
[data-bs-theme="light"] #itemModal .form-label {
  color: #222;
}

[data-bs-theme="light"] .estimation-modal .form-control,
[data-bs-theme="light"] .estimation-modal .form-select,
[data-bs-theme="light"] #itemModal .form-control,
[data-bs-theme="light"] #itemModal .form-select {
  background: #fff;
  border-color: rgba(0,0,0,.12);
  color: #111;
}

[data-bs-theme="light"] .estimation-modal .form-control:focus,
[data-bs-theme="light"] .estimation-modal .form-select:focus,
[data-bs-theme="light"] #itemModal .form-control:focus,
[data-bs-theme="light"] #itemModal .form-select:focus {
  background: #fff;
}

[data-bs-theme="light"] #itemModal .seller-highlight {
  background: #f8f9fa;
  border-color: rgba(0,0,0,.08);
}

[data-bs-theme="light"] #itemModal .seller-avatar {
  background: rgba(0,0,0,.05);
  color: #222;
}

[data-bs-theme="light"] #itemModal .seller-note {
  background: #fff;
  border-color: rgba(0,0,0,.08);
}

.estimations-modal #estimationsContent {
  padding: 1.25rem;
}

/* points du carrousel plus subtils */
.carousel-indicators [data-bs-target] {
  width: .5rem; height: .5rem;
  border-radius: 999px;
  background-color: rgba(255,255,255,.6);
}
.carousel-indicators .active { background-color: #fff; }

/* panneau d’infos */
.info-panel {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 1rem;
}
#itemModalInfo .serie-line {
  display: inline-flex;
  align-items: center;
}

/* liste d’info modernisée */
#itemModalInfo .list-group-item {
  background: transparent !important;
  border-color: rgba(255,255,255,.06);
  padding: .65rem .25rem;
}
#itemModalInfo strong {
  color: #cdd6db;
  font-weight: 600;
}

/* grille d’actions type “boutons cartes” */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
@media (min-width: 992px){
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
}
.actions-grid .btn {
  border-radius: 12px;
  padding: .6rem .75rem;
  border-width: 1px !important;
}

/* footer flottant */
.modal-footer-floating {
  border: 0;
  background: transparent;
  position: sticky;
  bottom: 0;
}

/* boutons existants : légère amélioration focus */
.btn-custom-green:focus, .btn-outline-custom-green:focus, .btn:focus {
  box-shadow: 0 0 0 .25rem var(--ring) !important;
}

/* Skeletons (chargement) */
.skeleton-parent { position: relative; }
.skeleton-img {
  width: 100%; aspect-ratio: 4/3; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06));
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}
.skeleton-dots { height: .75rem; width: 40%; margin: .5rem auto 0; border-radius: 999px; background: rgba(255,255,255,.08); }
@keyframes skeleton { 0%{background-position:0 0} 100%{background-position:-200% 0} }

/* light mode petits ajustements */
[data-bs-theme="light"] .modal-content-elevated {
  background:#fff;
  color:#111;
  border:1px solid rgba(0,0,0,.06);
}
[data-bs-theme="light"] .info-panel, 
[data-bs-theme="light"] .media-panel {
  background:#fafafa;
  border:1px solid rgba(0,0,0,.06);
}

/* ======= Info grid (2 colonnes) ======= */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem 1rem;               /* espace vertical/horizontal */
}

@media (max-width: 575.98px) {
  .info-grid { grid-template-columns: 1fr; } /* 1 colonne en mobile */
}

/* Chaque ligne "label / valeur" prend toute la largeur de la colonne */
.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;  /* label fixe + valeur flexible */
  align-items: center;
  gap: .5rem;
  padding: .5rem .25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
[data-bs-theme="light"] .info-row {
  border-color: rgba(0,0,0,.06);
}

.info-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: #cdd6db;
}
[data-bs-theme="light"] .info-label { color: #222; }

.info-ico {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(100,255,203,.12);
  border: 1px solid rgba(100,255,203,.35);
}

.info-ico svg {
  width: 14px; height: 14px;
  display: block;
  stroke: var(--accent);
}

.info-value {
  color: #e7ecef;
}
[data-bs-theme="light"] .info-value { color: #111; }

/* Spécifiques à ta ligne "Série" déjà illustrée */
#itemModalInfo .serie-line { display: inline-flex; align-items: center; gap: .5rem; }

/* On neutralise les styles Bootstrap de la liste initiale */
#itemModalInfo .list-group,
#itemModalInfo .list-group-flush { all: unset; display: contents; }
#itemModalInfo .list-group-item { all: unset; display: contents; }
/* --- PATCH overflow panneau infos --- */
.info-panel {
  overflow: hidden;                /* coupe toute fuite visuelle */
}

/* La grille peut se rétrécir sans créer de débordement */
.info-grid { 
  min-width: 0; 
}

/* 2 colonnes : label borné + valeur flexible qui wrappe */
.info-row {
  display: grid;
  grid-template-columns: clamp(120px, 32%, 220px) minmax(0, 1fr);
  align-items: start;              /* évite les icônes qui tirent la ligne vers le bas */
  gap: .5rem;
  padding: .5rem .25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-width: 0;                    /* indispensable pour que les enfants puissent rétrécir */
}

.info-label { min-width: 0; }
.info-value { 
  min-width: 0; 
  overflow-wrap: anywhere;         /* casse “Dernière valeur unitaire … au 2025-..” si besoin */
  word-break: break-word;
  white-space: normal;             /* force le retour à la ligne */
}

/* Dans certains cas Bootstrap impose une largeur au modal, on borne proprement */
.modal-dialog.modal-xl {
  max-width: min(1200px, calc(100vw - 2rem));
}

/* Modale élément : centrage garanti + largeur fluide */
#itemModal .modal-dialog {
  margin-inline: auto;
  max-width: min(960px, calc(100vw - 2rem));
}

#itemModal .modal-content {
  width: 100%;
}

.modal-content-elevated { overflow: hidden; }   /* arrondis propres + pas de fuite */

/* Si une valeur contient des <small> sur 2 lignes, on adoucit la hiérarchie */
.info-value small { opacity: .75; display: block; line-height: 1.2; margin-top: .125rem; }
/* --- METTRE L'INFO EN AVANT AU LIEU DU LABEL --- */

/* Titre = plus discret */
.info-label {
  font-weight: 400 !important;
  color: #8f9ba4 !important; /* gris doux */
}

/* Icône moins flashy */
.info-ico {
  background: transparent !important;
  border: 1px solid rgba(100,255,203,.25) !important;
  opacity: .65;
}

/* Valeur = mise en avant */
.info-value {
  font-weight: 600 !important;  /* gras */
  color: #eafff7 !important;    /* vert/blanc doux */
}

/* Petits labels secondaires (dates) */
.info-value small {
  opacity: .7 !important;
  font-weight: 400 !important;
}

/* Optionnel : hover subtil pour rendre “vivant” */
.info-row:hover .info-value {
  text-shadow: 0 0 6px rgba(100,255,203,.35);
}

.btn-custom-green {
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
  border: none;
}

.btn-custom-green:hover {
  background-color: rgb(80, 230, 185) !important;
}

.btn-outline-custom-green {
  color: rgb(100, 255, 203) !important;
  border: 1px solid rgb(100, 255, 203) !important;
}

[data-bs-theme="light"] .btn-outline-custom-green {
  color: #000 !important;
}

.btn-outline-custom-green:hover {
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
}

.back-to-top-button {
  position: fixed;
  right: 1.5rem;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 2050;
  font-size: 1.25rem;
  font-weight: 700;
}

.back-to-top-button.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.mobile-add-button {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0));
  z-index: 1039;
  display: none;
}

.mobile-add-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.mobile-add-actions .btn {
  flex: 1 1 0;
}

.mobile-add-button .btn {
  border-radius: 999px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
  font-weight: 600;
  white-space: nowrap;
  padding-inline: 1.75rem;
}

@media (max-width: 767.98px) {
  .mobile-add-button {
    display: block;
  }
}

#ajouterModal.quick-scan-active #fastAllowDupWrapper,
#ajouterModal.quick-scan-active #fastFollowCardmarketWrapper,
#ajouterModal.quick-scan-active #publicToggleCardSlot {
  display: none !important;
}

#ajouterModal.quick-scan-active #captureModeSection .card-info-chip {
  display: none !important;
}

#ajouterModal.quick-scan-active .step-nav .btn-prev {
  display: none !important;
}

.toast-subtitle {
  color: #000;
}

.btn-outline-custom-green-danger {
  color: rgb(100, 255, 203) !important;
  border: 1px solid rgb(100, 255, 203) !important;
  background-color: transparent !important;
  transition: 0.2s ease;
}

.manual-mode-results {
  max-height: min(65vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
}

#carte-mode-options .mode-option {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  color: inherit;
  cursor: pointer;
  display: flex;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    color 0.2s ease, border-color 0.2s ease;
}

#carte-mode-options .mode-option .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#carte-mode-options .mode-option:hover {
  transform: translateY(-2px);
}

#carte-mode-options .mode-option:focus-visible {
  outline: 2px solid rgba(100, 255, 203, 0.65);
  outline-offset: 4px;
}

#carte-mode-options .mode-option .card-title,
#carte-mode-options .mode-option .card-text,
#carte-mode-options .mode-option .form-check-label,
#carte-mode-options .mode-option small {
  color: inherit;
}

#carte-mode-options .mode-option .form-check-input {
  accent-color: rgb(100, 255, 203);
}

#carte-mode-options .mode-option.selected {
  background-color: rgb(100, 255, 203) !important;
  border: none;
  box-shadow: 0 0 0 0.2rem rgba(100, 255, 203, 0.35);
  color: #000 !important;
}

#carte-mode-options .mode-option.selected .card-title,
#carte-mode-options .mode-option.selected .card-text,
#carte-mode-options .mode-option.selected .form-check-label,
#carte-mode-options .mode-option.selected small {
  color: #000 !important;
}

#carte-mode-options .mode-option.selected .form-check-input {
  accent-color: #000;
  border-color: rgba(0, 0, 0, 0.6);
}

.manual-mode-results > .list-group-item:last-child {
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.manual-mode-results > .list-group-item:first-child {
  border-top-right-radius: inherit;
  border-top-left-radius: inherit;
}

.btn-outline-custom-green-danger:hover {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

#settingsModal .nav-link {
  color: rgb(100, 255, 203) !important;
}

#settingsModal .nav-link.active {
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
}

.fade-transition {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Dropdown personnalisé */
.custom-dropdown {
  background-color: #1e1e1e;
  border: 1px solid rgb(100, 255, 203);
  padding: 0.25rem;
}

.custom-dropdown .dropdown-item {
  color: white;
  padding: 0.4rem 1rem;
  transition: background-color 0.2s;
}

.custom-dropdown .dropdown-item:hover {
  background-color: rgba(100, 255, 203, 0.2);
  color: rgb(100, 255, 203);
}

[data-bs-theme="light"] .custom-dropdown {
  background-color: #fff;
  color: #000;
}

[data-bs-theme="light"] .custom-dropdown .dropdown-item {
  color: #000;
}

[data-bs-theme="light"] .modal-content {
  background-color: #fff;
  color: #000;
}

.custom-dropdown .dropdown-item.active-collection {
  background-color: rgb(100, 255, 203);
  color: #000;
  font-weight: bold;
}
.result-color {
  color: rgb(100, 255, 203) !important;
}
@media (max-width: 768px) {
  #filtersCollapse .form-select,
  #filtersCollapse .form-control,
  #filtersCollapse .btn {
    margin-bottom: 10px;
  }
}

.selection-checkbox {
  z-index: 60;
  transform: scale(1.2);
}

.collection-item.selected .card {
  border: 2px solid rgb(100, 255, 203) !important;
  box-shadow: 0 0 5px rgba(100, 255, 203, 0.5);
}

/* Wrapper allowing badge overlays to escape while clipping carousel transitions */
.card-image-container {
  position: relative;
}

.card-image-frame {
  position: relative;
  overflow: hidden;
  border-top-left-radius: var(--bs-card-inner-border-radius, 0.5rem);
  border-top-right-radius: var(--bs-card-inner-border-radius, 0.5rem);
}

.card-image-frame .carousel-inner,
.card-image-frame .carousel-item {
  overflow: hidden;
}

.collection-item-missing .card {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background-color: rgba(148, 163, 184, 0.08);
  box-shadow: none;
}

.collection-item-missing .missing-card-frame,
.collection-item-missing .missing-card-image-wrapper {
  max-height: 400px;
}

.collection-item-missing .missing-card-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-item-missing .missing-card-image {
  filter: grayscale(100%);
  opacity: 0.85;
  object-fit: cover;
  max-height: 400px;
  width: 100%;
  cursor: pointer;
}

.collection-item-missing .card:hover .missing-card-image {
  filter: none;
  opacity: 1;
}

.collection-item-missing .card:hover {
  transform: none;
}

.collection-item-missing .missing-card-image-placeholder {
  min-height: 400px;
  font-size: 0.9rem;
  background-color: rgba(15, 23, 42, 0.35);
  border-radius: inherit;
}

.collection-item-missing .badge-serie,
.collection-item-missing .missing-card-type {
  opacity: 0.85;
}

.collection-item-missing .missing-card-number {
  color: rgba(148, 163, 184, 0.9) !important;
}

.collection-item-missing .missing-card-placeholder .placeholder-line {
  height: 10px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.collection-item-missing .missing-card-placeholder .placeholder-line:last-child {
  margin-bottom: 0;
}

.collection-item-missing .missing-card-notice {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
}

.collection-item-missing .missing-card-info-chip {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background-color: rgba(148, 163, 184, 0.12);
  color: rgba(191, 201, 214, 0.95);
}

.collection-item-missing .missing-card-info-chip .info-chip-icon {
  background-color: rgba(148, 163, 184, 0.2);
  color: rgba(191, 201, 214, 0.95);
}

.collection-item-missing .missing-card-info-chip .info-chip-value,
.collection-item-missing .missing-card-info-chip .info-chip-meta {
  color: rgba(191, 201, 214, 0.95);
}

body.missing-cards-colored .collection-item-missing .card {
  border: 1px solid rgba(100, 255, 203, 0.35);
  background-color: rgba(15, 23, 42, 0.55);
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.45);
}

body.missing-cards-colored .collection-item-missing .missing-card-image {
  filter: none;
  opacity: 1;
}

body.missing-cards-colored .collection-item-missing .missing-card-image-placeholder {
  background-color: rgba(15, 23, 42, 0.45);
}

body.missing-cards-colored .collection-item-missing .badge-serie,
body.missing-cards-colored .collection-item-missing .missing-card-type {
  opacity: 1;
}

body.missing-cards-colored .collection-item-missing .missing-card-number {
  color: rgba(226, 232, 240, 0.95) !important;
}

body.missing-cards-colored .collection-item-missing .missing-card-placeholder .placeholder-line {
  background: rgba(100, 255, 203, 0.22);
}

body.missing-cards-colored .collection-item-missing .missing-card-notice {
  color: rgba(226, 232, 240, 0.85);
}

body.missing-cards-colored .collection-item-missing .missing-card-info-chip {
  border: 1px dashed rgba(100, 255, 203, 0.45);
  background-color: rgba(100, 255, 203, 0.12);
  color: inherit;
}

body.missing-cards-colored .collection-item-missing .missing-card-info-chip .info-chip-icon {
  background-color: rgba(100, 255, 203, 0.22);
  color: inherit;
}

body.missing-cards-colored .collection-item-missing .missing-card-info-chip .info-chip-value,
body.missing-cards-colored .collection-item-missing .missing-card-info-chip .info-chip-meta {
  color: inherit;
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.12);
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-image-placeholder {
  background-color: rgba(148, 163, 184, 0.18);
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-number {
  color: rgba(15, 23, 42, 0.75) !important;
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-placeholder .placeholder-line {
  background: rgba(45, 212, 191, 0.2);
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-notice {
  color: rgba(71, 85, 105, 0.85);
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-info-chip {
  border: 1px dashed rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.12);
  color: rgba(15, 23, 42, 0.85);
}

body.missing-cards-colored[data-bs-theme="light"] .collection-item-missing .missing-card-info-chip .info-chip-icon {
  background-color: rgba(16, 185, 129, 0.18);
  color: rgba(15, 23, 42, 0.85);
}

.missing-card-loading {
  font-size: 0.9rem;
  padding: 1rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .collection-item-missing .card {
    transition: none;
  }
}

.image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}
.image-wrapper > img {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.image-wrapper > img.loaded {
  opacity: 1;
}
.badge-overlay {
  position: absolute;
  z-index: 30;
  display: flex;
  align-items: center;
  overflow: visible !important; /* Autorise l'affichage des dropdowns hors du badge */
}
.badge-overlay-top-left {
  top: 0.75rem;
  left: 0.75rem;
  z-index: 40;
}
.badge-overlay-top-right {
  top: 0.75rem;
  right: 0.75rem;
}
.badge-overlay-bottom-left {
  bottom: 0.75rem;
  left: 0.75rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.badge-overlay-bottom-right {
  bottom: 0.75rem;
  right: 0.75rem;
}
.card-image-container.has-profile-overlay .badge-overlay-bottom-left {
  bottom: 3.5rem;
}
.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px; /* centrer le spinner */
    border: 4px solid #ccc;
    border-top-color: #3498db; /* couleur de la partie animée */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive navbar adjustments */
@media (max-width: 991.98px) {
  .navbar-nav .nav-item {
    width: 100%;
    margin-bottom: 0.5rem;
  }
.navbar-nav .nav-item:last-child {
  margin-bottom: 0;
}
}

.btn-favorite-toggle {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8f9fa;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-favorite-toggle .favorite-heart {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
}

.btn-favorite-toggle:hover {
  transform: scale(1.05);
  background-color: rgba(0, 0, 0, 0.75);
  color: #ffffff;
}

.btn-favorite-toggle.is-favorite {
  background-color: rgba(220, 53, 69, 0.85);
  border-color: rgba(220, 53, 69, 0.3);
  color: #fff;
}

.btn-favorite-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.35);
}

.btn-favorite-toggle.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.badge-estim-count {
  background-color: rgb(100, 255, 203) !important;
  color: #000 !important;
  margin-left: 0.75rem;
}

.badge-type {
  background-color: rgb(100, 108, 255) !important;
  color: #000 !important;
  cursor: pointer;
}

.badge-etat {
  background-color: rgb(100, 227, 255) !important;
  color: #000 !important;
  cursor: pointer;
}

.badge-etat-dropdown .badge-etat {
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.badge-etat-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

.badge-etat-wrapper .variant-empty-indicator--etat {
  flex: 0 0 auto;
}

.badge-etat-dropdown .badge-etat:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

[data-bs-theme="light"] .badge-etat-dropdown .badge-etat:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
}

.dropdown-menu-etat {
  min-width: 13rem;
  max-height: 18rem;
  overflow-y: auto;
  z-index: 1080;
}

.dropdown-item.active,
.dropdown-item:active {
  color: #313131;
  text-decoration: none;
  background-color: rgb(100, 255, 203) !important;
}

.dropdown-menu-etat .dropdown-item.active {
  font-weight: 600;
}

.dropdown-menu-etat .dropdown-item[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.badge-etat-empty {
  border: 1px dashed var(--variant-warning-border-color) !important;
  background-color: rgb(255 236 7 / 70%) !important;
  color: rgba(133, 93, 0, 0.92) !important;
  pointer-events: auto;
}

.badge-estimation {
  background-color: rgb(243, 255, 100) !important;
  color: #000 !important;
}

.badge-on-sale {
  background-color: rgb(232, 100, 255) !important;
  color: #000 !important;
}

.badge-serie {
  background-color: rgb(255, 122, 100) !important;
  color: #000 !important;
  cursor: pointer;
}

.badge-serie img.serie-symbol {
  height: 1em;
}

.badge-public {
  background-color: rgb(255 100 176) !important;
  color: #FFF !important;
}

.variant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.04);
  justify-content: flex-start;
}

.variant-badges.card-info-chip {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
  justify-content: flex-start;
}

[data-bs-theme="light"] .variant-badges,
[data-bs-theme="light"] .variant-badges.card-info-chip {
  border-color: rgba(0, 0, 0, 0.18);
  background-color: rgba(0, 0, 0, 0.03);
}

.variant-badges-empty {
  position: relative;
  border: 1px dashed var(--variant-warning-border-color);
  border-radius: 0.75rem;
  padding: 0.85rem 0.75rem 0.65rem;
  background-color: var(--variant-warning-background);
}

.variant-empty-indicator {
  position: absolute;
  top: -0.7rem;
  right: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px dashed var(--variant-warning-border-color);
  background-color: var(--variant-warning-background);
  color: rgba(133, 93, 0, 0.95);
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 1;
}

.variant-empty-indicator--etat {
  position: static;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.variant-warning-highlight,
.card-info-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  width: 100%;
  position: relative;
}

.variant-warning-highlight {
  border: 1px dashed var(--variant-warning-border-color);
  background-color: var(--variant-warning-background);
}

.card-info-chip.variant-warning-highlight {
  border: 1px dashed var(--variant-warning-border-color);
  border-radius: 0.75rem;
  background-color: var(--variant-warning-background);
}

.card-info-chip {
  border: 1px dashed rgb(100, 255, 203);
  background-color: rgb(100 255 203 / 10%);
}


.serie-summary-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.35));
  flex: 0 0 auto;
}

.serie-info-chip {
  flex: 1 1 100%;
  width: 100%;
  max-width: none;
  background-color: rgba(100, 255, 203, 0.08);
}

.serie-info-chip .info-chip-content {
  align-items: stretch;
  flex-wrap: wrap;
  overflow: visible;
  gap: 0.75rem;
}

.serie-summary-header {
  flex: 1 1 100%;
}

.serie-info-chip .info-chip-meta {
  white-space: normal;
  line-height: 1.35;
}


#serie-summary {
  width: 100%;
}

.serie-summary-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1.25rem;
  margin-top: 0.25rem;
  flex: 1 1 320px;
  min-width: 250px;
}

.serie-summary-meta-item {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.9);
}

.serie-summary-meta-label::after {
  content: ':';
  margin-right: 0.25rem;
}

.serie-summary-meta-label {
  font-weight: 500;
  color: rgba(226, 232, 240, 0.9);
}

.serie-summary-meta-value {
  font-weight: 700;
  color: rgba(226, 232, 240, 0.95);
}

.serie-summary-meta-suffix {
  font-weight: 500;
  color: rgba(148, 163, 184, 0.9);
}

.serie-summary-meta-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: help;
  color: #fbbf24;
}

.serie-summary-meta-item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: rgb(100, 255, 203);
  font-weight: 700;
}

.serie-summary-progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0;
  flex: 0 1 260px;
  min-width: 200px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .serie-summary-progress {
    flex: 1 1 100%;
    min-width: 0;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

.serie-summary-progress-entry {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.serie-summary-progress-bar-container {
  height: 0.65rem;
  background-color: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
  overflow: hidden;
}

.serie-summary-progress-bar {
  background: linear-gradient(90deg, rgba(100, 255, 203, 0.85), rgba(56, 189, 248, 0.9));
}

.serie-summary-progress-label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.collection-item-missing .missing-card-image-placeholder.missing-card-clickable {
  cursor: pointer;
}

.missing-card-clickable {
  cursor: pointer;
}

/* Catalogue */
.page-catalogue .catalogue-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-catalogue .catalogue-search-header h1 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem);
  margin: 0;
}

.page-catalogue .catalogue-search-intro {
  color: rgba(226, 232, 240, 0.75);
}

[data-bs-theme="light"] .page-catalogue .catalogue-search-intro {
  color: rgba(30, 41, 59, 0.65);
}

.catalogue-search-input {
  max-width: 420px;
}

.catalogue-card.card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catalogue-card.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.45);
}

[data-bs-theme="light"] .catalogue-card.card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.catalogue-card-image-wrapper {
  position: relative;
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.2), rgba(15, 23, 42, 0.65));
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 63 / 88;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalogue-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.catalogue-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.95rem;
  padding: 1rem;
}

[data-bs-theme="light"] .catalogue-card-placeholder {
  color: rgba(30, 41, 59, 0.7);
}

.catalogue-card .badge {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalogue-card-variants .badge {
  background: rgba(100, 255, 203, 0.12);
  color: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(100, 255, 203, 0.4);
}

[data-bs-theme="light"] .catalogue-card-variants .badge {
  background: rgba(16, 185, 129, 0.12);
  color: rgba(15, 23, 42, 0.85);
  border-color: rgba(16, 185, 129, 0.35);
}

.catalogue-result-meta {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.95rem;
}

[data-bs-theme="light"] .catalogue-result-meta {
  color: rgba(71, 85, 105, 0.9);
}

.catalogue-empty-state {
  color: rgba(148, 163, 184, 0.85);
  font-size: 1rem;
}

[data-bs-theme="light"] .catalogue-empty-state {
  color: rgba(71, 85, 105, 0.85);
}

.info-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.08);
  color: rgb(100, 255, 203);
  flex: 0 0 auto;
  font-size: 1rem;
}

.info-chip-icon--cardmarket {
  background-color: rgba(100, 142, 255, 0.18);
  color: rgb(100, 142, 255);
}

.info-chip-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.info-chip-icon svg text {
  font-family: inherit;
  dominant-baseline: middle;
}

.info-chip-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow: hidden;
}

.info-chip-content--stacked {
  flex-direction: row;
  align-items: baseline;
  gap: 0.35rem;
}

.info-chip-content--stacked .info-chip-meta {
  font-size: clamp(0.5rem, calc(0.2rem + 0.7vw), 0.72rem);
}

.info-chip-value,
.info-chip-meta {
  white-space: nowrap;
  min-width: 0;
}

.info-chip-value {
  font-weight: 600;
  font-size: clamp(0.62rem, calc(0.3rem + 1.4vw), 0.95rem);
}

.info-chip-meta {
  font-size: clamp(0.55rem, calc(0.25rem + 1vw), 0.82rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.variant-empty-indicator span {
  display: block;
  line-height: 1;
}

.variant-empty-indicator:focus-visible {
  outline: 2px solid rgba(33, 37, 41, 0.4);
  outline-offset: 2px;
}

.variant-empty-indicator:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.badge-variant {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.58) !important;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35em 0.85em;
  line-height: 1;
  user-select: none;
  min-height: 1.75rem;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.badge-variant:focus-visible {
  outline: 2px solid rgba(100, 255, 203, 0.6);
  outline-offset: 2px;
}

button.badge-variant {
  background: transparent;
  border: none;
}

.badge-variant-toggle,
.variant-choice {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

[data-bs-theme="light"] .badge-variant {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: rgba(0, 0, 0, 0.68) !important;
  border-color: rgba(0, 0, 0, 0.18);
}

.variant-empty-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #ffda6a;
  background-color: rgba(255, 193, 7, 0.1);
  border: 1px dashed rgba(255, 193, 7, 0.45);
  border-radius: 0.75rem;
  padding: 0.4rem 0.75rem;
  margin-top: 0.5rem;
}

.variant-empty-hint i {
  font-size: 1rem;
}

.badge-variant-toggle:not([disabled]):hover,
.variant-choice:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.78) !important;
}

[data-bs-theme="light"] .badge-variant-toggle:not([disabled]):hover,
[data-bs-theme="light"] .variant-choice:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.22);
  color: rgba(0, 0, 0, 0.75) !important;
}

.badge-variant[disabled] {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.38) !important;
  border-color: rgba(255, 255, 255, 0.18);
}

[data-bs-theme="light"] .badge-variant[disabled] {
  color: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(0, 0, 0, 0.16);
}

.badge-variant-loading {
  opacity: 0.55;
  pointer-events: none;
}

.badge-variant-owned {
  background-color: rgba(100, 255, 203, 0.2) !important;
  color: rgb(100, 255, 203) !important;
  border-color: rgba(100, 255, 203, 0.55);
  border-style: solid;
}

[data-bs-theme="light"] .badge-variant-owned {
  background-color: rgba(25, 135, 84, 0.12) !important;
  color: rgb(25, 135, 84) !important;
  border-color: rgba(25, 135, 84, 0.35);
}

.badge-first-edition {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.4);
}

.badge-first-edition .first-edition-icon {
  height: 20px;
  width: auto;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  filter: grayscale(1);
  opacity: 0.65;
}

[data-bs-theme="light"] .badge-first-edition .first-edition-icon {
  background-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.badge-variant-owned.badge-first-edition .first-edition-icon {
  background-color: rgb(100, 255, 203) !important;
  filter: none;
  opacity: 1;
}

.badge-user-points {
  background-color: rgb(180, 180, 180) !important;
  color: #000 !important;
  font-size: 0.75rem;
  padding: 0.25em 0.45em;
}

.badge-completion-official {
  background-color: rgb(160, 255, 100) !important;
  color: #000 !important;
}

.badge-completion-total {
  background-color: rgb(100, 190, 255) !important;
  color: #000 !important;
}

.profile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 4px;
  border-top-right-radius: 0.5rem;
  display: flex;
  align-items: center;
}

.profile-overlay img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-overlay span {
  color: rgb(100, 255, 203);
  font-size: 0.85rem;
}

#rapportGlobalModal .card,
#rapportGlobalModal .card-header {
  background-color: #333 !important;
  color: #fff !important;
}
#rapportGlobalModal .card-header h6 {
  color: #fff !important;
}

/* Step form horizontal layout */
.form-steps-wrapper {
  overflow: hidden;
  transition: height 0.3s ease;
}

/* Chaque étape est affichée comme une page indépendante */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.step-nav {
  background-color: inherit;
}
.impersonation-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ffc107;
  color: #000;
  text-align: center;
  padding: 0.5rem;
  z-index: 1100;
}

body.has-impersonation-bar {
  margin-top: 3rem;
}

footer a {
  font-size: 12px;
  color: rgb(100, 255, 203) !important;
  text-decoration: auto;
}

footer a:hover {
  color: rgb(100, 255, 203) !important;
  text-decoration: auto;
}

.toast-cardmarket-price {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: inherit;
}

.toast-cardmarket-price__logo {
  height: 20px;
  width: auto;
  display: block;
}

.toast-cardmarket-price__value {
  font-weight: 600;
}

/* Masonry layout powered by CSS grid + JS row spanning */
.collection-masonry {
  --masonry-gap: 0.75rem;
  --masonry-columns: 1;
  display: grid;
  grid-template-columns: repeat(var(--masonry-columns), minmax(0, 1fr));
  gap: var(--masonry-gap);
  grid-auto-flow: dense;
  grid-auto-rows: var(--masonry-row-height);
  align-items: start;
}

.collection-masonry:not(.collection-masonry--hydrated) {
  grid-auto-rows: auto;
}

.collection-masonry .collection-item {
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

/* Responsive column counts mirroring the legacy layout */
@media (min-width: 576px) {
  .collection-masonry { --masonry-columns: 2; }
}
@media (min-width: 768px) {
  .collection-masonry { --masonry-columns: 3; }
}
@media (min-width: 992px) {
  .collection-masonry { --masonry-columns: 4; }
}

/* Ensure cards stretch horizontally within their grid cell */
.collection-masonry .card { display: block; }
