
/* CrewRenew Merchant Tools UI polish v1.5.1 */
.cr-mt-wrap{
  max-width: 760px;
  margin: 18px auto;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(2,6,23,0.06);
}

.cr-mt-wrap h1,
.cr-mt-wrap h2,
.cr-mt-wrap h3{
  margin: 0 0 10px 0;
  line-height: 1.15;
}

.cr-mt-wrap p{
  margin: 0 0 12px 0;
  color: #475569;
}

.cr-mt-wrap label strong{
  display: inline-block;
  margin-bottom: 6px;
}

.cr-mt-wrap input[type="text"],
.cr-mt-wrap input[type="url"],
.cr-mt-wrap input[type="email"],
.cr-mt-wrap input[type="tel"],
.cr-mt-wrap input[type="number"],
.cr-mt-wrap textarea,
.cr-mt-wrap select{
  width: 100% !important;
  box-sizing: border-box;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.cr-mt-wrap textarea{ min-height: 120px; }

.cr-mt-wrap input:focus,
.cr-mt-wrap textarea:focus,
.cr-mt-wrap select:focus{
  border-color: #0b3a7a;
  box-shadow: 0 0 0 4px rgba(11,58,122,0.12);
}

.cr-mt-wrap small,
.cr-mt-wrap .cr-hint{
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.cr-mt-wrap .cr-row{
  display: grid;
  gap: 14px;
}

.cr-mt-wrap .cr-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.cr-mt-wrap button,
.cr-mt-wrap input[type="submit"]{
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.cr-mt-wrap button:hover,
.cr-mt-wrap input[type="submit"]:hover{
  filter: brightness(0.98);
}

.cr-mt-wrap button:disabled,
.cr-mt-wrap input[type="submit"]:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.cr-mt-wrap .cr-primary{
  border: 0;
  background: #0b3a7a;
  color: #fff;
}

.cr-mt-wrap .cr-card{
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}

.cr-mt-wrap .cr-alert{
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.cr-mt-wrap .cr-alert--error{
  border-color: #ffb4b4;
  background: #fff0f0;
  color: #7a0b0b;
}

.cr-mt-wrap .cr-alert--success{
  border-color: #b7f0cc;
  background: #e8fff1;
  color: #064e2a;
}

.cr-mt-wrap .cr-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
}

@media (max-width: 520px){
  .cr-mt-wrap{ padding: 14px; margin: 12px auto; border-radius: 14px; }
  .cr-mt-wrap button, .cr-mt-wrap input[type="submit"]{ width: 100%; justify-content: center; }
}


/* Preview mount spacing */
.cr-mt-wrap #cr_preview_mount{margin: 6px 0 10px 0;}
.cr-mt-wrap #cr_preview_section{width:100%;}



/* Cleaner preview section (no explanatory header) */
.cr-mt-wrap .cr-preview-card{
  background:#fafafa;
  padding: 14px;
}

/* Neat image upload box */
.cr-mt-wrap .cr-image-box{
  background:#fafafa;
  padding: 14px;
}

.cr-mt-wrap .cr-image-box input[type="file"]{
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background:#fff;
}

.cr-mt-wrap .cr-image-box img{
  display:block;
}

.cr-mt-wrap .cr-image-box label{
  margin:0;
}


/* Container fix for image upload box */
.cr-mt-wrap .cr-image-box{
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.cr-mt-wrap .cr-image-box > *{
  box-sizing: border-box;
}


.cr-mt-wrap form{
  width: 100%;
}


/* Bulletproof container alignment (theme overrides protection) */
.cr-mt-wrap, .cr-mt-wrap *,
.cr-mt-wrap *::before, .cr-mt-wrap *::after{
  box-sizing: border-box !important;
}

.cr-mt-wrap form,
.cr-mt-wrap form > div,
.cr-mt-wrap .cr-image-box,
.cr-mt-wrap #cr_preview_section,
.cr-mt-wrap #cr_preview_mount{
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  float: none !important;
  clear: both !important;
}

.cr-mt-wrap form > div{
  display: block !important;
}

.cr-mt-wrap .cr-image-box{
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  overflow: hidden;
}

.cr-mt-wrap .cr-image-box > div{
  width: 100% !important;
}

.cr-mt-wrap .cr-image-box input[type="file"]{
  display:block !important;
  width: 100% !important;
}


/* Ensure preview + save buttons have breathing room */
.cr-mt-wrap #cr_preview_btn{
  margin-right: 10px !important;
}


/* Button spacing (flex-gap fallback for any weird theme/browser) */
.cr-mt-wrap #cr_preview_btn{
  margin-right: 12px !important;
}
.cr-mt-wrap button[name="cr_save_discount"],
.cr-mt-wrap input[name="cr_save_discount"]{
  margin-left: 0 !important;
}


/* Hide preview section until user opens preview (prevents empty box/gap) */
.cr-mt-wrap #cr_preview_section{
  display: none;
}


@media (max-width: 520px){
  .cr-mt-wrap #cr_preview_btn{
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 10px !important;
  }
  .cr-mt-wrap button[name="cr_save_discount"],
  .cr-mt-wrap input[name="cr_save_discount"]{
    width: 100% !important;
  }
}


/* Stronger required image callout */
.cr-mt-wrap .cr-image-required{
  font-weight: 900;
  font-size: 16px;
  color: #b91c1c;
  margin: 8px 0 6px 0;
}

/* Replace confusing remove checkbox with a clear button */
.cr-mt-wrap .cr-mt-btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
}
.cr-mt-wrap .cr-mt-btn-secondary:hover{ background:#e2e8f0; }
.cr-mt-wrap .cr-mt-btn-secondary.is-danger{
  background:#fff0f0;
  border-color:#ffb4b4;
  color:#7a0b0b;
}

/* Hide merchant offer-active checkbox (dashboard controls this) */
.cr-mt-wrap #cr_discount_active{ display:none !important; }
.cr-mt-wrap label[for="cr_discount_active"]{ display:none !important; }

.cr-mt-wrap #cr_remove_image_btn{width:100%;justify-content:center;}


/* ===== Offer image upload UX ===== */
.cr-mt-wrap #cr-mt-offer-image-input{
  position:absolute !important;
  left:-9999px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
}
.cr-mt-wrap .cr-mt-upload-row{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cr-mt-wrap .cr-mt-upload-btn{
  width:100%;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid #cbd5e1;
  background:#f8fafc;
  color:#0f172a;
  font-weight:800;
  font-size:16px;
  cursor:pointer;
}
.cr-mt-wrap .cr-mt-upload-btn:hover{ background:#eef2f7; }
.cr-mt-wrap .cr-mt-upload-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}
.cr-mt-wrap .cr-mt-upload-status{
  font-size:13px;
  color:#64748b;
}
/* Ensure offer image inside box never stretches the page */
.cr-mt-wrap .cr-image-box img{
  width:100% !important;
  height:220px !important;
  max-height:220px !important;
  object-fit:cover !important;
  display:block;
  border-radius:14px;
}
@media (max-width: 520px){
  .cr-mt-wrap .cr-image-box img{ height:200px !important; max-height:200px !important; }
}


/* ===== Prevent overflow / right-edge touching when image exists ===== */
.cr-mt-wrap{
  overflow: hidden;
}
.cr-mt-wrap *{
  box-sizing: border-box;
  max-width: 100%;
}
.cr-mt-wrap input,
.cr-mt-wrap textarea,
.cr-mt-wrap select,
.cr-mt-wrap button{
  max-width: 100%;
}
.cr-mt-wrap .cr-card{
  margin-bottom: 12px;
}


/* Remove warning icon but keep text */
.cr-mt-wrap .cr-image-required svg,
.cr-mt-wrap .cr-image-required i,
.cr-mt-wrap .cr-image-required .icon,
.cr-mt-wrap .cr-image-required::before{
  display:none !important;
  content:none !important;
}
