/* ===== Overlay container ===== */
.my-terms-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  font-family: "Poppins", sans-serif;
  color: #69788F;
}

.my-terms-modal.is-open {
  display: block;
}

/* Backdrop should be fixed so it always covers viewport */
.my-terms-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

/* ===== Modal panel ===== */
.my-terms-modal__panel {
  position: relative;
  width: min(980px, 94vw);
  margin: 5vh auto;
  background: #fff;
  border-radius: 12px;

  /* KEY: cap height so internal scrolling becomes possible */
  max-height: 90vh;

  /* KEY: keep header + body contained */
  overflow: hidden;

  box-shadow: 0 10px 40px rgba(0,0,0,0.25);

  display: flex;
  flex-direction: column;
}

/* ===== Header (fixed area) ===== */
.my-terms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 16px 0 28px;
  border-bottom: 1px solid #eee;

  /* keep header from shrinking */
  flex: 0 0 auto;
}

.my-terms-modal__header h3 {
  margin: 0;
  color: #33467B;
  font-size: 20px;
  line-height: 1.3;
}

.my-terms-modal__close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 6px 10px;
}

/* ===== Body (scroll container) ===== */
.my-terms-modal__body {
  /* KEY: body fills remaining space and scrolls */
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 16px 16px 16px;
}

/* Optional: nicer scrolling on iOS */
.my-terms-modal__body {
  -webkit-overflow-scrolling: touch;
}

/* ===== Terms block ===== */
/* Only one scrollbar: modal body. Terms should NOT scroll independently. */
.my-terms-content {
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.6;

  overflow: visible;
  max-height: none;
}

.my-terms-content h3,
.my-terms-content h4 {
  color: #33467B;
  margin-top: 0.8em;
  margin-bottom: 0.4em;
}

.my-terms-content p {
  margin: 0.5em 0;
}

/* Divider */
.my-terms-modal__body hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 16px 0;
}

/* ===== Signature area ===== */
.my-signature {
  padding: 0 16px;
}
.my-signature__pad-wrap {
  margin-top: 10px;
  border: 2px dashed #aaa;
  border-radius: 10px;
  padding: 8px;
  background: #fafafa;
}

.my-signature__canvas {
  display: block;
  width: 100%;
  height: 180px;
}

/* Buttons row */
.my-terms-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.my-terms-error {
  margin-top: 10px;
  color: #b00020;
  font-weight: 600;
}

.my-signature-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 8px;
}

.my-tab {
  border: 1px solid #ddd;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.my-tab.is-active {
  border-color: #111;
  font-weight: 700;
}

.my-tab-panel {
  display: none;
}

.my-tab-panel.is-active {
  display: block;
}

.my-signature-label {
  display: block;
  margin: 8px 0 6px;
  font-weight: 600;
}

.my-typed-signature {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 2px dashed #aaa;
  border-radius: 8px;
}

.my-signature-preview-wrap {
  margin-top: 10px;
}

.my-signature-preview-label {
  font-weight: 600;
  margin-bottom: 6px;
}

.my-typed-preview {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  display: block;
}

.my-signature-help {
  margin-top: 8px;
  opacity: 0.75;
  font-size: 13px;
}

/* ===== Mobile tuning ===== */
@media (max-width: 480px) {
  .my-terms-modal__panel {
    margin: 3vh auto;
    width: 94vw;
    max-height: 94vh;
  }

  .my-terms-modal__body {
    padding: 12px;
  }
}


/* === Force coupon UI to show on mobile === */
@media (max-width: 768px) {

  /* The "Have a coupon?" toggle row */
  .woocommerce-form-coupon-toggle,
  .woocommerce-form-coupon-toggle .woocommerce-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* The actual coupon form container */
  form.woocommerce-form-coupon,
  .woocommerce-form-coupon {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Ensure it isn't pushed off-canvas */
  .woocommerce-form-coupon-toggle,
  .woocommerce-form-coupon {
    position: static !important;
    transform: none !important;
  }

  /* Some themes hide it inside collapsed wrappers */
  .woocommerce-form-coupon-toggle + .woocommerce-form-coupon {
    margin-top: 10px !important;
  }
}

.wcf-embed-checkout-form .wcf-custom-coupon-field button.wcf-submit-coupon {
	background:none !important;
}