body {
  margin: 0;
  font-family: "Segoe UI", sans-serif; /*overflow-y: hidden;*/
} /* Top Bar */
.top-bar {
  background-color: #444;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 1rem;
  font-size: 18px;
  font-weight: bold;
}
.top-bar-right span,
.top-bar-right a {
  margin-left: 16px;
  color: white;
  text-decoration: none;
  font-weight: normal;
}
.top-bar-right i {
  margin-right: 4px;
} /* Middle Bar */
.middle-bar {
  background-color: white;
  padding: 5px 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.middle-bar .logo {
  height: 40px;
}
.configurator-title {
  font-size: 20px;
  font-weight: bold;
  color: #444;
} /* Heading Section */
.heading {
  background-color: #444;
  color: white;
  padding: 4px 1rem;
  margin-bottom: 5px;
}
.title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 5px;
}
.subtitle {
  font-size: 14px;
  font-weight: normal;
} /* Right: Viewer */
.viewer-container {
  flex: 1;
  background-color: #f3f3f3;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  overflow-y: hidden;
  position: relative;
  width: 100%;
  margin-top: 10px;
  transform: translateY(-20px);
}
.viewer-container canvas {
  height: 680px;
  border-radius: 8px;
  background: #ddd;
}
#renderCanvas {
  display: none;
}
@media (max-width: 768px) {
  .main-wrapper {
    flex-direction: column;
  }
  .viewer-container canvas {
    height: 300px;
  }
}
.viewer-container iframe {
  width: 100%;
  height: 680px;
  border: none;
  border-radius: 8px;
  background: #ddd;
}
.main-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  box-sizing: border-box;
}
.container {
  max-width: 595px;
  width: 100%;
  background: #fff;
  padding: 1rem;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-left: -1.5rem; /* align to left with some spacing */
  margin-top: -30px;
  max-height: 580px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 3px;
  border-radius: 4px;
  border: 1px solid white;
}
.label,
.select-container,
.unit {
  padding: 10px;
  display: flex;
  align-items: center;
  border-right: 1px solid white;
  background-color: #f0f0f0;
  box-sizing: border-box;
}
.label {
  background-color: #555;
  color: white; /*font-weight: bold;*/
  flex: 1 1 150px;
  min-width: 190px;
  max-width: 190px;
  border-radius: 5px;
}
.select-container {
  flex: 1 1 250px;
  min-width: 400px;
  max-width: 400px;
  justify-content: flex-start;
  background-color: #f0f0f0;
  padding: 0 8px;
}
.unit {
  flex: 0 0 100px;
  min-width: 80px;
  max-width: 100px;
  justify-content: center;
  background-color: #e0e0e0;
  padding: 0 6px;
}
/* Target the stroke input field specifically */
#stroke-input {
  height: 40px;       /* taller */
  width: 105px;        /* narrower */
  font-size: 16px;    /* optional: increase font */
  padding: 4px 6px;   /* optional: inner spacing */
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.custom-extended-input {
    width: 105px;       /* desired width */
    height: 40px;       /* desired height */
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
	box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
}

.custom-extended-input:focus {
    border-color: #007bff;
}


.select-container.active-selection {
  border: 2px solid #000000;
  background-color: #f0f0f0;
  border-radius: 6px;
} /* Choices.js styling */
.choices__inner,
.choices__item,
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  box-sizing: border-box;
  height: 35px;
  width: 400px; /* drop down content */
  min-width: 400px;
  max-width: 100%;
}
.choices__inner {
  min-height: 35px !important;
  padding: 4px 8px !important;
  font-size: 14px;
}
.choices__list--single {
  line-height: 1.4;
  padding: 1px 1px !important;
}
.choices__item {
  padding: 2px 1px;
  width: 400px; /* drop down content */
  min-width: 400px;
  max-width: 100%;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: grey !important;
  color: white;
  height: auto;
}
.part-number-row .select-container {
  /*font-weight: bold;*/
  font-size: 14px;
  color: #333;
  border: none;
  background-color: #f0f0f0 !important;
  color: black;
  height: auto;
  padding-left: 18px;
  letter-spacing: 1px;
}
.footer {
  width: 100%;
  background-color: #444; /* Dark grey */
  color: #fff;
  padding: 12px 20px;
  box-sizing: border-box;
  font-size: 14px;
  margin-top: -10px;
}
.footer-text {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1px;
  font-weight: bold;
}
.footer-text span {
  margin-bottom: 1px;
}
.powered-by {
  font-weight: bold;
}
.red-ff {
  color: red;
  font-style: normal;
}
.button-gap-group {
  width: 100%;
  min-width: 627px;
  margin-left: -1.5rem;
  margin-top: 0.5rem;
  padding: 1rem 0.5rem;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  max-height: 115px;
} /* Flex rows */
.cad-ui-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 10px;
} /* Reusable buttons */
.button-gap-group button,
.button-gap-group select {
  background-color: #4a4a4a;
  color: white;
  font-size: 14px;
  padding: 10px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease; /*max-width: 215px;  max-height: 50px;*/
  flex: 1 1 45%;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}
.button-gap-group button:hover {
  background-color: #3a3a3a;
} /* Label + dropdown container */
.cad-ui-file-type {
  display: flex;
  flex-direction: column;
  flex: 1 1 45%;
}
.cad-ui-file-type label {
  font-size: 13px;
  color: #333;
  margin-bottom: 4px;
}
#cad-ui-file-type-select {
  background-color: white;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
} /* New wrapper for left side */
.left-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  width: 100%;
  margin-left: 1.25rem;
  margin-top: 20px;
} /* Top row: 3 distinct widths */
.cad-ui-top-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-cad-generate {
  flex: 1 1 50px;
  min-width: 180px;
  max-width: 180px;
  min-height: 45px;
  max-height: 45px;
  background-color: #4a4a4a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  font-size: 18px;
} /* Only handle positioning in this class */
.centered-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}
.centered-button:hover {
  background-color: #3a3a3a;
}
#cad-ui-generate {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#cad-ui-generate.show {
  display: block;
  opacity: 1;
  z-index: 10;
}
.cad-warning-message {
  position: absolute;
  top: calc(50% - 48px); /* Slightly above the button */
  left: 50%;
  transform: translateX(-50%);
  color: #ff4d4f;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  max-width: 300px;
  opacity: 0;
  visibility: hidden; /* Added visibility to handle quick disappearance */
  transition: opacity 0.1s ease, visibility 0.1s ease; /* Quick fade-in and fade-out */
  z-index: 100;
}
.cad-warning-message.show {
  opacity: 1;
  visibility: visible; /* Show message when .show is added */
}
.viewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px); /* Adds the blur effect */
  background-color: rgba(255, 255, 255, 0.4); /* Semi-transparent background */
  display: flex;
  flex-direction: column; /* Ensure elements are stacked vertically */
  justify-content: center;
  align-items: center;
  z-index: 10;
  display: none; /* Hide by default */
}
.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #ccc;
  border-top-color: #4a4a4a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px; /* Space between spinner and progress text */
}
.progress-text {
  position: absolute;
  top: calc(50% - 20px); /* Vertically center inside the spinner */
  left: 50%; /* Horizontally center inside the spinner */
  transform: translate(-50%, -50%); /* Ensure perfect centering */
  font-size: 16px;
  font-weight: bold;
  color: red;
}
.loading-message {
  font-size: 16px;
  color: red;
  font-weight: 500;
  text-align: center; /* Center align the text */
  margin-top: 15px; /* Space between spinner and loading message */
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.cad-ui-file-type {
  flex: 1 1 200px;
  min-width: 150px;
  max-width: 150px;
}
.btn-cad-download {
  flex: 1 1 100px;
  min-width: 145px;
  max-width: 145px;
  min-height: 36px;
  max-height: 36px;
} /* Bottom row: 2 buttons full width each (stack on mobile) */
.btn-view-drawing,
.btn-request-quote {
  flex: 1 1 100px;
  max-width: 310px;
  min-width: 281px;
} /* Mobile stacking */
@media (max-width: 768px) {
  .cad-ui-top-row {
    flex-direction: column;
  }
  .btn-cad-generate,
  .cad-ui-file-type,
  .btn-cad-download {
    width: 75%;
  }
  .btn-view-drawing,
  .btn-request-quote {
    width: 100%;
  }
}
.cad-ui-file-type-inline {
  display: flex;
  align-items: center;
  gap: 0.15rem; /* small gap between label and dropdown */
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 160px;
}

.cad-ui-file-type-inline label {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  margin: 0; /* no big margins */
  margin-left: -57px;
}

.cad-ui-file-type-inline select {
  background-color: white;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 2px 6px; /* corrected padding */
  font-size: 14px;
  flex: 1;
  min-width: 150px;
}

@media (max-width: 600px) {
  .cad-ui-file-type-inline {
    flex-direction: column;
    align-items: flex-start;
  }
  .cad-ui-file-type-inline select {
    width: 100%;
  }
}

.btn-product-brochure {
  flex: 1 1 150px;
  min-width: 155px;
  max-width: 155px;
  min-height: 36px;
  max-height: 36px;
  background-color: #0073e6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-product-brochure:hover {
  background-color: #005bb5;
}

.modal-content .btn-cad-download {
  width: 100%;
  min-width: 155px;
  max-width: 155px;
  background-color: #4a4a4a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
margin-left: 8rem;
}
.modal-content .btn-cad-download:hover {
  background-color: #3a3a3a;
}
/************************************* */
/* Overlay */
/* Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal box */
.modal-content {
  position: relative; /* This allows .modal-close to position correctly */
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  animation: fadeInScale 0.3s ease;
}

/* Close button */
.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #000;
}

/* Form styling inside modal */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.modal-content input {
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 20px;
  color: #333;
}

.modal-content p {
  font-size: 14px;
  color: #666;
  margin-bottom: 1rem;
}
/* Add red star for required fields */
  .required {
    color: red;
    margin-left: 3px;
  }
  /* Animation */
  @keyframes fadeIn {
    from {opacity: 0; transform: translateY(-10px);}
    to {opacity: 1; transform: translateY(0);}
  }