/* modal.css */
.modal {
  display: none;                 /* skjult som default */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8,12,20,.55); /* mørk overlay */
  justify-content: center;
  align-items: center;
}
.modal.show { display: flex; }

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 720px;
  width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.2rem;
  text-align: left;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  animation: fadeInModal .22s ease;
}

.modal-close {
  position: sticky;              /* følger med når man scroller indhold */
  top: .25rem;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 999px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 18px;
}

/* Indhold */
.modal-body img {
  display: block;
  margin: 0 auto 1rem;
  max-width: 100%;
  width: 100%;
  border-radius: 12px;
  margin: .6rem 0 1rem;
  display: block;
  object-fit: cover;
}
.modal-body h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.modal-body p  { margin: 0 0 .75rem; color: #3b3b3b; line-height: 1.55; }

/* Animation */
@keyframes fadeInModal {
  from { opacity: .6; transform: translateY(6px) scale(.98); }
  to   { opacity: 1;  transform: translateY(0)   scale(1);   }
}

/* Mobil: vis som “sheet” i bunden */
@media (max-width: 640px) {
  .modal { align-items: end; }
  .modal-content {
    width: 100vw;
    max-width: none;
    height: 88vh;
    max-height: none;
    border-radius: 16px 16px 0 0;
  }
}

/* Respektér brugere med reduceret motion */
@media (prefers-reduced-motion: reduce) {
  .modal-content { animation: none; }
}

.modal-body ul {
  margin: .6rem 0 0;
  padding-left: 1.2rem;
}
.modal-body li {
  margin: .35rem 0;
}
.modal-body strong {
  font-weight: 700;
}


/* Modal body styling for product cards */
.modal-body h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin: .25rem 0 1rem;
}

.modal-body p {
  text-align: left;
  font-size: 1rem;
  color: #3b3b3b;
  margin: 0 0 .9rem;
  line-height: 1.6;
}

.modal-body ul {
  margin: .6rem 0 0;
  padding-left: 1.3rem;
  text-align: left;
}
.modal-body li {
  margin: .4rem 0;
  font-size: 1rem;
  line-height: 1.5;
}

.modal-body img {
  display: block;
  margin: 0 auto 1rem;
  max-width: 280px; /* så pennen ikke fylder hele modalen */
  width: 100%;
  border-radius: 12px;
}
