/* Mobile hardening for public, dealer and admin pages. */
html {
  -webkit-text-size-adjust: 100%;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.responsive-table table {
  min-width: 720px;
}

.bid-history-card {
  overflow: hidden;
}

.bid-history-card .h6 {
  font-size: .98rem;
}

.bid-history-card .btn-sm {
  min-height: 30px;
  padding: .25rem .55rem;
  line-height: 1.15;
}

.bid-history-table-wrap {
  overflow-x: visible;
}

.bid-history-table-wrap .bid-history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: .88rem;
}

.bid-history-table th,
.bid-history-table td {
  padding: .45rem .5rem;
  white-space: normal;
  vertical-align: middle;
}

.bid-history-table th:first-child,
.bid-history-table td:first-child {
  width: 42%;
}

.bid-history-table th:nth-child(2),
.bid-history-table td:nth-child(2) {
  width: 30%;
}

.bid-history-table th:nth-child(3),
.bid-history-table td:nth-child(3) {
  width: 28%;
  text-align: right;
}

.form input,
.form select,
.form textarea,
form input,
form select,
form textarea {
  max-width: 100%;
}

.plate-input {
  max-width: 100%;
}

@media (min-width: 992px) {
  .app-wrapper {
    min-height: 100vh;
  }

  .app-header {
    height: 56px;
  }

  .app-body {
    min-height: calc(100vh - 56px);
  }

  .app-sidebar {
    position: fixed !important;
    top: 56px !important;
    left: 0;
    bottom: 0;
    height: auto !important;
    width: 260px !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1020;
  }

  .app-sidebar + .app-main {
    margin-left: 260px;
  }
}

@media (max-width: 991.98px) {
  .app-header .container,
  .app-header .container-fluid {
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .app-header .navbar-brand {
    min-width: 0 !important;
    margin-right: auto;
  }

  .app-header .nav-tab {
    margin-left: 0 !important;
    flex: 1 1 auto;
  }

  .app-header .navbar-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .app-body {
    display: block !important;
  }

  .app-sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    min-height: auto !important;
    max-height: 42vh;
    overflow-y: auto;
  }

  .app-sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .app-sidebar .text-uppercase {
    grid-column: 1 / -1;
  }

  .app-content {
    padding: 12px !important;
  }

  .app-content > .container,
  .app-content > .container-fluid,
  .app-main .container {
    max-width: 100% !important;
    padding-left: 0;
    padding-right: 0;
  }

  .card {
    border-radius: 14px;
  }

  .row.g-2,
  .row.g-3,
  .row.g-4 {
    --bs-gutter-x: .75rem;
  }
}

@media (max-width: 767.98px) {
  body {
    overflow-x: hidden;
  }

  h1,
  .h1 {
    font-size: clamp(1.65rem, 9vw, 2.4rem);
    line-height: 1.05;
  }

  h2,
  .h2 {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }

  .navbar .container,
  .navbar .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  main.container,
  .public-page main.container {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  .public-footer-links,
  .app-footer .d-flex {
    flex-direction: column;
    gap: 6px !important;
  }

  .app-sidebar nav {
    grid-template-columns: 1fr;
  }

  .btn,
  button,
  input[type="submit"] {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .dealer-portal .card .row,
  .dealer-portal .card .row > [class*="col-"] {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .dealer-portal .card .card-body {
    padding: 12px !important;
  }

  .dealer-portal form[action="/dealer/bid"] {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch !important;
  }

  .dealer-portal form[action="/dealer/bid"] input,
  .dealer-portal form[action="/dealer/bid"] button,
  .dealer-portal form[action="/dealer/bid"] [style*="min-width"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .square-thumb,
  .gallery-current {
    width: 100% !important;
    max-height: 260px;
    object-fit: cover;
  }

  .form-grid,
  .grid.two,
  .sell-form .grid.two {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .form-grid > *,
  .grid.two > *,
  .sell-form [style*="grid-column"] {
    grid-column: auto !important;
  }

  .wizard-progress {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .wizard-step small {
    font-size: .75rem;
  }

  .plate-input[style] {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .modal-dialog {
    margin: .5rem;
  }

  table th,
  table td {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .app-header .nav-tab {
    width: calc(50% - 4px);
    flex: 0 0 calc(50% - 4px);
  }

  .dashboard-logo-text {
    font-size: .95rem;
  }

  .responsive-table table {
    min-width: 640px;
  }
}
