/* Order Design mobile UX layer — shared by public, staff, admin, and marketer layouts. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: clip;
}

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

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
[type="button"],
[type="submit"],
[role="button"] {
  touch-action: manipulation;
}

.od-mobile-table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  :root {
    --od-mobile-gutter: 16px;
    --od-mobile-radius: 16px;
  }

  body {
    font-size: 14px;
  }

  main,
  .site-page-wrap,
  .admin-content {
    min-width: 0;
  }

  .site-page-wrap {
    padding-inline: var(--od-mobile-gutter) !important;
  }

  h1 {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
    line-height: 1.35 !important;
  }

  h2 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    line-height: 1.4;
  }

  p,
  td,
  th,
  label,
  a,
  button {
    overflow-wrap: anywhere;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    font-size: 16px !important;
  }

  textarea {
    resize: vertical;
  }

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

  .dataTables_wrapper,
  .table-responsive,
  [data-mobile-scroll="table"] {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  table {
    max-width: none;
  }

  table:not(.od-mobile-stack) th,
  table:not(.od-mobile-stack) td {
    white-space: nowrap;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    width: 100%;
    margin: 8px 0;
    text-align: start !important;
  }

  .dataTables_wrapper .dataTables_filter input {
    display: block;
    margin: 8px 0 0 !important;
  }

  [role="dialog"],
  .modal-content,
  .od-modal-card {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px);
  }

  .fixed.inset-0,
  .fixed[class*="inset-0"] {
    padding: 12px;
  }

  .admin-content {
    padding-inline: 14px !important;
  }

  .admin-topbar {
    gap: 10px;
  }

  .admin-topbar-left,
  .admin-topbar-right {
    min-width: 0;
  }

  .admin-topbar-left h2 {
    font-size: 18px !important;
  }

  .admin-topbar-right {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .admin-topbar-right::-webkit-scrollbar {
    display: none;
  }

  .od-mobile-topbar-alerts {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: 2px;
  }

  .od-mobile-topbar-alerts .topbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }
}

@media (max-width: 480px) {
  :root {
    --od-mobile-gutter: 12px;
  }

  .site-page-wrap,
  .admin-content {
    padding-inline: 12px !important;
  }

  .rounded-3xl,
  .rounded-\[24px\],
  .rounded-\[26px\],
  .rounded-\[28px\] {
    border-radius: var(--od-mobile-radius) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
