/* Responsive fixes layered on top of the legacy theme. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  min-width: 0;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

iframe {
  border: 0;
}

.container,
.container-fluid {
  max-width: 100%;
}

.row {
  min-width: 0;
}

.form-control,
.custom-select,
.select2-container {
  max-width: 100%;
}

textarea.form-control {
  min-height: 120px;
}

.btn,
button,
input[type="submit"] {
  white-space: normal;
}

.modal {
  padding-right: 0 !important;
}

.modal-dialog {
  max-width: calc(100vw - 24px);
  margin-left: auto;
  margin-right: auto;
}

.modal-body {
  overflow-x: auto;
}

.table-wrapper,
.table-responsive,
.dataTables_wrapper,
.card-table,
.section-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table,
.table {
  max-width: 100%;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  float: none;
  text-align: left;
}

.dataTables_wrapper .dataTables_filter input {
  max-width: 100%;
  margin-left: 0;
}

.select2-container .select2-selection--single {
  min-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  white-space: normal;
}

@media (min-width: 768px) {
  .pdv-panel .dataTables_wrapper .dataTables_length {
    float: left !important;
    width: auto !important;
    margin: 0 0 14px !important;
    text-align: left !important;
  }

  .pdv-panel .dataTables_wrapper .dataTables_filter {
    float: right !important;
    width: auto !important;
    margin: 0 0 14px !important;
    text-align: right !important;
  }

  .pdv-panel .dataTables_wrapper .dataTables_filter input {
    min-width: 220px;
    margin-left: 8px;
  }

  .pdv-panel .dataTables_filter input,
  .pdv-panel .dataTables_length select,
  .pdv-panel .dataTables_length .select2-container--default .select2-selection--single {
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .pdv-panel .dataTables_filter input:focus,
  .pdv-panel .dataTables_length select:focus,
  .pdv-panel .dataTables_length .select2-container--focus .select2-selection--single {
    border-color: transparent !important;
    box-shadow: none !important;
  }
}

.slim-header,
.slim-navbar,
.pdv-topbar,
.premium-nav {
  max-width: 100vw;
}

.slim-header .container,
.slim-header .container-fluid,
.slim-navbar .container,
.pdv-topbar .container,
.premium-nav__inner {
  min-width: 0;
}

.logged-user span,
.slim-logo a,
.premium-nav__brand span,
.premium-cart span {
  overflow-wrap: anywhere;
}

.premium-hero,
.premium-main,
.premium-shell,
.premium-content,
.premium-sidebar,
.premium-product-card,
.premium-panel,
.premium-promo,
.premium-nav__inner {
  min-width: 0;
}

.premium-product-card__media img,
.premium-logo-card img {
  height: auto;
  object-fit: cover;
}

.premium-promo__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.premium-category-list,
.premium-nav__tabs,
.premium-hero__quick,
.premium-hero__actions,
.premium-product-card__footer,
.premium-bottom-nav {
  min-width: 0;
}

.pdv-topbar .container,
.order-topbar .container,
.cozinha-screen .slim-navbar .nav,
.premium-nav__inner,
.premium-hero__brand {
  flex-wrap: wrap;
}

.pdv-card,
.order-card,
.kitchen-card,
.pedido-card,
.card,
.media,
.media-body {
  min-width: 0;
}

.number-spinner,
.input-group {
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .container,
  .container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .slim-body {
    display: block;
  }

  .slim-sidebar {
    max-width: 100%;
  }

  .slim-mainpanel,
  .slim-mainpanel > .container,
  .slim-mainpanel > .container-fluid {
    max-width: 100%;
  }

  .premium-shell {
    display: block;
  }

  .premium-sidebar,
  .premium-content {
    width: 100%;
  }

  .premium-sidebar--left,
  .premium-sidebar--right {
    position: static;
  }

  .premium-category-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .premium-category-link {
    flex: 0 0 auto;
    width: 150px;
  }

  .premium-promo {
    display: block;
  }

  .premium-promo__image {
    width: 100%;
  }

  .pdv-topbar .container,
  .order-topbar .container {
    align-items: stretch;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 15px;
  }

  h1,
  .h1 {
    font-size: 1.8rem;
  }

  h2,
  .h2 {
    font-size: 1.45rem;
  }

  h3,
  .h3 {
    font-size: 1.22rem;
  }

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

  .btn-block,
  .form-control,
  .custom-select,
  .select2-container {
    width: 100% !important;
  }

  .form-group,
  .input-group,
  .row > [class*="col-"] {
    margin-bottom: 10px;
  }

  .table-wrapper,
  .table-responsive,
  .dataTables_wrapper {
    margin-left: -2px;
    margin-right: -2px;
  }

  .table-wrapper,
  .table-responsive,
  .dataTables_wrapper,
  .section-wrapper {
    overflow: visible !important;
    overflow-x: visible !important;
  }

  .dataTables_wrapper {
    display: block;
    width: 100%;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    width: 100%;
    margin: 0 0 8px;
    text-align: left;
  }

  .dataTables_wrapper .dataTables_length label,
  .dataTables_wrapper .dataTables_filter label {
    width: 100%;
    display: block;
    margin: 0;
    font-weight: 800;
  }

  .dataTables_wrapper .dataTables_length .select2-container {
    width: min(132px, 42vw) !important;
    margin-right: 8px;
    vertical-align: middle;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    min-height: 40px;
    margin: 4px 0 0;
  }

  .table,
  table {
    width: 100% !important;
    min-width: 0 !important;
  }

  .dataTables_wrapper table.table,
  .dataTables_wrapper table.dataTable {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    border: 0;
  }

  .dataTables_wrapper table.dataTable thead,
  .dataTables_wrapper table.dataTable colgroup {
    display: none;
  }

  .dataTables_wrapper table.dataTable tbody {
    display: block;
    width: 100%;
  }

  .dataTables_wrapper table.dataTable tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 10px;
    width: 100%;
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
  }

  .dataTables_wrapper table.dataTable tbody tr.child {
    display: none !important;
  }

  .dataTables_wrapper table.dataTable tbody td,
  .dataTables_wrapper table.dataTable tbody th {
    width: auto !important;
    min-height: 0;
    display: block !important;
    padding: 7px 12px !important;
    border-right: 0 !important;
    border-left: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    background: #fff !important;
    line-height: 1.25;
  }

  .dataTables_wrapper table.dataTable tbody td:first-child,
  .dataTables_wrapper table.dataTable tbody th:first-child {
    grid-column: 1 / -1;
    background: #f8fafc !important;
    color: #475569;
    font-weight: 900;
    font-size: 16px;
    padding: 10px 12px !important;
  }

  .dataTables_wrapper table.dataTable tbody td:nth-last-child(-n+2) {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: auto !important;
    padding-top: 9px !important;
    border-top: 1px solid rgba(226, 232, 240, .9) !important;
  }

  .dataTables_wrapper table.dataTable tbody td:empty,
  .dataTables_wrapper table.dataTable tbody th:empty {
    display: none !important;
  }

  .dataTables_wrapper table.dataTable tbody td form,
  .dataTables_wrapper table.dataTable tbody td .btn,
  .dataTables_wrapper table.dataTable tbody td button {
    margin: 0;
  }

  .dataTables_wrapper table.dataTable tbody td .btn,
  .dataTables_wrapper table.dataTable tbody td button {
    min-width: 42px;
    min-height: 42px;
    width: auto;
    padding: 8px 12px;
  }

  table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
  table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    display: none !important;
  }

  .dataTables_wrapper .dataTables_info {
    width: 100%;
    margin: 2px 0 8px;
    padding-top: 0;
    text-align: left;
    white-space: normal;
    font-size: 14px;
  }

  .dataTables_wrapper .dataTables_paginate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 0;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border-radius: 8px !important;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody tr {
    gap: 0;
    border-color: rgba(239, 216, 197, .95);
    background: #fff !important;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td {
    min-height: 54px;
    border-bottom: 1px solid rgba(239, 216, 197, .55) !important;
    color: #4f5664;
    font-size: 15px;
    background: #fff !important;
    transition: background-color .18s ease, opacity .18s ease, transform .18s ease;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td::before {
    content: "";
    display: block;
    margin-bottom: 3px;
    color: #a76d50;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:first-child {
    min-height: 44px;
    position: relative;
    border-bottom-color: rgba(239, 216, 197, .75) !important;
    background: #fff7ed !important;
    color: #3a1b10;
    font-size: 18px;
    cursor: pointer;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:first-child::before {
    content: "Pedido";
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:first-child::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #9a3412;
    background: #fff;
    border: 1px solid rgba(239, 216, 197, .95);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-50%);
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody tr.mobile-expanded td:first-child::after {
    content: "-";
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(2)::before { content: "Comanda"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(3)::before { content: "Data"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(4)::before { content: "Tipo"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(5)::before { content: "Cliente"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(6)::before { content: "WhatsApp"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(7)::before { content: "Total"; }
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(8)::before { content: "Status"; }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(3) {
    grid-column: 1 / -1;
    min-height: 54px;
    color: #2f3744;
    font-size: 17px;
    font-weight: 850;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(3)::before {
    display: none;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(2),
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(n+4):nth-child(-n+7) {
    display: none !important;
    opacity: 0;
    transform: translateY(-4px);
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody tr.mobile-expanded td:nth-child(2),
  .pdv-panel .dataTables_wrapper table.dataTable tbody tr.mobile-expanded td:nth-child(n+4):nth-child(-n+7) {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    animation: mobileTableReveal .18s ease-out both;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(5),
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(6),
  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(8) {
    grid-column: 1 / -1;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(8) {
    min-height: 48px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center !important;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-child(8) .btn {
    width: min(100%, 260px);
    justify-content: center;
  }

  @keyframes mobileTableReveal {
    from {
      opacity: 0;
      transform: translateY(-5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-last-child(-n+2) {
    min-height: 54px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-top: 0 !important;
    border-bottom: 0 !important;
    background: #fff !important;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-last-child(-n+2)::before {
    display: none;
  }

  .pdv-panel .dataTables_wrapper table.dataTable tbody td:nth-last-child(-n+2) .btn {
    width: 100%;
    max-width: 92px;
  }

  .table td,
  .table th,
  table td,
  table th {
    white-space: normal;
    vertical-align: middle;
  }

  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: 100%;
    margin-top: 6px;
  }

  .dataTables_wrapper .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .modal-dialog {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .modal-content {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .signin-wrapper {
    min-height: 100vh;
    padding: 20px 14px;
    align-items: flex-start;
  }

  .signin-box {
    width: 100%;
    padding: 24px 18px;
  }

  .slim-header .container-fluid,
  .slim-header-left,
  .slim-header-right,
  .slim-navbar .container,
  .slim-navbar .nav {
    flex-wrap: wrap;
  }

  .slim-logo {
    font-size: 1.2rem;
  }

  .slim-navbar .nav {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .slim-navbar .nav-link {
    min-height: 40px;
    white-space: nowrap;
  }

  .section-wrapper,
  .dash-hero,
  .card-dash-one,
  .premium-panel {
    padding: 16px;
  }

  .premium-hero {
    min-height: auto;
    padding: 32px 0 22px;
  }

  .premium-hero__content,
  .premium-hero__brand,
  .premium-hero__actions,
  .premium-nav__inner,
  .premium-product-card__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .premium-logo-card {
    margin-left: auto;
    margin-right: auto;
  }

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

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

  .premium-nav {
    position: sticky;
    top: 0;
  }

  .premium-nav__tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .premium-nav__tab,
  .premium-cart,
  .premium-cta,
  .premium-add-button,
  .premium-side-cta {
    justify-content: center;
    width: 100%;
  }

  .premium-product-grid {
    grid-template-columns: 1fr;
  }

  .premium-floating-cart {
    left: 12px;
    right: 12px;
    bottom: 76px;
    width: auto;
  }

  .premium-bottom-nav {
    overflow-x: auto;
  }

  .pdv-topbar .container,
  .order-topbar .container {
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .pdv-actions,
  .order-actions,
  .kitchen-actions,
  .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pdv-actions .btn,
  .order-actions .btn,
  .kitchen-actions .btn,
  .card-actions .btn {
    flex: 1 1 150px;
  }

  .cozinha-screen .slim-navbar .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .cozinha-screen .slim-navbar .nav-link {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .container,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card-body,
  .modal-body {
    padding: 14px;
  }

  .premium-category-link {
    width: 132px;
  }

  .premium-product-card__body,
  .premium-panel,
  .section-wrapper {
    padding: 14px;
  }

  .premium-bottom-nav a span {
    font-size: 11px;
  }

  .slim-navbar .nav-link span,
  .pdv-brand span,
  .logged-user span {
    font-size: 13px;
  }
}
