/* WD Company Editor Popups — UI skin aligned to RAC Booking Editor Popup (Tabs) - v1.3.23
 * Version: 1.0.3
 * - Blur overlay (backdrop-filter)
 * - Same modal sizing rules (desktop ~60vw, mobile ~96vw)
 * - Stable internal scrolling: grid scrolls, actions stay visible
 * - Primary accents: #00B9FF (same as booking editor tabs)
 */

/* Overlay + blur */
.wd-ce-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999999;
  font-family: inherit;
}
.wd-ce-modal[aria-hidden="false"]{ display: block; }

.wd-ce-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Dialog — match booking editor sizing behavior */
.wd-ce-dialog{
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow: hidden;
  z-index: 1000000;

  /* Layout */
  display: flex;
  flex-direction: column;
}

/* Desktop: ~60% width, tall modal */
@media (min-width: 921px){
  .wd-ce-dialog{
    top: 6vh;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 88vh;
  }
}

/* Mobile / small: almost full width */
@media (max-width: 920px){
  .wd-ce-dialog{
    top: 3vh;
    left: 50%;
    transform: translateX(-50%);
    width: 96vw;
    height: 94vh;
  }
}

/* Header */
.wd-ce-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e7e7e7;
  gap: 10px;
}
.wd-ce-title{
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.wd-ce-close{
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

/* Form layout: grid scrolls, actions stay pinned */
.wd-ce-form{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px 16px;
}

.wd-ce-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;

  /* key: allow internal scrolling without pushing header/actions */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 768px){
  .wd-ce-grid{ grid-template-columns: 1fr; }
}

/* Fields */
.wd-ce-field label{
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px 0;
}
.wd-ce-field input,
.wd-ce-field select,
.wd-ce-field textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 10px 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.wd-ce-field input:focus,
.wd-ce-field select:focus,
.wd-ce-field textarea:focus{
  border-color: rgba(0,0,0,.4);
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

/* Actions */
.wd-ce-actions{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  background: #fff;
  padding: 12px 0 6px;
  border-top: 1px solid #e7e7e7;
}

/* Buttons */
.wd-ce-btn{
  appearance: none;
  border: 1px solid rgba(0,0,0,.18);
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  font-weight: 700;
}
.wd-ce-btn:hover{ border-color: rgba(0,0,0,.35); }
.wd-ce-btn:disabled{ opacity: .6; cursor: not-allowed; }

.wd-ce-btn--primary{
  border: 1px solid #00B9FF;
  background: #00B9FF;
  color: #fff;
}

/* Note & Toast (keep existing behavior) */
.wd-ce-note{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  font-size: 13px;
}
.wd-ce-toast{
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 1000001;
  display: none;
  background: #111;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.wd-ce-toast.is-on{ display: block; }

/* Mobile: keep buttons compact (similar to booking editor "tab height ~= font height") */
@media (max-width: 920px){
  .wd-ce-btn{
    padding: 10px 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
