/* Styles partagés du catalogue et de la navigation Admin. */
/* =========================
   GLOBAL
========================= */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: #f5f5f5;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
}

#subtitle {
  line-height: 1.5;
}

.copy-player-name {
  border: 0;
  padding: 0;
  background: none;
  color: #1f5fbf;
  font: inherit;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

.copy-player-icon {
  display: inline-block;
  margin-left: 0.25em;
  font-size: 0.9em;
  text-decoration: none;
}

.copy-player-name:hover,
.copy-player-name:focus-visible {
  color: #123d7a;
}

/* =========================
   FILTER
========================= */
.filter {
  margin-bottom: 20px;
  display: none; /* conservé comme tu l'avais */
  align-items: center;
  gap: 10px;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.filter label {
  font-weight: bold;
}

.backend-status-dot {
  position: fixed;
  top: 6px;
  left: 6px;
  z-index: 11000;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: #d71920;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.backend-status-dot.backend-gas {
  background: #d71920;
}

.backend-status-dot.backend-d1 {
  background: #1b9e3e;
}

html[data-frj-backend="gas"] .backend-status-dot {
  background: #d71920;
}

html[data-frj-backend="d1"] .backend-status-dot {
  background: #1b9e3e;
}

.filter select {
  padding: 5px;
  font-size: 1em;
}

/* =========================
   CARD CONTAINER
========================= */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

/* =========================
   CARD BASE
========================= */
.card {
  position: relative;
  width: 220px;
  height: 320px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);

  display: flex;
  flex-direction: column;
  align-items: center;

  overflow: hidden;
}

/* =========================
   CARD FRONT / BACK ANIMATION
========================= */
.card-front,
.card-back {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;

  transition: transform 0.45s ease;
}

/* front visible */
.card-front {
  transform: translateY(0);
}

/* back hidden */
.card-back {
  transform: translateY(100%);
  background: #eee;
  padding: 12px;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

.back-header {
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;
}

.back-header h3 {
  margin: 0;
  font-size: 1.1em;
}

.back-content {
  flex: 1;

  display: flex;
  flex-direction: column;
  justify-content: center; /* 🔥 CENTRAGE VERTICAL GLOBAL */
  align-items: center;

  gap: 8px;
  text-align: center;
  overflow-y: auto;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-row input {
  width: 80px;
  text-align: center;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* état ouvert */
.card.open .card-front {
  transform: translateY(-100%);
}

.card.open .card-back {
  transform: translateY(0);
}

/* bouton retour */
.back-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;

  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
}

/* =========================
   CALC ICON
========================= */
.calc-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  transition: 0.2s;
  color: #666;
}

.calc-icon:hover {
  opacity: 1;
  transform: scale(1.2);
}

.card:hover .calc-icon {
  color: #000;
  opacity: 1;
}

/* =========================
   TEXTES CARD
========================= */
.card h3 {
  margin: 10px 0 5px 0;
  font-size: 1.1em;
  text-align: center;
}

.card h3 a {
  text-decoration: none;
  color: #333;
}

.card h3 a:hover {
  text-decoration: underline;
}

.card p {
  margin: 5px 0;
  font-size: 0.9em;
  text-align: center;
}

/* =========================
   IMAGES
========================= */
.image-container {
  width: 100%;
  height: 150px;
  background: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.placeholder {
  width: 100%;
  height: 150px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
  border-radius: 4px;
}

/* =========================
   RAYON / HEADER
========================= */
.rayon-link {
  text-decoration: none;
  color: #337ab7;
  cursor: pointer;
}

.rayon-link:hover {
  color: #285e8e;
}

.label-italic {
  font-style: italic;
}

.MU-style {
  font-size: 8pt;
  font-style: italic;
}

.promo-sticker {
  position: absolute; top: -8px; right: -8px; z-index: 2;
  width: 78px; height: 78px;
  display: grid; place-items: center; pointer-events: none;
}
.promo-sticker.daily-promo.fr {
  background: url("../img/storage/Sticker Promo - FR.png") center/contain no-repeat;
}
.promo-sticker.daily-promo.en {
  background: url("../img/storage/Sticker Promo - EN.png") center/contain no-repeat;
}
.promo-sticker.sale.fr {
  background: url("../img/storage/Sticker Solde - FR.png") center/contain no-repeat;
}
.promo-sticker.sale.en {
  background: url("../img/storage/Sticker Solde - EN.png") center/contain no-repeat;
}
.promo-sticker span {
  color: #3c3a3a; font-weight: 800; font-size: 1rem;
  text-shadow: 0 1px 3px #000; transform: rotate(10deg);
}
.MU-style del, #calcSell del { opacity: .65; margin-right: 4px; }

.rayon-images {
  display: flex;
  flex-direction: column;
  gap: 10px;

  margin-bottom: 20px;
  background: #0a0d15;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#rayonImages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.rayon-img {
  width: 60px;
  height: auto;
  cursor: pointer;
  display: block;
  flex: none;
}

/* Cases historiques de 60x60 conservées, avec les mêmes espacements.
   PNG V19 52x38 => 60x43,846 centrés ; anciens PNG 44x44 => 60x60. */
.category-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.category-button:focus-visible {
  outline: 2px solid #a6d889;
  outline-offset: 3px;
}

.category-count {
  position: absolute;
  bottom: 11px;
  right: 5px;
  color: #a6d889;
  font: bold 9px/1 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.category-count[hidden] {
  display: none;
}

.inventory-design-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8e9caa;
  font-size: 11px;
  white-space: nowrap;
}

.inventory-design-control select {
  color-scheme: dark;
  font: inherit;
  color: #b4c1c8;
  background: #10181d;
  border: 1px solid #36464c;
  border-radius: 4px;
  height: 18px;
  padding: 0 3px;
}

.inventory-design-control select:focus-visible {
  outline: 1px solid #a6d889;
  outline-offset: 2px;
}

.rayon-header-container {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

/* Le témoin réserve exactement la hauteur précédente, quel que soit le design.
   La rangée de 40px utilise l'espace libre existant avant les boutons. */
.rayon-header-space {
  width: min(400px, 100%);
  aspect-ratio: 453 / 35;
  margin-inline: auto;
}

.inventory-header-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rayon-header-window {
  flex: 0 1 400px;
  width: 400px;
  min-width: 0;
}

/* Nouveaux PNG 350x60, affichés entiers à 40px de haut au maximum.
   Le flex ne réduit que l'image si la place manque, jamais le sélecteur. */
.rayon-header-window[data-design="v19"] {
  flex-basis: calc(350px * 40 / 60);
  width: calc(350px * 40 / 60);
}

.rayon-header {
  height: auto;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* =========================
   LOADING / EMPTY
========================= */
#loadingState {
  display: block;
  text-align: center;
  font-size: 16px;
  margin-top: 20px;
  color: #555;
}

#loadingState::before {
  content: "⏳ ";
}

#emptyState {
  display: block;
  position: relative;
  padding: 30px;
  text-align: center;
  background: #fff;
  border-radius: 10px;
  margin-top: 20px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}

#emptyText {
  text-align: left;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  color: #444;
}

#emptyText h2 {
  text-align: center;
  margin-top: 0;
}

#emptyText ul {
  padding-left: 20px;
  margin-top: 10px;
}

#emptyText li {
  margin-bottom: 5px;
}

#emptyText strong {
  color: #000;
}

.frj-member-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 18px;
  font-weight: bold;
  color: #222;
}

.frj-member-toggle input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* =========================
   LANG SWITCHER
========================= */
#langSwitcher {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 1000;
}

#langSwitcher button {
  margin-left: 5px;
  padding: 5px 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

#langSwitcher button.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

#langSwitcher button:hover {
  opacity: 0.8;
}

/* =========================
   TOAST (si encore utilisé ailleurs)
========================= */
.toast {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-80%);

  width: 300px;

  background: #fff;
  border: 2px solid #4a90e2;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);

  padding: 0;
  z-index: 9999;

  text-align: center;
}

.hidden {
  display: none;
}

.toast h3 {
  margin: 0;
  padding: 10px;
  background: #4a90e2;
  color: white;
  border-radius: 10px 10px 0 0;
}

.toast button {
  margin: 10px 0 15px;
  padding: 6px 12px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.toast button:hover {
  background: #357abd;
}

/* =========================
   HEADER LOGO
========================= */
#headerLogo {
  position: fixed;
  top: 20px;
  left: 20px;
  height: 60px;
  z-index: 1000;
}

/* =========================
   NAV ADMIN
========================= */
.admin-menu-drawer {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10000;
  width: min(920px, calc(100vw - 24px));
  height: 24px;
  transform: translateX(-50%);
  pointer-events: none;
}

.admin-menu-drawer.open {
  height: auto;
}

.admin-menu-toggle {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 24px;
  padding: 0;
  border: 1px solid #8c6b2e;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  color: #fff;
  background: rgba(43, 33, 19, 0.96);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}

.admin-menu-toggle-icon {
  display: block;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.admin-menu-drawer.open .admin-menu-toggle-icon {
  transform: rotate(180deg);
}

.admin-menu-toggle:hover,
.admin-menu-toggle:focus-visible {
  background: #5a4526;
}

.admin-menu {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 32px 10px 10px;
  background: rgba(245, 245, 245, 0.96);
  border: 1px solid #ccc;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(-100% - 4px));
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}

.admin-menu-drawer.open .admin-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.admin-menu a {
  padding: 8px 12px;
  border-radius: 6px;
  background: #ddd;
  color: #000;
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
}

.admin-menu a:hover {
  background: #bbb;
}

.admin-menu a.active {
  background: #333;
  color: #fff;
}

.site-visit-footer {
  display: flex;
  justify-content: flex-end;
  margin: 28px auto 0;
  padding: 12px 4px 0;
  border-top: 1px solid #d8d8d8;
  color: #777;
  font-size: 0.8rem;
}

.public-visit-counter {
  white-space: nowrap;
}

.admin-token-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.admin-token-dialog {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.admin-token-dialog h2 {
  margin: 0 0 18px;
}

.admin-token-field,
.admin-token-persist {
  display: flex;
  gap: 8px;
}

.admin-token-field {
  flex-direction: column;
  font-weight: bold;
}

.admin-token-field input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  font-family: monospace;
}

.admin-token-persist {
  align-items: center;
  margin-top: 16px;
}

.admin-token-help {
  margin: 7px 0 18px;
  color: #666;
  font-size: 0.85rem;
}

.admin-token-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-token-actions button {
  padding: 8px 14px;
  cursor: pointer;
}

.nav-admin {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 10px;
  z-index: 9999;
}

.nav-admin a {
  padding: 8px 14px;
  background: #ddd;
  color: #000;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

.nav-admin a:hover {
  background: #bbb;
}

.nav-admin a.active {
  background: #333;
  color: #fff;
}

@media (max-width: 800px) {
  .admin-menu-drawer {
    width: calc(100vw - 12px);
  }

  .admin-menu {
    max-height: calc(100vh - 12px);
    overflow-y: auto;
  }

  .admin-menu a {
    flex: 1 1 170px;
    text-align: center;
  }
}
.order-discount-marker {
	margin-left: .3em;
	font-size: .8em;
	font-weight: 500;
	color: #9a5b16;
}
