#bba-dropin-widget * {
  box-sizing: border-box;
}

/* ===========================
   MODAL SHELL
=========================== */

.bba-dropin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bba-dropin-modal-content {
  background: #fff;
  width: 100%;
  max-width: 980px;
  border-radius: 16px;
  padding: 36px 40px 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.bba-dropin-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* ===========================
   HEADER
=========================== */

.bba-dropin-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 6px;
}

.bba-dropin-subtitle {
  font-size: 16px;
  color: #555;
  margin: 0 0 26px;
}

/* ===========================
   LAYOUT
=========================== */

.bba-dropin-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.bba-dropin-step-label {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}

.bba-dropin-loading {
  font-size: 14px;
  color: #777;
  margin: 0 0 12px;
}

/* ===========================
   CALENDAR
=========================== */

.bba-dropin-calendar {
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.bba-dropin-cal-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bba-cal-month-label {
  text-align: center;
  font-weight: 600;
}

.bba-cal-nav {
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
}

.bba-cal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bba-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 10px 0 8px;
  font-size: 12px;
  color: #666;
  text-align: center;
}

.bba-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.bba-cal-day {
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.bba-cal-day.is-outside {
  opacity: 0.35;
}

.bba-cal-day.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bba-cal-day.is-available {
  border-color: rgba(0, 0, 0, 0.20);
}

.bba-cal-day.is-available:hover {
  border-color: #000;
  background: #fafafa;
}

.bba-cal-day.is-selected {
  border-color: #000;
  background: #f3f3f3;
  box-shadow: inset 0 0 0 1px #000;
}

.bba-cal-hint {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}

/* ===========================
   TIMES
=========================== */

.bba-dropin-times {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bba-dropin-time-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bba-dropin-time-btn:hover {
  border-color: #000;
  background: #fafafa;
}

.bba-dropin-time-btn.is-selected {
  border-color: #000;
  background: #f5f5f5;
  box-shadow: inset 0 0 0 1px #000;
}

.bba-dropin-times-empty {
  border: 1px dashed #ddd;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  color: #777;
  font-size: 14px;
}

/* ===========================
   FORM (UNDER TIMES)
=========================== */

.bba-dropin-form-wrapper {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.bba-dropin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.bba-dropin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bba-dropin-field label {
  font-size: 14px;
  font-weight: 500;
}

.bba-dropin-field input {
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.bba-dropin-field input:focus {
  outline: none;
  border-color: #000;
}

.bba-dropin-submit-btn {
  grid-column: 1 / -1;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.bba-dropin-submit-btn:hover {
  opacity: 0.85;
}

.bba-dropin-message {
  grid-column: 1 / -1;
  font-size: 14px;
  margin: 0;
}

/* ===========================
   MOBILE (BASE)
=========================== */

@media (max-width: 820px) {
  .bba-dropin-modal-content {
    padding: 22px 18px;
    max-width: calc(100vw - 22px);
  }

  .bba-dropin-main {
    grid-template-columns: 1fr;
  }

  .bba-dropin-form {
    grid-template-columns: 1fr;
  }

  .bba-dropin-title {
    font-size: 28px;
  }
}

/* ===========================
   MOBILE POLISH
   (Calendly-ish modal: visible edges + scroll inside)
=========================== */

@media (max-width: 820px) {

  /* Centered modal with padding so you can SEE the edges */
  .bba-dropin-modal {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal stays modal: rounded, shadow, and scrolls internally */
  .bba-dropin-modal-content {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 16px;
    min-height: auto;
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 18px 16px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    background: #fff;
  }

  /* Title spacing (room for close button) */
  .bba-dropin-title {
    font-size: 28px;
    line-height: 1.15;
    margin-right: 54px;
  }

  .bba-dropin-subtitle {
    font-size: 14px;
    margin-bottom: 16px;
  }

  /* Close button bigger tap target */
  .bba-dropin-close-btn {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    border: 1px solid rgba(0, 0, 0, 0.14);
  }

  /* Stack into one column */
  .bba-dropin-main {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Calendar + times tap targets */
  .bba-cal-day {
    height: 46px;
    border-radius: 12px;
    font-size: 14px;
  }

  .bba-dropin-time-btn {
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
  }

  /* Form */
  .bba-dropin-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bba-dropin-field input {
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
  }

  .bba-dropin-submit-btn {
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
  }

  /* Success */
  .bba-dropin-success {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    background: #fff;
  }

  .bba-dropin-success-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
  }

  .bba-dropin-success-subtitle {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
  }

  .bba-dropin-success-details {
    display: grid;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 14px;
  }

  .bba-dropin-success-close {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    background: #000;
    color: #fff;
    cursor: pointer;
  }

  /* Safe-area padding (notches) */
  @supports (padding: max(0px)) {
    .bba-dropin-modal {
      padding-left: max(14px, env(safe-area-inset-left));
      padding-right: max(14px, env(safe-area-inset-right));
      padding-top: max(14px, env(safe-area-inset-top));
      padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
  }
}
