/**
 * Bootstrap 4 → 5 visual compatibility for AIZ admin / storefront markup.
 * Loaded after Bootstrap 5.3.x so existing BS4 class names keep similar layout.
 */

/* BS5 underlines every <a> by default; restore BS4 (no underline).
   Content that needs underlines can still use .text-decoration-underline. */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-link-decoration: none;
  --bs-link-hover-decoration: none;
}
a,
a:hover,
a:focus,
a:active,
a:visited {
  text-decoration: none;
}

/* Spacing: directional aliases (BS4 → BS5 logical) */
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: .25rem !important; }
.ml-2 { margin-left: .5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.ml-auto { margin-left: auto !important; }
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: .25rem !important; }
.mr-2 { margin-right: .5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }
.mr-auto { margin-right: auto !important; }
.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: .25rem !important; }
.pl-2 { padding-left: .5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }
.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: .25rem !important; }
.pr-2 { padding-right: .5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

.float-left { float: left !important; }
.float-right { float: right !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }

@media (min-width: 576px) {
  .ml-sm-0 { margin-left: 0 !important; } .mr-sm-0 { margin-right: 0 !important; }
  .ml-sm-1 { margin-left: .25rem !important; } .mr-sm-1 { margin-right: .25rem !important; }
  .ml-sm-2 { margin-left: .5rem !important; } .mr-sm-2 { margin-right: .5rem !important; }
  .ml-sm-3 { margin-left: 1rem !important; } .mr-sm-3 { margin-right: 1rem !important; }
  .ml-sm-auto { margin-left: auto !important; } .mr-sm-auto { margin-right: auto !important; }
}
@media (min-width: 768px) {
  .ml-md-0 { margin-left: 0 !important; } .mr-md-0 { margin-right: 0 !important; }
  .ml-md-1 { margin-left: .25rem !important; } .mr-md-1 { margin-right: .25rem !important; }
  .ml-md-2 { margin-left: .5rem !important; } .mr-md-2 { margin-right: .5rem !important; }
  .ml-md-3 { margin-left: 1rem !important; } .mr-md-3 { margin-right: 1rem !important; }
  .ml-md-auto { margin-left: auto !important; } .mr-md-auto { margin-right: auto !important; }
}
@media (min-width: 992px) {
  .ml-lg-0 { margin-left: 0 !important; } .mr-lg-0 { margin-right: 0 !important; }
  .ml-lg-1 { margin-left: .25rem !important; } .mr-lg-1 { margin-right: .25rem !important; }
  .ml-lg-2 { margin-left: .5rem !important; } .mr-lg-2 { margin-right: .5rem !important; }
  .ml-lg-3 { margin-left: 1rem !important; } .mr-lg-3 { margin-right: 1rem !important; }
  .ml-lg-auto { margin-left: auto !important; } .mr-lg-auto { margin-right: auto !important; }
}

.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-italic { font-style: italic !important; }

.form-group { margin-bottom: 1rem; }
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
}
.form-row > .col,
.form-row > [class*="col-"] {
  padding-right: 5px;
  padding-left: 5px;
}

.btn-block {
  display: block;
  width: 100%;
}
.btn-block + .btn-block {
  margin-top: .5rem;
}

/* Badges: BS4 color helpers */
.badge-primary { color: #fff; background-color: #007bff; }
.badge-secondary { color: #fff; background-color: #6c757d; }
.badge-success { color: #fff; background-color: #28a745; }
.badge-danger { color: #fff; background-color: #dc3545; }
.badge-warning { color: #212529; background-color: #ffc107; }
.badge-info { color: #fff; background-color: #17a2b8; }
.badge-light { color: #212529; background-color: #f8f9fa; }
.badge-dark { color: #fff; background-color: #343a40; }
.badge-pill { border-radius: 10rem; padding-right: .6em; padding-left: .6em; }

/* Input groups */
.input-group-prepend,
.input-group-append {
  display: flex;
}
.input-group-prepend .btn,
.input-group-append .btn,
.input-group-prepend .input-group-text,
.input-group-append .input-group-text {
  border-radius: 0;
}
.input-group-prepend .btn:first-child,
.input-group-prepend .input-group-text:first-child {
  border-top-left-radius: .25rem;
  border-bottom-left-radius: .25rem;
}
.input-group-append .btn:last-child,
.input-group-append .input-group-text:last-child {
  border-top-right-radius: .25rem;
  border-bottom-right-radius: .25rem;
}
.input-group > .input-group-prepend > .btn,
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-append:not(:last-child) > .btn,
.input-group > .input-group-append:not(:last-child) > .input-group-text {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group > .form-control:not(:first-child),
.input-group > .custom-select:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Modal close (BS4 .close) */
.modal-header .close,
button.close {
  padding: .5rem .5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  background-color: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: .5;
}
.modal-header .close:hover,
button.close:hover {
  color: #000;
  text-decoration: none;
  opacity: .75;
}

/* Custom file / custom control leftovers */
.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: calc(1.5em + .75rem + 2px);
  margin-bottom: 0;
}
.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(1.5em + .75rem + 2px);
  margin: 0;
  opacity: 0;
}
.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: calc(1.5em + .75rem + 2px);
  padding: .375rem .75rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: .25rem;
}

/* Forms: BS4 custom-select ≈ form-select */
.custom-select {
  display: block;
  width: 100%;
  padding: .375rem 1.75rem .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  appearance: none;
}

/* Media object remnant */
.media { display: flex; align-items: flex-start; }
.media-body { flex: 1; }

/* Dropdown: BS4 data API sometimes relied on .show on parent */
.dropdown-menu.show { display: block; }

/* Keep card deck / columns roughly usable */
.card-deck {
  display: flex;
  flex-flow: row wrap;
  margin-right: -15px;
  margin-left: -15px;
}
.card-deck .card {
  flex: 1 0 0%;
  margin-right: 15px;
  margin-bottom: 0;
  margin-left: 15px;
}
