/* Orders Form Custom Layout - Bootstrap Replacement */

/* Payment Information Table */
.payment-info-table .order-number {
  width: 324px;
  white-space: nowrap;
  padding-right: 5px;
}

.payment-info-table .payment-method {
  /* This column starts where the label column starts above */
}

/* Container */
.orders-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

@media (min-width: 576px) {
  .orders-container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

@media (min-width: 768px) {
  .orders-container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

@media (min-width: 992px) {
  .orders-container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .orders-container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

@media (min-width: 1400px) {
  .orders-container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

/* Spacing utilities */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

/* Grid system */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.col-3 {
  flex: 0 0 25%;
  max-width: 25%;
  padding: 0 0.5rem;
}

.col-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding: 0 0.5rem;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 0.5rem;
}

/* Card component */
.card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  display: block;
}

.card-header {
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.375rem 0.375rem 0 0;
  position: relative;
  z-index: 1;
}

.card-body {
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.card-header h5 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

/* Collapsible sections */
.collapse {
  display: none;
}

.collapse.show {
  display: block;
}

.collapse-toggle {
  cursor: pointer;
  user-select: none;
}

.collapse-toggle i.bi-chevron-down {
  transition: transform 0.2s ease;
  display: inline-block;
  transform: rotate(-90deg) !important;
}

.collapse-toggle.expanded i.bi-chevron-down {
  transform: rotate(0deg) !important;
}

/* Form elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #212529;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #212529;
  background-color: #fff;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  appearance: none;
}

.form-select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}

.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  appearance: none;
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25em;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.form-check-label {
  cursor: pointer;
}

/* Table */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #212529;
  vertical-align: top;
  border-color: #dee2e6;
}

.table thead {
  vertical-align: bottom;
}

.table th {
  font-weight: 600;
  text-align: left;
  padding: 0.5rem;
}

.table td {
  padding: 0.5rem;
  border-top: 1px solid #dee2e6;
}

.table-borderless td,
.table-borderless th {
  border: 0;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

/* Text utilities */
.text-muted {
  color: #6c757d !important;
}

.text-center {
  text-align: center;
}

.fw-bold {
  font-weight: 700;
}

.fw-semibold {
  font-weight: 600;
}

.small {
  font-size: 0.875em;
}

/* Display utilities */
.d-none {
  display: none !important;
}

.d-inline-block {
  display: inline-block !important;
}

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

/* Alert */
.alert {
  position: relative;
  padding: 1rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

/* Alignment */
.align-middle {
  vertical-align: middle;
}

/* Order-specific layouts */
.directory-photo-column {
  width: 120px;
}

/* Order type color bar shown under the sitting number on the Order view */
.order-type-bar {
  display: block;
  height: 6px;
  width: 100%;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.order-type-bar.pms-yellow-bg { /* ensure readable contrast for yellow */
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}

.directory-name-column {
  width: auto;
}

.montage-code-column {
  width: 300px;
  vertical-align: top;
  padding-right: 1rem;
}

.montage-layout-column {
  width: auto;
  vertical-align: top;
}

.montage-form-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.montage-form-table td {
  padding: 0.5rem;
  vertical-align: middle;
}

/* Montage photo input tables */
.montage-photo-table {
  border-collapse: separate;
  border-spacing: 4px;
  width: 100%;
}

/* Layout 237 specific table */
.montage-photo-table-237 {
  padding: 10px;
  background: var(--pms-color-grey);
  width: 140px;
  height: 140px;
  table-layout: fixed;
}

/* Layout 238 specific table */
.montage-photo-table-238 {
  padding: 7.5px 0px;
  background: var(--pms-color-grey);
  width: 180px;
  height: 100px;
  display: block;
}

/* Layout 239 specific table */
table.montage-photo-table-239 {
  padding: 5px;
  background: var(--pms-color-grey);
  width: 70px;
  height: 240px;
  display: block;
}

/* Layout 242 specific table */
table.montage-photo-table-242 {
  padding: 15px 10px;
  background: var(--pms-color-grey);
  width: 240px;
  height: 100px;
  display: block;
}

/* Layouts 245, 255, 265, 20x24H (Tri-Image Horizontal) */
table.montage-photo-table-tri-img-h {
  background: var(--pms-color-grey);
  width: 140px;
  height: 110px;
}

/* Layouts 246, 248, 249, 20x24V (Tri-Image Vertical) */
table.montage-photo-table-tri-img-v {
  background: var(--pms-color-grey);
  width: 110px;
  height: 140px;
}

.montage-photo-cell-main,
.montage-photo-cell-main-237 {
  border: 1px solid #dee2e6;
  padding: 0.5rem;
  vertical-align: middle;
  text-align: center;
  width: 60%;
  background: transparent;
}

.montage-photo-cell-side,
.montage-photo-cell-side-237 {
  border: 1px solid #dee2e6;
  padding: 0.5rem;
  vertical-align: middle;
  text-align: center;
  width: 40%;
  background: transparent;
}

.montage-photo-table tr:first-child .montage-photo-cell-side-237 {
  position: relative;
  top: 0;
}

.montage-photo-table tr:last-child .montage-photo-cell-side-237 {
  position: relative;
  top: 0;
}

.montage-main-input,
.montage-main-input-237 {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  font-size: 1rem;
  text-align: center;
  background: white;
}

/* Main photo input for 245/255/265 montages */
.montage-main-input {
  height: 100px;
  width: 90px;
}

/* Main photo input for 237 montage - 1 pixel = 1/10th inch */
.montage-main-input-237 {
  height: 100px;
  width: 75px;
}

.montage-side-input,
.montage-side-input-237 {
  width: 100%;
  padding: 0.375rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: center;
  background: white;
}

/* Side photo inputs for 245/255/265 montages */
.montage-side-input {
  height: 45px;
  width: 30px;
}

/* Side photo inputs for 237 montage - 1 pixel = 1/10th inch */
.montage-side-input-237 {
  height: 52.5px;
  width: 37.5px;
}

/* Layout 238 cells and inputs - increased specificity via parent selector */
.montage-photo-table-238 .montage-photo-cell-238 {
  padding-left: 7.5px;
  padding-right: 0;
}

.montage-photo-table-238 .montage-input-238 {
  height: 70px;
  width: 50px;
  text-align: center;
  padding: 2px;
  border-radius: 0;
}

/* Layout 239 cells and inputs - increased specificity via parent selector */
.montage-photo-table-239 .montage-photo-cell-239 {
  width: 50px;
  padding-top: 5px;
  padding-bottom: 0px;
  padding-left: 5px;
  padding-right: 0px;
}

.montage-photo-table-239 .montage-input-239 {
  height: 70px;
  width: 50px;
  text-align: center;
  font-size: 1rem;
  padding: 2px;
  border-radius: 0;
}

/* Layout 242 cells and inputs - increased specificity via parent selector */
.montage-photo-table-242 .montage-photo-cell-242-small {
  padding: 0 0 0 5px;
}

.montage-photo-table-242 .montage-input-242-small {
  height: 70px;
  width: 50px;
  text-align: center;
  border-radius: 0;
}

.montage-photo-table-242 .montage-photo-cell-242-large {
  padding: 0 0 0 5px;
}

.montage-photo-table-242 .montage-input-242-large {
  height: 70px;
  width: 100px;
  text-align: center;
  border-radius: 0;
  padding: 5px;
}

/* Tri-Image Horizontal cells and inputs - increased specificity */
td.montage-photo-cell-main-tri-img-h {
  padding: 3.75px 0px 3.75px 10px;
  width: 87.5px;
}

td.montage-photo-cell-side-tri-img-h-top {
  padding: 5px 0px 1.25px 8.75px;
}

td.montage-photo-cell-side-tri-img-h-bottom {
  padding: 1.25px 0px 5px 8.75px;
}

input.form-control.montage-main-input-tri-img-h {
  width: 75px;
  height: 100px;
  border-radius: 0px;
  padding: 2px;
  text-align: center;
}

input.form-control.montage-side-input-tri-img-h {
  width: 35px;
  height: 47.5px;
  border-radius: 0px;
  padding: 2px;
  text-align: center;
}

/* Tri-Image Vertical cells and inputs - increased specificity */
td.montage-photo-cell-main-tri-img-v {
  padding: 10px 8.75px 10px 13.75px;
}

input.form-control.montage-input-main-tri-img-v {
  width: 82.5px;
  height: 56.25px;
  border-radius: 0px;
  text-align: center;
}

td.montage-photo-cell-tri-img-v-bottom-left {
  padding: 0 5px 10px 10px;
}

td.montage-photo-cell-tri-img-v-bottom-right {
  padding: 0 10px 10px 0;
}

input.form-control.montage-input-tri-img-v-bottom {
  border-radius: 0px;
  text-align: center;
  width: 40px;
  height: 57.5px;
}

/* Montage labels for review page - same styling as inputs but without borders */
label.montage-main-input-237 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  height: 100px;
  width: 75px;
  border-radius: 0.25rem;
}

label.montage-side-input-237 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 0.875rem;
  font-weight: bold;
  color: #0d6efd;
  height: 52.5px;
  width: 37.5px;
  border-radius: 0.25rem;
}

label.montage-input-238 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  height: 70px;
  width: 50px;
  border-radius: 0;
  padding: 2px;
}

label.montage-input-239 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  height: 70px;
  width: 50px;
  border-radius: 0;
  padding: 2px;
}

label.montage-input-242-small {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  height: 70px;
  width: 50px;
  border-radius: 0;
}

label.montage-input-242-large {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  height: 70px;
  width: 100px;
  border-radius: 0;
  padding: 5px;
}

label.montage-main-input-tri-img-h {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  width: 75px;
  height: 100px;
  border-radius: 0;
  padding: 2px;
}

label.montage-side-input-tri-img-h {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 0.875rem;
  font-weight: bold;
  color: #0d6efd;
  width: 35px;
  height: 47.5px;
  border-radius: 0;
  padding: 2px;
}

label.montage-input-main-tri-img-v {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-weight: bold;
  color: #0d6efd;
  width: 82.5px;
  height: 56.25px;
  border-radius: 0;
}

label.montage-input-tri-img-v-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #ced4da;
  font-size: 0.875rem;
  font-weight: bold;
  color: #0d6efd;
  border-radius: 0;
  width: 40px;
  height: 57.5px;
}

.montage-main-input:focus,
.montage-main-input-237:focus,
.montage-side-input:focus,
.montage-side-input-237:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}


.individual-products-grid {
  display: grid;
  gap: 1rem;
}

.order-action-button {
  min-width: 120px;
}

.clear-form-badge {
  cursor: pointer;
}

/* Additional utilities for orders */
.stands-quantity-input {
  width: 100px;
}

/* Order summary number inputs */
.summary-number-input {
  width: 120px;
  display: inline-block;
}

.payment-amount-input {
  width: 120px;
}

.pose-number-input {
  width: 80px;
}

.directory-photo-input {
  width: 60px;
}

/* Responsive */
@media (max-width: 768px) {
  .col-3, .col-4, .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .orders-container {
    padding: 0.5rem;
  }
}

/* Production directory header alignment fixes */
.d-flex {
  margin-top: -0px;
}

.flex-column {
  gap: 1rem;
}
