/* Mobile-first touch-friendly form controls — ported 1:1 from Flask MVP */
.form-control,
.form-select {
  min-height: 3rem;
  font-size: 1.05rem;
}

.form-check-input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
}

.form-check-label {
  font-size: 1.05rem;
  padding-left: 0.35rem;
}

.btn-lg-touch {
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

textarea.form-control {
  min-height: 5rem;
}

/* Detail page gallery (not the form picker) */
.shipment-image-preview {
  display: block;
  max-width: 100%;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #f8f9fa;
}

/*
 * Shared form image picker gallery — hard pixel box so natural image
 * dimensions can never expand the layout (do not rely on aspect-ratio alone).
 */
.image-collection-gallery {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.image-collection-tile {
  position: relative;
  flex: 0 0 auto !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  box-sizing: border-box;
  border-radius: 0.5rem;
  overflow: hidden !important;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.image-collection-tile--existing {
  height: auto !important;
  max-height: none !important;
  padding-bottom: 0.35rem;
}

.image-collection-tile--existing .image-collection-thumb {
  width: 120px !important;
  height: 120px !important;
}

.image-collection-existing-delete {
  margin: 0.35rem 0.35rem 0;
  font-size: 0.85rem;
}

.image-collection-thumb {
  display: block !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 100% !important;
  max-height: 120px !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0;
  border-radius: 0;
  background: #f8f9fa;
}

/* Legacy alias used by older markup — force same hard box */
.shipment-image-thumb {
  display: block !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 100% !important;
  max-height: 120px !important;
  object-fit: cover !important;
  object-position: center !important;
  background: #f8f9fa;
}

.image-collection-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(33, 37, 41, 0.78);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.image-collection-remove:hover,
.image-collection-remove:focus-visible {
  background: rgba(220, 53, 69, 0.95);
  outline: none;
}

.image-collection-form-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Point picker (list search, no map) */
.point-section {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.point-card {
  line-height: 1.35;
}

.point-results {
  max-height: 22rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.point-result-item {
  min-height: 3.5rem;
}

.delivery-method-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: #fff;
}

.delivery-method-option:has(input:checked) {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 1px var(--bs-primary);
}

.delivery-method-fieldset {
  min-inline-size: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 575.98px) {
  .image-collection-tile,
  .image-collection-tile--existing .image-collection-thumb,
  .image-collection-thumb,
  .shipment-image-thumb {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
  }

  .image-collection-tile {
    max-width: 110px !important;
    max-height: 110px !important;
  }

  .image-collection-tile--existing {
    max-height: none !important;
    height: auto !important;
  }

  .navbar-text {
    display: none;
  }
}
