.te-designer-open {
  background: #ffffff !important;
  border: 1px solid #111111 !important;
  border-radius: 8px;
  color: #111111 !important;
  display: flex;
  font-weight: 900;
  justify-content: center;
  margin: 12px 0;
  min-height: 46px;
  width: 100%;
}

.te-designer-open--cart {
  flex: 0 0 100%;
  margin: 0 0 12px !important;
  order: -10;
}

.te-designer-loop-button {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #111111 !important;
  border-radius: 8px;
  color: #111111 !important;
  display: flex !important;
  font-size: 15px;
  font-weight: 900;
  justify-content: center;
  margin: 10px 0 0 !important;
  min-height: 46px;
  text-align: center;
  text-decoration: none !important;
  width: 100%;
}

.te-designer-loop-button:hover {
  background: #111111 !important;
  color: #ffffff !important;
}

.woocommerce div.product form.cart {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.woocommerce div.product form.cart .quantity {
  margin: 0 !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
  margin: 0 !important;
}

.te-designer-modal {
  background: rgba(17, 17, 17, .58);
  inset: 0;
  padding: 24px;
  position: fixed;
  z-index: 9999;
}

.te-designer-panel {
  background: #f5f5f5;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(17, 17, 17, .24);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: min(860px, calc(100vh - 48px));
  margin: 0 auto;
  max-width: 1180px;
  overflow: hidden;
}

.te-designer-header,
.te-designer-footer {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
}

.te-designer-footer {
  border-bottom: 0;
  border-top: 1px solid #e8e8e8;
  gap: 12px;
  justify-content: flex-end;
}

.te-designer-header strong {
  color: #111111;
  font-size: 18px;
  font-style: italic;
  font-weight: 900;
}

.te-designer-tabs,
.te-designer-preview-controls {
  display: inline-flex;
  gap: 8px;
}

.te-designer-tabs button,
.te-designer-preview-controls button,
.te-designer-help {
  background: #ffffff !important;
  border: 1px solid #111111 !important;
  border-radius: 8px;
  color: #111111 !important;
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 8px 12px;
}

.te-designer-help {
  align-items: center;
  display: inline-flex;
  text-align: center;
  text-decoration: none !important;
}

.te-designer-tabs button.is-active,
.te-designer-preview-controls button.is-active {
  background: #111111 !important;
  color: #ffffff !important;
}

.te-designer-help:hover {
  background: #e10600 !important;
  border-color: #e10600 !important;
  color: #ffffff !important;
}

.te-designer-close {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #111111 !important;
  border-radius: 999px;
  color: #111111 !important;
  display: inline-flex;
  font-size: 24px;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.te-designer-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 0;
}

.te-designer-tools {
  background: #ffffff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 16px;
}

.te-designer-tools section {
  border-bottom: 1px solid #e8e8e8;
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
}

.te-designer-tools h3 {
  color: #111111;
  font-size: 13px;
  font-style: italic;
  font-weight: 900;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.te-designer-control-label {
  color: #444;
  font-size: 12px;
  font-weight: 900;
}

.te-designer-tools button,
.te-designer-file,
.te-designer-tools select,
.te-designer-tools input[type="number"],
.te-designer-tools input[type="color"] {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  color: #111111;
  font-size: 14px;
  font-weight: 800;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.te-designer-tools button,
.te-designer-file {
  background: #ffffff !important;
  cursor: pointer;
  text-align: center;
}

.te-designer-file input {
  display: none;
}

.te-designer-inline {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.te-designer-stage {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: auto;
  padding: 24px;
}

.te-designer-canvas-wrap {
  aspect-ratio: 900 / 650;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  max-height: calc(100vh - 250px);
  max-width: 100%;
  overflow: hidden;
  position: relative;
  width: min(900px, 100%);
}

.te-designer-base-img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.te-designer-canvas-wrap .canvas-container {
  touch-action: none;
  height: 100% !important;
  inset: 0;
  position: absolute !important;
  width: 100% !important;
  z-index: 1;
}

.te-designer-canvas-wrap canvas {
  background: transparent !important;
  height: 100% !important;
  touch-action: none;
  width: 100% !important;
}

.te-designer-status {
  color: #111111;
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
  min-height: 20px;
  width: min(900px, 100%);
}

.te-designer-plane-note {
  color: #555555;
  font-size: 13px;
  font-weight: 800;
  margin: 10px 0 0;
  text-align: center;
  width: min(900px, 100%);
}

.te-designer-save,
.te-designer-add {
  border-radius: 8px;
  font-weight: 900;
  min-height: 46px;
  padding: 12px 18px;
}

.te-designer-save {
  background: #ffffff !important;
  border: 1px solid #111111 !important;
  color: #111111 !important;
}

.te-designer-add {
  background: #e10600 !important;
  border: 1px solid #e10600 !important;
  color: #ffffff !important;
}

.te-designer-cart-preview {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  height: auto;
  max-width: 120px;
}

.te-designer-preview {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.te-designer-preview[hidden] {
  display: none;
}

.te-designer-mockup {
  --te-preview-edge-fade: .1;
  --te-preview-h: 60%;
  --te-preview-highlight: .04;
  --te-preview-opacity: .92;
  --te-preview-radius: 0px;
  --te-preview-rotate: 0deg;
  --te-preview-shadow: .04;
  --te-preview-skew-x: 0deg;
  --te-preview-skew-y: 0deg;
  --te-preview-w: 51.9%;
  --te-preview-x: 24%;
  --te-preview-y: 21%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  max-height: min(560px, calc(100vh - 260px));
  overflow: hidden;
  position: relative;
  width: min(560px, 100%);
}

.te-designer-mockup-img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.te-designer-print-area {
  border-radius: var(--te-preview-radius);
  box-shadow: inset 14px 0 18px rgba(17, 17, 17, var(--te-preview-shadow)), inset -14px 0 18px rgba(255, 255, 255, var(--te-preview-highlight));
  height: var(--te-preview-h);
  left: var(--te-preview-x);
  mix-blend-mode: multiply;
  opacity: var(--te-preview-opacity);
  overflow: hidden;
  position: absolute;
  top: var(--te-preview-y);
  transform: perspective(720px) rotate(var(--te-preview-rotate)) skewX(var(--te-preview-skew-x)) skewY(var(--te-preview-skew-y));
  transform-origin: center center;
  width: var(--te-preview-w);
  z-index: 2;
}

.te-designer-mockup-design {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.te-designer-print-shadow,
.te-designer-print-highlight {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.te-designer-print-shadow {
  background: linear-gradient(90deg, rgba(17, 17, 17, var(--te-preview-shadow)), rgba(17, 17, 17, 0) 30%, rgba(17, 17, 17, var(--te-preview-shadow)));
  z-index: 3;
}

.te-designer-print-highlight {
  background: linear-gradient(90deg, rgba(255, 255, 255, var(--te-preview-highlight)), rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, var(--te-preview-highlight)));
  z-index: 4;
}

.te-designer-preview-note {
  color: #555555;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  text-align: center;
}

@media (max-width: 900px) {
  .te-designer-modal {
    background: #f5f5f5;
    overflow-y: auto;
    padding: 0;
  }

  .te-designer-panel {
    border-radius: 0;
    height: auto;
    min-height: 100vh;
    max-width: none;
    overflow: visible;
    width: 100%;
  }

  .te-designer-header {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 58px;
    padding: 10px 14px;
  }

  .te-designer-header strong {
    font-size: 16px;
  }

  .te-designer-tabs {
    order: 3;
    width: 100%;
  }

  .te-designer-tabs button,
  .te-designer-help {
    flex: 1;
  }

  .te-designer-help {
    justify-content: center;
    order: 4;
    width: 100%;
  }

  .te-designer-close {
    height: 42px;
    width: 42px;
  }

  .te-designer-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }

  .te-designer-stage {
    flex: 0 0 auto;
    justify-content: flex-start;
    order: 1;
    overflow: visible;
    padding: 10px;
  }

  .te-designer-status {
    font-size: 12px;
    line-height: 1.25;
    margin-bottom: 8px;
    min-height: 16px;
  }

  .te-designer-canvas-wrap {
    max-height: none;
    width: 100%;
  }

  .te-designer-tools {
    border-bottom: 1px solid #e8e8e8;
    border-right: 0;
    border-top: 1px solid #e8e8e8;
    display: grid;
    flex: 0 0 auto;
    gap: 10px;
    grid-template-columns: 1fr;
    max-height: none;
    order: 2;
    overflow: visible;
    padding: 10px;
  }

  .te-designer-tools section {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    gap: 7px;
    padding: 10px;
  }

  .te-designer-tools h3 {
    font-size: 12px;
  }

  .te-designer-tools button,
  .te-designer-file,
  .te-designer-tools select,
  .te-designer-tools input[type="number"],
  .te-designer-tools input[type="color"] {
    font-size: 13px;
    min-height: 42px;
    padding: 8px;
  }

  .te-designer-footer {
    flex: 0 0 auto;
    flex-direction: column;
    gap: 8px;
    order: 3;
    padding: 10px;
    position: sticky;
    bottom: 0;
    z-index: 5;
  }

  .te-designer-save,
  .te-designer-add {
    min-height: 48px;
    width: 100%;
  }

  .te-designer-preview {
    padding: 12px;
  }

  .te-designer-preview-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .te-designer-mockup {
    max-height: none;
    width: 100%;
  }

  .te-designer-loop-button {
    font-size: 14px;
    min-height: 44px;
  }
}
