/* ============================================================
   Shared camera-capture modal — public/js/camera-capture.js +
   views/partials/camera-capture-modal.ejs. Self-contained (no
   Bootstrap dependency) so it works identically on every page it's
   added to, admin or customer, whether or not that page already
   loads Bootstrap's JS bundle.
   ============================================================ */

.cam-capture-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cam-capture-modal[hidden] { display: none; }

.cam-capture-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.55);
}

.cam-capture-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.cam-capture-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.cam-capture-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-charcoal, #2c2418);
}
.cam-capture-modal-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-stone, #7a6a58);
  padding: 4px;
}
.cam-capture-modal-close:hover { color: var(--color-charcoal, #2c2418); }

.cam-capture-modal-body {
  padding: 1rem 1.25rem;
}
.cam-capture-modal-body video {
  width: 100%;
  max-height: 55vh;
  border-radius: 12px;
  background: #000;
  display: block;
  object-fit: cover;
}
.cam-capture-modal-err {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 8px;
  min-height: 1em;
}

.cam-capture-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* Generic fallback buttons — used only on pages that don't pass their own
   theme classes via camera-capture-modal.ejs's primaryBtnClass/
   secondaryBtnClass locals. */
.cam-capture-btn-primary {
  background: var(--color-charcoal, #2c2418);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.cam-capture-btn-primary:disabled { opacity: 0.5; cursor: default; }
.cam-capture-btn-secondary {
  background: transparent;
  color: var(--color-charcoal, #2c2418);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .cam-capture-modal { padding: 8px; }
  .cam-capture-modal-dialog { max-height: calc(100dvh - 16px); }
  .cam-capture-modal-header,
  .cam-capture-modal-body,
  .cam-capture-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
