@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inria Sans:wght@400;700&display=swap");

.bescdt-main-container {
  display: flex;
  column-gap: 30px;
  row-gap: 20px;
  width: 100%;
  justify-content: space-between;
  margin-right: 0 !important;
  margin-left: 0 !important;
  font-family: "Montserrat", sans-serif;
}

.bescdt-left-panel {
  width: 100%;
  min-width: 332px;
  max-width: 400px;
  border: 4px solid #9e8e7c;
}

.bescdt-left-panel-title {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 20px 0px;
  background: #9e8e7c;
  color: #fff;
  text-align: center;
  font-family: Montserrat;
  font-size: 22px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
}

.bescdt-section {
  padding: 20px 15px;
}

.bescdt-left-panel-subtitle {
  color: #5c5f61;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.48px;
  margin-top: 0;
}

.bescdt-form-group label {
  color: #9e8e7c;
  font-family: "Inria Sans";
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  min-width: 70px;
  display: inline-block;
}

.bescdt-form-group select {
  width: 75%;
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 20px;
  border: 1px solid #5b5e60;
}

.bescdt-form-group select:focus {
  outline: none;
}

.bescdt-form-group select,
.bescdt-form-group input,
.bescdt-form-group select option {
  color: #5c5f61;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.bescdt-form-group input {
  width: 75%;
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 20px;
  border: 1px solid #5b5e60;
}

.bescdt-form-group input:focus {
  outline: none;
}

.bescdt-color-pallete {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bescdt-color-item {
  flex: 1 0 30%;
  box-sizing: border-box;
  padding: 5px;
  max-width: calc(33.333% - 10px);
}

.bescdt-color-item img {
  width: 100%;
  max-width: 125px;
}

.bescdt-color-item label {
  color: #5c5f61;
  font-family: Montserrat;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  text-align: center;
  display: block;
}

.bescdt-button {
  color: #9e8e7c;
  font-family: "Inria Sans";
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  background-color: transparent;
  border: 2px solid #9e8e7c;
  display: inline-block;
  width: 100%;
  padding: 10px;
}

/* Download PDF button: disabled + "Loading..." during PDF generation to prevent double-clicks */
.bescdt-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bescdt-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.bescdt-modal-content {
  background-color: #fff;
  margin: 3% auto;
  padding: 20px 30px;
  width: 60%;
  border-radius: 8px;
  min-width: 250px;
}

.bescdt-close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.bescdt-modal h2 {
  margin-top: 0;
  text-align: left;
}

/* Match #svgWrapper total size (750 + 4px border each side = 758) so the border is visible in the customizer preview, same as in the PDF */
.bescdt-right-panel {
  width: 758px;
  max-height: 758px;
  overflow: hidden;
}

.bescdt-patterns {
  display: flex;
  justify-content: space-between;
}

/* .bescdt-patterns ul {
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
} */

.bescdt-patterns ul {
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
}

.bescdt-patterns ul li {
  text-align: center;
  box-sizing: border-box;
}

.bescdt-patterns ul li:hover {
  cursor: pointer;
}

.bescdt-patterns ul li:hover img {
  outline: 2px solid #9e8e7c;
}

.bescdt-patterns ul li:hover p {
  font-weight: 600;
  color: #9e8e7c;
}

.bescdt-patterns ul li p {
  margin-top: 5px;
}

.bescdt-pallete-top .bescdt-sub-text {
  text-align: center;
}

.bescdt-pallete-top ul {
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.bescdt-pallete-top .bescdt-top-controls {
  display: flex;
  padding-bottom: 20px;
  justify-content: center;
  gap: 20px;
}

.bescdt-top-controls button {
  border: 2px solid #9e8e7c;
  background: transparent;
  padding: 10px 30px;
  font-size: 14px;
  color: #9e8e7c;
  min-width: 150px;
  font-weight: 600;
  font-family: "Montserrat";
}

.bescdt-pallete-bottom {
  overflow-x: hidden;
  padding-bottom: 10px;
  max-height: 600px;
}

.bescdt-pallete-bottom ul {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: space-evenly;
}

.bescdt-pallete-bottom li {
  width: calc(100% / 8); /* 8 items per row */
  box-sizing: border-box;
  padding: 5px; /* optional spacing */
  text-align: center;
}

.bescdt-pallete-bottom ul li {
  max-width: 130px;
}

.bescdt-pallete-bottom ul li img {
  width: 100%;
}

.bescdt-pallete-bottom ul li p {
  font-size: 14px;
  word-wrap: break-word;
  text-align: center;
}

.bescdt-selected-item {
  position: relative;
  display: inline-block;
  margin: 5px;
}

.bescdt-selected-item img {
  max-width: 100px;
  /* border: 2px solid #ccc; */
  border-radius: 4px;
}

.bescdt-remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #9e8e7c;
  color: white;
  border-radius: 50%;
  padding: 0px 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  max-height: 23px;
  max-width: 23px;
}

.bescdt-right-panel canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#svgContainer {
  width: 750px;
  height: 750px;
  cursor: pointer;
}

.controls {
  margin: 20px;
}

#svgContainer svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.svg-wrapper {
  flex: 0 0 auto;
  transform: scale(9);
  /* transition: transform 0.3s ease; */
  transform-origin: top left;
}

.scale-3 {
  transform: scale(3) !important;
}
.scale-2 {
  transform: scale(1.5) !important;
}
.scale-1 {
  transform: scale(1) !important;
}

.svg-wrapper path {
  stroke-width: 0.5px !important;
}

.bescd-repeat-input {
  display: inline-block !important;
  margin-bottom: 4px !important;
  margin-top: 5px !important;
  width: 20px !important;
}

.bescd-repeat-label {
  display: flex !important;
  margin-bottom: 20px;
}

#bescd_brush {
  width: 100%;
  margin-top: 6px;
}

#bescd_brush_value {
  display: inline-block;
  margin-left: 8px;
  font-weight: 600;
}

.bescdt-patterns img {
  width: 250px;
  height: 250px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* .bescdt-main-container > div {
    flex: 1;
} */

/* Mobile view adjustments */
@media (max-width: 768px) {
  .bescdt-main-container > div:nth-child(2) {
    flex-basis: 100%; /* takes full width, moves below */
  }

  .bescdt-main-container {
    flex-direction: column;
    flex-wrap: wrap;
    row-gap: 20px;
  }
}

#svgWrapper {
  width: 750px;
  height: 750px;
  border: 4px solid #9e8e7c;
  overflow: hidden;
}

/* Prevent mobile tap highlight and blue selection when tapping canvas tiles to paint.
   Without this, the whole canvas can flash blue on tap. */
.bescdt-right-panel,
#pdf-content,
#svgWrapper,
#svgContainer,
#svgContainer svg,
#svgContainer .svg-wrapper,
#svgContainer path,
#svgContainer rect,
#svgContainer polygon {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.bescdt-right-panel:focus,
#svgWrapper:focus,
#svgContainer:focus,
#svgContainer svg:focus,
#svgContainer path:focus,
#svgContainer rect:focus,
#svgContainer polygon:focus {
  outline: none;
}
/* Hide any selection inside the canvas area so it doesn't show blue */
.bescdt-right-panel::selection,
#svgWrapper::selection,
#svgContainer::selection,
#svgContainer svg::selection,
#svgContainer path::selection,
#svgContainer rect::selection,
#svgContainer polygon::selection {
  background: transparent;
  color: inherit;
}

.disclaimer {
  color: #696c6f;
  font-size: 16px;
  text-align: center;
  line-height: 20px;
}

.disclaimer p {
  display: inline-block;
  max-width: 750px;
}
.bescdt-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bescdt-popup-box {
  background: #fff;
  padding: 20px 25px;
  border-radius: 8px;
  width: 400px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bescdt-popup-box h3 {
  margin-top: 0;
  margin-bottom: 0;
  color: #9e8e7c;
  font-size: 25px;
  font-family: "Inria Serif", Sans-serif;
}

.bescdt-popup-box p {
  font-size: 14px;
  margin-bottom: 15px;
}

.bescdt-popup-input {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

.bescdt-popup-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.bescdt-button-secondary {
  background: #ccc;
  color: #000;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}