:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #f3f4f6;
  --text-color: #1f2937;
  --border-color: #e5e7eb;
  --error-color: #ef4444;
  --success-color: #10b981;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 -2px 4px -1px rgba(0, 0, 0, 0.1);

  --radius: 6px;
  
  --font-family: PT Sans,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
}

/* Layout */
@media (min-width: 992px) {
  #plp-container:has(.tp-container) {
    & #plp-item-description-with-image, #plp-item-page-specs {
      width: 45.5% !important;
      float: left;
    }
    & #plp-downloads {
      display: none;
    }
    & .tp-container {
      width: 53.5%;
    }
  }
}

.tp-container {
  float: right;
  box-sizing: border-box;
  font-family: var(--font-family);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem;
  color: var(--text-color);
  border-radius: 0px;
  width: 100%;
  & * {
    box-sizing: border-box;
  }
  & button, select, input {
    font-family: var(--font-family) !important;
  }
}

.tp-grid {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .tp-grid {
    grid-template-columns: 1fr;
  }
}

/* Configurator Section */
.tp-configurator {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.tp-section {
  margin-bottom: 1rem;
}

.tp-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-top: 0px;
}

/* Form Elements */
.tp-form-group {
  margin-bottom: 1.25rem;
}

.tp-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.tp-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out;
}
/* hide arrows from number input fields */
input[type=number] {
  -moz-appearance: textfield;
  &:disabled {
    background: #FAFAFA;
  }
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tp-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tp-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231f2937' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.tp-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table Styles */
.tp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.tp-table th,
.tp-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.tp-table th {
  font-weight: 600;
  background-color: var(--secondary-color);
}

.tp-table tr:hover {
  background-color: rgba(243, 244, 246, 0.5);
}

/* Buttons */
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: none;
  &:hover {
    border: none;
  }
}

.tp-btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.tp-btn-primary:hover {
  background-color: var(--primary-hover);
}

.tp-btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-color);
}

.tp-btn-secondary:hover {
  background-color: #e5e7eb;
}

/* CAD Viewer */
.tp-cad-viewer {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 350px;
}

.tp-cad-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* CAD Controls */
.tp-cad-controls {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.tp-cad-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .tp-cad-form {
    grid-template-columns: 1fr;
  }
}

.tp-cad-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0rem;
}

/* Document Links */
.tp-doc-links {
  margin-top: 1.5rem;
  /*! display: none; */
}

.tp-doc-link {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--primary-color);
  background-color: var(--secondary-color);
  border-radius: var(--radius);
  transition: background-color 0.15s ease-in-out;
}

.tp-doc-link:hover {
  background-color: #e5e7eb;
}

.tp-doc-link svg {
  margin-right: 0.5rem;
}

/* Loading and Status */
.tp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.tp-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--secondary-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

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

.tp-status {
  padding: 0.75rem;
  margin-top: 1rem;
  border-radius: var(--radius);
  text-align: center;
}

.tp-status-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.tp-status-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}
