/* Style minimal pour les composants personnalisés de RéuniPrint3D
   (le layout général est géré par TailwindCSS dans index.html) */

/* Scroll fluide pour les ancres */
html {
  scroll-behavior: smooth;
}

/* Bouton flottant vers la boutique */
.shop-fab {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #2563eb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  z-index: 1100;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.shop-fab svg {
  width: 26px;
  height: 26px;
  display: block;
}

@media (hover:hover) {
  .shop-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
  }
}

.shop-fab:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}

/* Mode sombre */
/*@media (prefers-color-scheme: dark) {
  .shop-fab {
    background: #1e1e1e;
    color: #90caf9;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  }
}*/

/* Galerie d'images */
.images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.images img {
  width: 100%;
  display: block;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  /* même format pour toutes les vignettes */
  aspect-ratio: 4 / 5;   /* tu peux mettre 1 / 1 pour des carrés */
}

.images img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Bouton fermer */
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
}

/* Flèches prev/next */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem;
}

.lightbox-prev {
  left: 2rem;
}
.lightbox-next {
  right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  color: #e5e7eb;
}

/* Badges de matériau + infobulle */
.material-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.hint {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hint:hover,
.hint:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.hint.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
  .hint.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
  }
}

/* Infobulle positionnée par le JS */
.tooltip {
  position: fixed;
  max-width: 300px;
  background: #111827;
  color: #f9fafb;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 999;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 16px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #111827 transparent;
}

/* Sélecteur de couleur */
.color-options {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.color-options input[type="radio"] {
  display: none;
}

.color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Couleurs des cercles (adapter si besoin) */
#color-white + .color-circle { background: #faf8f5; }
#color-black + .color-circle { background: #111827; }
#color-marbre + .color-circle { background: #e5e7eb; background-image: linear-gradient(135deg,#d1d5db 0%,#f9fafb 40%,#9ca3af 100%); }
#color-purple + .color-circle { background: linear-gradient(135deg,#a855f7,#6366f1); }
#color-green + .color-circle { background: #bbf7d0; }
#color-brown + .color-circle { background: #78350f; }
#color-green-dark + .color-circle { background: #166534; }

.color-options input[type="radio"]:checked + .color-circle {
  border-color: #2563eb;
}

/* Bouton d'envoi en état de chargement */
button[type="submit"].is-loading {
  position: relative;
  padding-left: 2.6rem; /* laisse la place pour le spinner */
  cursor: progress;
}

button[type="submit"].is-loading::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: -0.55rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-top-color: transparent;
  animation: btnspin 0.6s linear infinite;
}

button[type="submit"][disabled] {
  opacity: 0.8;
  cursor: not-allowed;
}

@keyframes btnspin {
  to {
    transform: rotate(360deg);
  }
}
