/* Bar below each package table */
.pop-custom-bar {
  --pop-custom: #00b4ff;
  --pop-custom-tint: rgba(0, 180, 255, 0.1);
  --pop-custom-line: rgba(0, 180, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-top: 16px;
  padding: 20px 24px;
  border: 2px solid var(--pop-custom);
  border-radius: 24px;
  background: var(--pop-custom-tint);
  box-sizing: border-box;
}

.pop-custom-bar.is-props {
  --pop-custom: #00cb73;
  --pop-custom-tint: rgba(0, 203, 115, 0.1);
  --pop-custom-line: rgba(0, 203, 115, 0.2);
}

.pop-custom-bar-title {
  font-weight: 700;
  font-size: 20px;
  line-height: 130%;
  color: #0f172a;
}

.pop-custom-bar p {
  margin: 4px 0 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 150%;
  color: #0f172a;
}

.pop-custom-bar .pop-order {
  flex-shrink: 0;
}

.pop-custom-bar .pop-order .pop-open-button {
  width: auto;
  padding: 12px 28px;
  background: var(--pop-custom);
  border: 1px solid var(--pop-custom);
}

.pop-custom-bar .pop-order .pop-open-button:hover,
.pop-custom-bar .pop-order .pop-open-button:focus {
  background: #fff;
  border: 1px solid var(--pop-custom);
  color: var(--pop-custom);
}

/* The fourth choice in the form */
.pop-package-options {
  flex-wrap: wrap;
}

.pop-package-option.pop-custom-option {
  flex: 1 0 100%;
  box-sizing: border-box;
}

.pop-custom-prop {
  display: flex;
  align-items: center;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.pop-custom-prop .pop-prop-label {
  width: 100%;
}

.pop-custom-prop.is-checked {
  border-color: #10b981;
  background: #f0fdf4;
}

.pop-custom-prop.is-checked .pop-prop-check {
  border-color: #10b981;
  background: #10b981;
}

.pop-custom-prop.is-checked .pop-prop-check::after {
  content: "\2713";
  position: absolute;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Opened from a bar: the choices come first, then their details */
.pop-order[data-customise="instruments"] .pop-form,
.pop-order[data-customise="props"] .pop-form {
  display: flex;
  flex-direction: column;
}

.pop-order[data-customise="instruments"] .pop-form > .pop-section,
.pop-order[data-customise="props"] .pop-form > .pop-section {
  order: 1;
}

.pop-order[data-customise="props"] .pop-form > .pop-section-props {
  order: 0;
}

.pop-order[data-customise="instruments"] .pop-form > .pop-custom-notes,
.pop-order[data-customise="props"] .pop-form > .pop-custom-notes {
  order: 2;
}

.pop-order[data-customise="instruments"] .pop-form > .pop-section-details,
.pop-order[data-customise="props"] .pop-form > .pop-section-details {
  order: 3;
}

.pop-order[data-customise="instruments"] .pop-form > .pop-footer,
.pop-order[data-customise="props"] .pop-form > .pop-footer {
  order: 4;
}

.pop-order[data-customise="instruments"] .pop-form > .pop-message,
.pop-order[data-customise="props"] .pop-form > .pop-message {
  order: 5;
}

/* The list, matching the package tables */
.pop-custom-section {
  --pop-custom: #00b4ff;
  --pop-custom-head: #e0f2fe;
  margin-top: 12px;
  padding: 16px;
  border: 2px solid var(--pop-custom);
  border-radius: 24px;
  background: #fff;
}

.pop-custom-section.is-props {
  --pop-custom: #00cb73;
  --pop-custom-head: #dcfce7;
}

.pop-custom-section[hidden],
.pop-custom-notes[hidden],
.pop-custom-card[hidden],
.pop-submit [hidden] {
  display: none;
}

.pop-custom-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
  padding: 18px 0;
  border-radius: 18px;
  background: var(--pop-custom-head);
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  color: #0f172a;
}

.pop-custom-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.pop-custom-item:last-child {
  border-bottom: 0;
}

.pop-custom-item.is-chosen {
  background: #f8fafc;
}

.pop-order .pop-custom-name,
.pop-order .pop-custom-name:hover,
.pop-order .pop-custom-name:focus {
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  font-size: 18px;
  line-height: 140%;
  text-align: center;
  white-space: normal;
  cursor: help;
}

.pop-order .pop-custom-name:hover,
.pop-order .pop-custom-name:focus {
  color: var(--pop-custom);
}

.pop-custom-item .pop-quantity {
  justify-content: center;
  gap: 4px;
}

.pop-order .pop-custom-item .pop-quantity button,
.pop-order .pop-custom-item .pop-quantity button:hover,
.pop-order .pop-custom-item .pop-quantity button:focus {
  border: 0;
  background: transparent;
  padding: 0;
}

.pop-order .pop-custom-item input.pop-custom-qty {
  width: 48px;
  padding: 4px 0;
  border: 1px solid #d5d7da;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pop-custom-qty::-webkit-outer-spin-button,
.pop-custom-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pop-order .pop-custom-notes textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1.5px solid #f5f5f7;
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 150%;
  outline: none;
}

.pop-order .pop-custom-notes textarea:focus {
  border-color: #0ea5e9;
}

/* Hover card, matching the props table */
.pop-custom-card {
  position: fixed;
  z-index: 1000000;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  padding: 15px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
  text-align: center;
  pointer-events: none;
  font-family: "Quicksand-Local", Sans-serif;
}

.pop-custom-card img {
  display: block;
  width: 100%;
  height: 180px;
  margin-bottom: 10px;
  object-fit: contain;
}

.pop-custom-card img[hidden] {
  display: none;
}

.pop-custom-card-title {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 18px;
  line-height: 130%;
  color: #333;
}

.pop-custom-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 150%;
  color: #555;
}

@media (max-width: 767px) {
  .pop-custom-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pop-custom-bar .pop-order .pop-open-button {
    width: 100%;
  }

  .pop-custom-section {
    padding: 10px;
  }

  .pop-custom-head {
    grid-template-columns: 1fr 124px;
    padding: 12px 0;
    font-size: 16px;
  }

  .pop-custom-item {
    grid-template-columns: 1fr 124px;
    padding: 4px;
  }

  .pop-order .pop-custom-name,
  .pop-order .pop-custom-name:hover,
  .pop-order .pop-custom-name:focus {
    font-size: 15px;
  }
}

/* Editing a package */
.pop-order .pop-edit-package,
.pop-order .pop-edit-prop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #0284c7;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.pop-order .pop-edit-package {
  margin-top: 10px;
  padding: 6px 2px;
}

.pop-order .pop-edit-package[hidden] {
  display: none;
}

.pop-order .pop-edit-prop {
  display: none;
  padding: 4px 2px;
  color: #047857;
}

.pop-order .pop-prop.is-checked .pop-edit-prop {
  display: inline-flex;
}

.pop-order .pop-edit-package:hover,
.pop-order .pop-edit-package:focus,
.pop-order .pop-edit-prop:hover,
.pop-order .pop-edit-prop:focus {
  border: 0;
  background: transparent;
  text-decoration: underline;
}

.pop-order .pop-edit-package:hover,
.pop-order .pop-edit-package:focus {
  color: #0284c7;
}

.pop-order .pop-edit-prop:hover,
.pop-order .pop-edit-prop:focus {
  color: #047857;
}

.pop-custom-based {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 150%;
  color: #0f172a;
  text-align: center;
}

.pop-custom-based[hidden] {
  display: none;
}