.canvas_personal {
  touch-action: none;
  position: fixed;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  background-color: rgb(247, 247, 247);
  height: 100%;
  width: 50%;
  box-shadow: rgba(0, 0, 0, 0.13) 3px 0px 3px;
  opacity: 0;
  left: -100%;
  overflow-y: auto;
}

.close_popup {
  position: absolute;
  right: 0;
  top: 0;
  margin: 1rem;
  z-index: 100;
}

.preview_outer {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview_inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.preview_header {
  margin-bottom: 0px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.preview_title {
  margin: 0;
  font-size: 20px;
  color: #333;
  font-weight: 600;
  padding-top: 10px;
  padding-left: 20px;
}

.preview_subtitle {
  margin: 8px 0 0 0;
  font-size: 14px;
  color: #666;
}

.preview_content_wrapper {
  /* flex: 1; */
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow-y: hidden;
}

.preview_content p {
  font-family: "NeuzeitGrotesk-Reg";
}

.giftcard_container {
  position: relative;
  /* width: 105mm;
  height: 148mm; */
  display: flex;
  align-items: center;
  justify-content: center;
  scale: 0.7;
}

.giftcard_image {
  width: 65%;
  height: 100%;
  object-fit: cover;
}

.giftcard_overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview_body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 50%;
}

.preview_title_body {
  width: 100%;
  text-wrap: wrap;
  text-align: center;
  line-height: 1;
  /* height: 120px; */
  display: flex;
  align-items: center;
}

.preview_title_body > div {
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preview_content {
  /* flex: 0 0 60%; */
  width: 100%;
  padding: 0 10px;
  overflow-y: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  
}

/* Custom scrollbar for overlay */
.giftcard_overlay::-webkit-scrollbar {
  width: 6px;
}

.giftcard_overlay::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.giftcard_overlay::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.giftcard_overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.preview_content > div {
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preview_content p:not([style*="margin"]) {
  margin: 0.5em 0;
}

.preview_content ul:not([style*="text-align"]),
.preview_content ol:not([style*="text-align"]) {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

@media only screen and (max-width: 768px) {
  .canvas_personal {
    width: 100%;
  }

  .preview_outer {
    padding: unset;
  }

  .preview_title {
    font-size: 16px;
  }

  .preview_content_wrapper {
    padding: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .giftcard_container {
    height: auto;
    max-width: 100%;
    width: 100%;
    transform: none;
    scale: unset;
  }

  .giftcard_overlay {
    width: 100%;
    padding: 0;
    overflow: hidden;
  }

  .giftcard_image {
    object-fit: contain;
    width: 100%;
  }


  .preview_body {
    width: 100%;
    transform: scale(1);
    transform-origin: center center;
  }

  .preview_title_body {
    width: 100% !important;
    scale: 0.6;
    margin-top: 40px !important;
    margin-bottom: -40px !important;

  }

  .preview_content {
    width: 130% !important;
    scale: 0.6;
    padding: 0 10px;
  }

  .close_popup {
    margin: 0.5rem;
  }
}
