/* DG-PAYMENT-CONTACT-MODAL-21 — the contact modal (partials/v3/contact-modal.php), the payment help block
   (partials/v3/payment-contact-help.php) and the secondary "Or send us a message" links. House style only: the charcoal bar
   of the full detail modal, a white body, the berry primary button, a quiet neutral help card. Desktop: a large centred
   window with a visible edge and its own scroll; phones (<= 720px): full screen, safe areas respected. */

/* ---------- the layer ---------- */
body.v3-storefront .modal-overlay.d-contact-modal {
  z-index: 100;
  padding: 24px;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
}
body.v3-storefront .modal-overlay.d-contact-modal[hidden] {
  display: none;
}
.d-contact-window {
  --d-contact-bar-bg: linear-gradient(180deg, #323c43 0%, #252d33 100%);
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  height: min(880px, calc(100vh - 48px));
  height: min(880px, calc(100dvh - 48px));
  background: #fff;
  color: var(--ink, #171d18);
  border: 1px solid #d9e0d4;
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(20, 25, 21, 0.24), 0 6px 18px rgba(20, 25, 21, 0.1);
  overflow: hidden;
  outline: none;
}
.d-contact-bar {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 10px 8px 22px;
  background: #252d33;
  background: var(--d-contact-bar-bg);
  color: #fff;
}
.d-contact-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}
.d-contact-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.d-contact-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.d-contact-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.d-contact-scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.d-contact-body {
  padding: 22px 28px 28px;
}
.d-contact-intro {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted, #5b6559);
}

/* ---------- result / alert ---------- */
.d-contact-result {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #cfe3cb;
  background: #f3f9f1;
  outline: none;
}
.d-contact-result[hidden] {
  display: none;
}
.d-contact-result p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.d-contact-result p + p {
  margin-top: 6px;
}
.d-contact-result-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}
.d-contact-result--preview {
  border-color: #e3dcc8;
  background: #fbf8ef;
}
.d-contact-result-note {
  color: var(--muted, #5b6559);
}
.d-contact-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #efc9cf;
  background: #fdf3f4;
  color: #7a1c2b;
  font-size: 14.5px;
  line-height: 1.45;
}
.d-contact-alert[hidden] {
  display: none;
}
.d-contact-formwrap[hidden] {
  display: none;
}

/* ---------- the shared form, scoped to the modal (the Help page's own rules stay info-page scoped) ---------- */
.d-contact-modal .d-help-form .d-form-row {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}
.d-contact-modal .d-help-form .d-form-row[hidden],
.d-contact-modal .d-help-form [hidden] {
  display: none;
}
.d-contact-modal .d-help-form label {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink, #171d18);
}
.d-contact-modal .d-form-note,
.d-contact-modal .d-order-block-note {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--muted, #5b6559);
}
.d-contact-modal .d-req {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--berry, #8e1566);
}
.d-contact-modal .d-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.d-contact-modal .d-help-form input:where([type="text"], [type="email"], :not([type])),
.d-contact-modal .d-help-form select,
.d-contact-modal .d-help-form textarea {
  width: 100%;
  min-height: var(--d-field-min-h, 48px);
  padding: var(--d-field-pad, 12px 14px);
  border: 1px solid var(--d-field-border, var(--line, #d9e0d4));
  border-radius: var(--d-field-radius, 12px);
  background: #fff;
  color: var(--d-field-text, var(--ink, #171d18));
  font: inherit;
  font-size: var(--d-field-font-size, 16px);
  box-shadow: var(--d-field-shadow-rest, none);
}
.d-contact-modal .d-help-form textarea {
  min-height: 140px;
  resize: vertical;
}
.d-contact-modal .d-help-form input:focus,
.d-contact-modal .d-help-form select:focus,
.d-contact-modal .d-help-form textarea:focus {
  outline: none;
  border-color: var(--green, #2f8f27);
  box-shadow: var(--d-field-glow, 0 0 0 3px rgba(47, 143, 39, 0.2));
}
.d-contact-modal .d-help-form [aria-invalid="true"] {
  border-color: var(--d-status-fail, #b3261e);
  box-shadow: var(--d-field-error-ring, 0 0 0 3px rgba(179, 38, 30, 0.15));
}
.d-contact-modal .d-field-hint,
.d-contact-modal .d-field-error {
  font-size: 13px;
  line-height: 1.45;
}
.d-contact-modal .d-field-hint {
  color: var(--muted, #5b6559);
}
.d-contact-modal .d-field-error {
  color: var(--d-status-fail, #b3261e);
  font-weight: 600;
}
.d-contact-modal .d-order-block > .d-form-row + .d-form-row {
  margin-top: 16px;
}
.d-contact-modal .d-order-loading,
.d-contact-modal .d-order-fetch-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}
.d-contact-modal .d-order-loading[hidden],
.d-contact-modal .d-order-fetch-error[hidden] {
  display: none;
}
.d-contact-modal .d-form-actions .btn {
  min-height: 48px;
  padding-left: 26px;
  padding-right: 26px;
  border: 0;
  background: var(--berry, #8e1566);
  color: #fff;
}
.d-contact-modal .d-form-actions .btn:hover:not(:disabled) {
  background: var(--berry-dark, #6d0f4e);
}
.d-contact-modal .d-form-actions .btn:disabled {
  opacity: 0.75;
  cursor: progress;
}

/* ---------- the WhatsApp / safety area inside the modal ---------- */
.d-contact-aside {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line, #e2e7dd);
}
.d-contact-aside p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted, #5b6559);
}
.d-contact-aside .d-cta-whatsapp {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  margin: 0 0 12px;
}
.d-contact-aside .d-contact-aside-line {
  color: var(--ink, #171d18);
  font-weight: 600;
}

/* ---------- the payment help block (one per page, quiet, neutral) ---------- */
.d-pay-help {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--line, #e2e7dd);
  border-radius: 14px;
  background: var(--d-surface-quiet, #f7f8f5);
}
.d-pay-help--failed {
  border-left: 4px solid var(--berry, #8e1566);
}
.d-pay-help-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.d-pay-help-body {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted, #5b6559);
}
.d-pay-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}
.d-pay-help-actions .btn {
  min-height: 44px;
}
.d-pay-help-actions .d-pay-help-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid var(--line, #d9e0d4);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #171d18);
  font-weight: 700;
  text-decoration: none;
}
.d-pay-help-actions .d-pay-help-form:hover {
  border-color: var(--berry, #8e1566);
  color: var(--berry, #8e1566);
}
.d-pay-help-actions .d-pay-help-form:focus-visible {
  outline: 2px solid var(--berry, #8e1566);
  outline-offset: 2px;
}
.d-pay-help-safety,
.d-pay-help-shot {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #5b6559);
}
.d-pay-help-safety + .d-pay-help-shot {
  margin-top: 4px;
}
.order-outcome > .d-pay-help {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- the secondary "Or send us a message" links ---------- */
.d-contact-alt {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.d-contact-alt:focus-visible,
.d-foot-contact-form:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.d-cta-band-contact {
  margin: 8px 0 0;
}
.d-foot-contact-form {
  display: inline-block;
  margin-top: 2px;
  font-size: 13px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- phones: full screen ---------- */
@media (max-width: 720px) {
  body.v3-storefront .modal-overlay.d-contact-modal {
    padding: 0;
    align-items: stretch;
  }
  .d-contact-window {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .d-contact-bar {
    min-height: 56px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .d-contact-body {
    padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  }
  .d-pay-help {
    padding: 16px;
  }
  .d-pay-help-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}
