/* Custom styles for CCCMS
   Added styles to support the responsive card/grid layout used on order_items_new.ejs
*/

/* Ensure cards in the order item list have consistent height and spacing */
#orderitemlist .card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  border-radius: 0.35rem;
}

#orderitemlist .card .card-body {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

#orderitemlist .card-title {
  font-size: 1rem;
  margin-bottom: .25rem;
  word-break: break-word;
}

#orderitemlist .card-text {
  color: var(--bs-body-color, #6c757d);
  margin-bottom: .5rem;
}

/* Action buttons should wrap nicely on small screens */
#orderitemlist .card .btn {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  /* Make action buttons stack vertically on very small screens */
  #orderitemlist .card .d-flex.mb-2 {
    flex-wrap: wrap;
    gap: .35rem;
  }

  #orderitemlist .card .d-flex.mb-2 .btn {
    flex: 1 1 auto;
  }

  /* Slightly reduce padding on cards for mobile */
  #orderitemlist .card {
    min-height: auto;
  }
}

/* Small helper tweaks */
#orderitemlist .badge {
  font-size: 0.8rem;
  padding: .35em .5em;
}

/* Product card columns: Ensure same height columns in repeat_products row, vertical stretching */
#repeat_products > .col-3 {
  display: flex;
  flex-direction: column;
}
#repeat_products .d-flex.bg-secondary-subtle {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Keep product title, sku, and price aligned at same heights in card - especially making title take same height across products */
#repeat_products h4[dmx-text][class],
#repeat_products .product-title {
  min-height: 2.5em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
}
#repeat_products .product-sku-price-wrap {
  min-height: 2.6em;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  gap: 0.10em;
}
#repeat_products .product-sku {
  font-size: 0.95em;
}
#repeat_products .product-price {
  font-weight: bold;
}

/* Responsive behavior: allow stacking nicely on very small screens */
@media (max-width: 767.98px) {
  #repeat_products h4[dmx-text][class],
  #repeat_products .product-title {
    min-height: auto;
  }
  #repeat_products .product-sku-price-wrap {
    min-height: auto;
    align-items: flex-start;
  }
}

/* Login page - basic look */
.login-bg {
  background: #e9ecef;
  min-height: 100vh;
}

.login-bg .card {
  background: #fff;
  box-shadow: 0 2px 16px rgba(30,40,56,0.07);
}

.login-bg .card-header {
  background: #222c3a;
  border-bottom: none;
  position: relative;
}

.login-bg .card-header img {
  filter: none;
  background: none;
  border-radius: 0;
  padding: 1rem;
  box-shadow: none;
}

.login-bg .card-body {
  border-radius: 0 0 0.5rem 0.5rem;
  background: #fff;
}

.login-bg .btn-primary {
  background: #2573b8;
  border: none;
  box-shadow: 0 1px 2px rgba(44,92,160,0.08);
}
.login-bg .btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 0.1rem #92b8d4;
}

.login-bg .btn-lg {
  font-size: 1rem;
  font-weight: 500;
  border-radius: .35rem;
}

.login-bg .form-control:focus {
  border-color: #b5c8da;
  box-shadow: 0 0 2px #cbddeb;
}

.login-bg .alert-danger {
  border-left: 3px solid #dc3545;
  background: #f9e9ec;
}
.login-bg .alert-success {
  border-left: 3px solid #20c997;
  background: #eaf9f3;
}
