/**
 * Modal styles for product customizer (two columns).
 *
 * @package WooCommerce_Product_Design_Upload
 */

.wcpdu-entry {
  margin-bottom: 16px;
}

.wcpdu-open-customizer {
  padding: 10px 24px;
  line-height: 24px;
  background-color: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

.wcpdu-open-customizer:hover,
.wcpdu-open-customizer:focus {
  background-color: #135e96;
  border-color: #135e96;
  color: #fff;
}

.wcpdu-modal-open {
  overflow: hidden;
}

.wcpdu-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
}

.wcpdu-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.wcpdu-modal-dialog {
  position: relative;
  width: min(900px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  margin: 150px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.wcpdu-modal-header {
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.wcpdu-modal-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.wcpdu-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.wcpdu-modal-body {
  padding: 14px 16px;
}

/* Two-column layout */
.wcpdu-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.wcpdu-modal-col {
  min-width: 0;
}

.wcpdu-modal-col-left .wcpdu-canvas-wrapper {
  margin-top: 12px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #eee;
  border-radius: 10px;
}

#wcpdu-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.wcpdu-form-block {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcpdu-form-block label {
  font-weight: 600;
  font-size: 16px;
}

.wcpdu-form-block textarea {
  width: 100%;
  resize: vertical;
}

.wcpdu-toolbar {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wcpdu-modal-footer {
  padding: 14px 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wcpdu-modal-footer .button {
  width: 50%;
  padding: 10px;
  line-height: 26px;
}

/* Modal footer buttons */
.wcpdu-modal-footer .wcpdu-cancel {
  background-color: transparent;
  border: 1px solid #d63638;
  color: #d63638;
}

.wcpdu-modal-footer .wcpdu-cancel:hover,
.wcpdu-modal-footer .wcpdu-cancel:focus {
  border-color: #b32d2e;
  color: #b32d2e;
}

.wcpdu-modal-footer .wcpdu-apply {
  background-color: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

.wcpdu-modal-footer .wcpdu-apply:hover,
.wcpdu-modal-footer .wcpdu-apply:focus {
  background-color: #135e96;
  border-color: #135e96;
  color: #fff;
}

@media (max-width: 860px) {
  .wcpdu-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Hide the real input, keep it accessible via the label click */
#wcpdu-upload-image {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.custom-file-upload {
  align-items: center;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
  font-size: 14px;
}

.wcpdu-tooltip {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #646970;
}
