.pdt-custom-menu-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -58px 0 14px;
  position: relative;
  z-index: 2;
}

.pdt-custom-menu-toolbar .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 7px 12px;
  margin-right: 10px;
  background: #fff;
  border-color: #d0d0d0;
  color: #111;
}

.pdt-custom-menu-toolbar .button .dashicons {
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 1;
  position: relative;
  top: -1px;
}

.pdt-custom-menu-toolbar .button:hover,
.pdt-custom-menu-toolbar .button:focus {
  background: #f6f7f7;
  color: #000;
  border-color: #b6b7b9;
}

.pdt-custom-menu-manager {
  margin-top: 24px;
}

.pdt-custom-menu-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 10px;
  padding: 18px;
}

.pdt-custom-menu-card-header h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.pdt-custom-menu-card-header p {
  margin: 0 0 16px;
  color: #50575e;
}

.pdt-custom-menu-table code {
  font-size: 12px;
}

.pdt-custom-menu-table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dcdcde;
}

.pdt-custom-menu-table thead th {
  background: #f6f7f7;
  font-weight: 600;
}

.pdt-custom-menu-table th,
.pdt-custom-menu-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.pdt-custom-menu-table td:last-child,
.pdt-custom-menu-table th:last-child {
  width: 120px;
  text-align: center;
}

.pdt-custom-menu-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  white-space: nowrap;
}

.pdt-custom-menu-table-actions .button {
  margin: 0;
  height: 30px;
  min-height: 30px;
  line-height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdt-custom-menu-table-actions .button-link-delete {
  color: #b32d2e;
  border: 1px solid #d63638;
  border-radius: 6px;
  padding: 0 12px;
  text-decoration: none;
  height: 30px;
  min-height: 30px;
  line-height: 28px;
}

.pdt-custom-menu-table-actions .button-link-delete:hover,
.pdt-custom-menu-table-actions .button-link-delete:focus {
  background: #d63638;
  color: #fff;
}

.pdt-custom-menu-modal {
  display: none;
}

.pdt-custom-menu-modal.is-open {
  display: block;
}

.pdt-custom-menu-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99998;
}

.pdt-custom-menu-modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dcdcde;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
  z-index: 99999;
}

.pdt-custom-menu-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f1;
}

.pdt-custom-menu-modal__header h2 {
  margin: 0;
  font-size: 22px;
}

.pdt-custom-menu-modal__close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #646970;
}

.pdt-custom-menu-form {
  padding: 20px;
}

.pdt-custom-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "title target"
    "position target"
    "icon target";
  gap: 12px;
}

.pdt-field-menu-title { grid-area: title; }
.pdt-field-menu-target { grid-area: target; }
.pdt-field-menu-icon { grid-area: icon; }
.pdt-field-menu-position { grid-area: position; }

.pdt-custom-menu-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdt-custom-menu-field label {
  font-weight: 600;
}

.pdt-custom-menu-field .description {
  margin: 2px 0 0;
  color: #646970;
  font-size: 12px;
  line-height: 1.4;
}

.pdt-custom-menu-field input[type="text"],
.pdt-custom-menu-field input[type="number"],
.pdt-custom-menu-field select,
.pdt-custom-menu-field textarea {
  width: 100%;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 8px 10px;
}

.pdt-custom-menu-field input[type="text"]:focus,
.pdt-custom-menu-field input[type="number"]:focus,
.pdt-custom-menu-field select:focus,
.pdt-custom-menu-field textarea:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

.pdt-custom-submenus {
  margin-top: 20px;
  border-top: 1px solid #f0f0f1;
  padding-top: 16px;
}

.pdt-custom-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #dcdcde;
  border-radius: 10px;
  background: #fbfbfc;
  cursor: pointer;
}

.pdt-custom-toggle input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
}

.pdt-custom-toggle span {
  line-height: 1.3;
}

.pdt-custom-submenus__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pdt-submenu-row {
  border: 1px solid #e2e4e7;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fbfbfc;
}

.pdt-custom-menu-modal__footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 14px 0 0;
  border-top: 1px solid #f0f0f1;
}

body.pdt-modal-open {
  overflow: hidden;
}

.pdt-custom-icon-picker .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.pdt-custom-icon-picker .dashicons {
  font-size: 18px;
}

.pdt-custom-icon-modal {
  display: none;
}

.pdt-custom-icon-modal.is-open {
  display: block;
}

.pdt-custom-icon-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100000;
}

.pdt-custom-icon-modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 30px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dcdcde;
  z-index: 100001;
}

.pdt-custom-icon-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f1;
}

.pdt-custom-icon-modal__header h3 {
  margin: 0;
}

.pdt-custom-icon-modal__header button {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.pdt-custom-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  padding: 16px;
}

.pdt-custom-icon-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #dcdcde;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.pdt-custom-icon-option:hover,
.pdt-custom-icon-option:focus {
  border-color: #2271b1;
  box-shadow: inset 0 0 0 1px #2271b1;
}

.pdt-custom-menu-delete {
  margin-left: 8px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #fbeaea;
  color: #b32d2e;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
}

.pdt-custom-menu-delete:hover,
.pdt-custom-menu-delete:focus {
  background: #b32d2e;
  color: #fff;
  outline: none;
}

@media (max-width: 782px) {
  .pdt-custom-menu-toolbar {
    margin: 14px 16px 18px;
    justify-content: flex-start;
  }

  .pdt-custom-menu-toolbar .button {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    margin: 0;
    border-radius: 999px;
  }

  .pdt-custom-menu-modal__dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .pdt-custom-menu-form {
    padding: 14px;
  }

  .pdt-custom-icon-modal__dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .pdt-custom-menu-grid {
    grid-template-areas: none;
    grid-template-columns: 1fr;
  }

  .pdt-custom-toggle {
    width: 100%;
  }
}
