/*
 * Palm Beach Printer Print Builder presentation.
 *
 * The Web-to-Print plugin owns state, pricing, shipping, validation and actions.
 * This stylesheet only presents the plugin's semantic hooks inside Enfold.
 */

.pbp-builder {
  --pbp-builder-green: #93b52e;
  --pbp-builder-green-dark: #78931f;
  --pbp-builder-green-soft: #f3f7e8;
  --pbp-builder-ink: #333333;
  --pbp-builder-text: #666666;
  --pbp-builder-muted: #919191;
  --pbp-builder-line: #e1e1e1;
  --pbp-builder-surface: #ffffff;
  --pbp-builder-surface-soft: #fcfcfc;

  width: 100%;
  max-width: 100%;
  padding: 18px;
  box-sizing: border-box;
  background: var(--pbp-builder-surface);
  border: 1px solid var(--pbp-builder-line);
  border-radius: 10px;
  color: var(--pbp-builder-text);
  container-name: pbp-builder;
  container-type: inline-size;
}

.pbp-builder,
.pbp-builder * {
  box-sizing: border-box;
}

/*
 * Enfold/Woo button display rules can outrank the browser's native [hidden]
 * presentation. Plugin state remains authoritative; this only restores the
 * semantic contract inside the Builder.
 */
.pbp-builder [hidden] {
  display: none !important;
}

/* ---------- Layout rhythm ---------- */
.pbp-builder .pbp-state-configure,
.pbp-builder .pbp-state-delivery,
.pbp-builder .pbp-configure-state,
.pbp-builder .pbp-delivery-state,
.pbp-builder .pbp-controls,
.pbp-builder .pbp-summary,
.pbp-builder .pbp-configuration-summary,
.pbp-builder .pbp-shipping,
.pbp-builder .pbp-shipping-address,
.pbp-builder .pbp-shipping-quote,
.pbp-builder .pbp-shipping-methods,
.pbp-builder .pbp-job-name {
  min-width: 0;
}

.pbp-builder .pbp-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.pbp-builder .pbp-summary,
.pbp-builder .pbp-configuration-summary,
.pbp-builder .pbp-shipping {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-result,
.pbp-builder .pbp-quote {
  margin-top: 10px;
}

/* ---------- Configure / Delivery rail ---------- */
.pbp-builder .pbp-builder-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-builder-steps::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 50%;
  height: 2px;
  background: var(--pbp-builder-green);
  transition: transform 160ms ease;
}

.pbp-builder[data-builder-state="delivery"] .pbp-builder-steps::after {
  transform: translateX(100%);
}

.pbp-builder [data-pbp-step] {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  color: var(--pbp-builder-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  box-shadow: none;
}

.pbp-builder [data-pbp-step="delivery"] {
  text-align: right;
}

.pbp-builder [data-pbp-step][aria-current="step"] {
  color: var(--pbp-builder-ink);
  font-weight: 700;
}

.pbp-builder[data-builder-state="delivery"] [data-pbp-step="configure"] {
  color: var(--pbp-builder-green-dark);
}

/* ---------- Labels and controls ---------- */
.pbp-builder label,
.pbp-builder .pbp-job-name-label {
  display: block;
  margin: 0 0 6px;
  color: var(--pbp-builder-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#top .pbp-builder input[type="text"],
#top .pbp-builder input[type="email"],
#top .pbp-builder input[type="tel"],
#top .pbp-builder input[type="number"],
#top .pbp-builder select,
#top .pbp-builder textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #cfd5d9;
  border-radius: 6px;
  background: #fff;
  color: var(--pbp-builder-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: none;
}

#top .pbp-builder textarea {
  min-height: 92px;
  resize: vertical;
}

#top .pbp-builder input[type="text"]:focus,
#top .pbp-builder input[type="email"]:focus,
#top .pbp-builder input[type="tel"]:focus,
#top .pbp-builder input[type="number"]:focus,
#top .pbp-builder select:focus,
#top .pbp-builder textarea:focus {
  outline: 2px solid rgba(147, 181, 46, 0.24);
  outline-offset: 1px;
  border-color: var(--pbp-builder-green);
}

.pbp-builder input[type="radio"],
.pbp-builder input[type="checkbox"] {
  accent-color: var(--pbp-builder-green);
}

.pbp-builder .pbp-status:empty,
.pbp-builder .pbp-result:empty,
.pbp-builder .pbp-quote:empty {
  display: none;
}

.pbp-builder .pbp-status {
  margin-top: 10px;
  color: var(--pbp-builder-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- Pricing ---------- */
.pbp-builder .pbp-price {
  margin-top: 14px;
  color: var(--pbp-builder-ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.pbp-builder .pbp-action-totals {
  min-width: 0;
  color: var(--pbp-builder-text);
  font-size: 12px;
  line-height: 1.3;
}

.pbp-builder .pbp-printing-amount,
.pbp-builder .pbp-action-shipping-amount,
.pbp-builder .pbp-job-total {
  font-variant-numeric: tabular-nums;
}

.pbp-builder .pbp-job-total {
  color: var(--pbp-builder-ink);
  font-size: 18px;
  font-weight: 700;
}

/* ---------- Delivery basics ---------- */
.pbp-builder .pbp-shipping-address {
  margin-bottom: 14px;
}

.pbp-builder .pbp-shipping-methods {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-shipping-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-shipping-choice-details {
  min-width: 0;
}

.pbp-builder .pbp-shipping-service {
  color: var(--pbp-builder-ink);
  font-weight: 700;
}

.pbp-builder .pbp-shipping-date {
  color: var(--pbp-builder-muted);
  font-size: 12px;
}

.pbp-builder .pbp-shipping-amount {
  color: var(--pbp-builder-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Builder command interface ---------- */
/*
 * One compact interface region: useful totals, one current command, then quiet
 * navigation. The plugin owns which command is current and completion state.
 */
.pbp-builder .pbp-action-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.pbp-builder .pbp-action-totals {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--pbp-builder-text);
  font-size: 13px;
  line-height: 1.35;
}

.pbp-builder .pbp-action-total-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.pbp-builder .pbp-action-total-label {
  color: var(--pbp-builder-muted);
  font-weight: 600;
}

.pbp-builder .pbp-printing-amount,
.pbp-builder .pbp-action-shipping-amount,
.pbp-builder .pbp-job-total {
  color: var(--pbp-builder-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.pbp-builder .pbp-printing-amount,
.pbp-builder .pbp-action-shipping-amount {
  font-size: 15px;
}

.pbp-builder .pbp-action-total-row:has(.pbp-job-total) {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-job-total {
  font-size: 19px;
}

.pbp-builder .pbp-action-complete-status {
  margin: 0;
  color: var(--pbp-builder-green-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.pbp-builder .pbp-action-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

#top .pbp-builder .pbp-action-primary .button,
#top .pbp-builder .pbp-action-primary button,
#top .pbp-builder .pbp-action-primary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 168px;
  min-height: 42px;
  margin: 0;
  padding: 9px 14px;
  float: none;
  border: 1px solid var(--pbp-builder-green-dark);
  border-radius: 6px;
  background: var(--pbp-builder-green);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
}

#top .pbp-builder .pbp-action-primary .button:hover,
#top .pbp-builder .pbp-action-primary .button:focus-visible,
#top .pbp-builder .pbp-action-primary button:hover,
#top .pbp-builder .pbp-action-primary button:focus-visible,
#top .pbp-builder .pbp-action-primary a:hover,
#top .pbp-builder .pbp-action-primary a:focus-visible {
  background: #86a629;
  border-color: var(--pbp-builder-green-dark);
  color: #fff;
}

#top .pbp-builder .pbp-action-primary button:disabled,
#top .pbp-builder .pbp-action-primary .button:disabled,
#top .pbp-builder .pbp-action-primary [aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Completion is a destination choice, not another submit state. */
#top .pbp-builder[data-action-state="complete"] .pbp-action-primary .pbp-view-cart {
  background: #fff;
  color: var(--pbp-builder-green-dark);
}

#top .pbp-builder[data-action-state="complete"] .pbp-action-primary .pbp-checkout {
  background: var(--pbp-builder-green);
  color: #fff;
}

.pbp-builder .pbp-action-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px 12px;
  min-width: 0;
}

/* Left side is workflow navigation; cart destinations sit on the right. */
.pbp-builder .pbp-action-secondary .pbp-view-cart:not([hidden]) {
  margin-left: auto;
}

#top .pbp-builder .pbp-action-secondary .button,
#top .pbp-builder .pbp-action-secondary button,
#top .pbp-builder .pbp-action-secondary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 3px 0;
  float: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pbp-builder-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
}

.pbp-builder .pbp-action-secondary .pbp-checkout:not([hidden])::before {
  content: "·";
  margin-right: 12px;
  color: #c3c7ca;
}

#top .pbp-builder .pbp-action-secondary .button:hover,
#top .pbp-builder .pbp-action-secondary .button:focus-visible,
#top .pbp-builder .pbp-action-secondary button:hover,
#top .pbp-builder .pbp-action-secondary button:focus-visible,
#top .pbp-builder .pbp-action-secondary a:hover,
#top .pbp-builder .pbp-action-secondary a:focus-visible {
  background: transparent;
  color: var(--pbp-builder-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#top .pbp-builder .pbp-action-primary :focus-visible,
#top .pbp-builder .pbp-action-secondary :focus-visible {
  outline: 2px solid var(--pbp-builder-green);
  outline-offset: 2px;
}


/* Vertical command hierarchy: totals, then the current command. */
.pbp-builder .pbp-command > .pbp-action-primary {
  width: 100%;
}

.pbp-builder[data-action-state="complete"] .pbp-action-primary {
  justify-content: flex-end;
}

@container pbp-builder (max-width: 379px) {
  .pbp-builder {
    padding: 15px;
  }

  #top .pbp-builder .pbp-action-primary .button,
  #top .pbp-builder .pbp-action-primary button,
  #top .pbp-builder .pbp-action-primary a {
    width: 100%;
    min-width: 0;
  }

  .pbp-builder[data-action-state="complete"] .pbp-action-primary > * {
    flex: 1 1 calc(50% - 4px);
  }

  .pbp-builder .pbp-shipping-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pbp-builder .pbp-shipping-amount {
    grid-column: 2;
    justify-self: start;
  }

  .pbp-builder .pbp-summary-items > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }
}

/* Keep the small cart-count affordance from the previous theme treatment. */
.pbp-builder .pbp-cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4b3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}


/* ---------- Canonical configuration review ---------- */
.pbp-builder .pbp-action-bar > .pbp-summary {
  order: 0;
  margin: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--pbp-builder-line);
}

.pbp-builder .pbp-action-bar > .pbp-summary h3 {
  margin: 0 0 10px;
  color: var(--pbp-builder-ink);
  font-size: 14px;
  font-weight: 700;
}

.pbp-builder .pbp-summary-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
}

.pbp-builder .pbp-summary-items > div {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
  gap: 8px 14px;
  align-items: baseline;
  min-width: 0;
}

.pbp-builder .pbp-summary-items dt {
  color: var(--pbp-builder-muted);
  font-size: 12px;
  font-weight: 600;
}

.pbp-builder .pbp-summary-items dd {
  color: var(--pbp-builder-ink);
  font-size: 13px;
  font-weight: 600;
}

.pbp-builder .pbp-job-name {
  margin-top: 0;
  scroll-margin-top: 118px;
}

.pbp-builder .pbp-shipping-destination {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--pbp-builder-line);
  border-radius: 7px;
  background: var(--pbp-builder-surface-soft);
}

.pbp-builder .pbp-shipping-destination-title {
  margin: 0 0 5px;
  color: var(--pbp-builder-ink);
  font-size: 13px;
  font-weight: 700;
}

.pbp-builder .pbp-shipping-destination-text {
  margin: 0;
  color: var(--pbp-builder-text);
  font-size: 13px;
  line-height: 1.45;
}

.pbp-builder .pbp-shipping-address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin-top: 7px;
}

#top .pbp-builder .pbp-shipping-address-actions .button,
#top .pbp-builder .pbp-shipping-address-actions button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--pbp-builder-green-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.pbp-builder .pbp-shipping-address:not([hidden]) {
  margin-top: 10px;
}
