/* =====================================================================================
   Retail One - phone polish (2026-10-27). Applies below 992px (phones and tablets, where the app's own layout uses the drawer menu; widened from 768px on 2026-10-28), so
   desktops and tills are unchanged. Builds on mobile-responsive.css.
   ===================================================================================== */
@media (max-width: 991.98px) {

  /* ---------- 1. One header-height offset (was 101px + 106px of empty space) ---------- */
  html, body { overflow-x: hidden; }
  #app.app-header-fixed { padding-top: 56px !important; }
  #app .app-content:not(.p-0) { padding: 12px 12px 92px !important; }
  #app .app-content:not(.p-0) .row { --bs-gutter-x: .75rem; }

  /* ---------- 2. Header ---------- */
  .app-header {
    height: 56px !important;
    background: rgba(9, 11, 22, .97) !important;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 20px rgba(0, 0, 0, .35);
  }
  .app-header .navbar-header img, .app-header .navbar-brand img {
    width: auto !important; min-width: 30px; height: 30px !important; object-fit: contain;
  }

  /* ---------- 3. Calmer background so content reads clearly ---------- */
  .app-cover { filter: brightness(.32) saturate(.7); }

  /* ---------- 4. Page titles ---------- */
  .app-content .page-header {
    font-size: 1.3rem !important; font-weight: 700; margin: 2px 0 12px !important; line-height: 1.25;
  }
  .app-content .page-header small { display: block; font-size: .8rem; opacity: .65; margin-top: 2px; }

  /* ---------- 5. Dashboard figures: two per row, solid cards ---------- */
  .app-content .row > [class*="col-"]:has(> .widget.bg-gradient) { flex: 0 0 50%; max-width: 50%; }
  .app-content .widget.bg-gradient {
    background: linear-gradient(160deg, rgba(34, 40, 62, .96), rgba(20, 24, 38, .96)) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 14px !important;
    min-height: 84px; margin-bottom: 10px !important; padding: 12px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  }

  /* ---------- 6. Panels and cards ---------- */
  .app-content:not(.p-0) .panel, .app-content:not(.p-0) .card {
    border-radius: 14px !important; overflow: hidden;
    background-color: rgba(17, 21, 33, .95) !important;
    border: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  }
  .app-content .panel-heading { padding: 10px 12px !important; }
  .app-content .panel-heading .panel-title { font-size: 15px !important; }
  .app-content .panel-heading-btn .btn-icon { width: 26px; height: 26px; }
  .app-content .panel-body { padding: 12px !important; }
  .app-content .alert { font-size: 13px !important; padding: 10px 12px !important; border-radius: 10px !important; }

  /* ---------- 7. "Main Features" button stacks -> compact 2-column grid ---------- */
  .app-content .fw-bold.fs-13px:has(> .d-flex > .btn) {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  }
  .app-content .fw-bold.fs-13px:has(> .d-flex > .btn) > .d-flex { margin: 0 !important; }
  .app-content .fw-bold.fs-13px:has(> .d-flex > .btn) .btn {
    padding: 11px 8px !important; font-size: 13px !important; border-radius: 10px !important; min-height: 44px; line-height: 1.2;
  }
  .app-content .fw-bold.fs-13px:has(> .d-flex > .btn) > .d-flex:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* ---------- 8. Tables ---------- */
  .app-content .dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .app-content table.dataTable thead th, .app-content table.dataTable tfoot th { white-space: nowrap; padding-right: 24px !important; font-size: 13px; }
  .app-content table.dataTable td { font-size: 13px; }
  .app-content .dt-buttons { display: flex !important; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .app-content .dt-buttons .btn { padding: 6px 12px !important; font-size: 13px !important; min-height: 36px; border-radius: 8px !important; margin: 0 !important; }
  .app-content .dataTables_filter, .app-content .dataTables_filter label { width: 100% !important; text-align: left !important; display: block !important; }
  .app-content .dataTables_filter label { display: flex !important; flex-direction: column; gap: 4px; font-size: 13px; }
  .app-content .dataTables_length select { min-height: 36px; padding: 4px 28px 4px 10px; }
  .app-content .dataTables_filter input { width: 100% !important; margin: 4px 0 0 !important; display: block; }
  .app-content .dataTables_info { font-size: 12px; text-align: center; }
  .app-content .dataTables_paginate { display: flex; justify-content: center; }
  .app-content .dataTables_paginate .paginate_button { min-width: 40px; }

  /* ---------- 9. Floating language picker and chat: out of the content's way ---------- */
  .gt_switcher_wrapper {
    left: 10px !important; right: auto !important; bottom: 14px !important;
    transform: scale(.82); transform-origin: left bottom; opacity: .92;
  }
  #clippy-chat-bubble { width: 50px !important; height: 50px !important; right: 12px !important; bottom: 14px !important; }

  /* ---------- 10. Point of sale header: buttons / search / buttons on their own rows ---------- */
  :root { --pos-header-h: 150px !important; }
  .pos-stock-header {
    height: auto !important; min-height: var(--pos-header-h); flex-wrap: wrap !important;
    padding: 6px 8px !important; gap: 6px !important; align-content: flex-start;
  }
  .pos-stock-header .header-left, .pos-stock-header .header-right {
    flex: 1 1 100% !important; max-width: 100%; overflow-x: auto; flex-wrap: nowrap !important;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .pos-stock-header .header-left::-webkit-scrollbar, .pos-stock-header .header-right::-webkit-scrollbar { display: none; }
  .pos-stock-header .header-center { order: 3; flex: 1 1 100% !important; height: auto !important; max-width: 100%; }
  .pos-stock-header .header-right { order: 4; }
  .pos-stock-header .header-left > *, .pos-stock-header .header-right > * { flex-shrink: 0; }
  .pos-stock-header .nav .nav-item a.btn, #btn-pickup-top, #btn-exit-top { padding: 5px 10px !important; font-size: 11.5px !important; }
  .pos-stock-header .header-center .input-group { width: 100% !important; flex-wrap: nowrap !important; height: 42px; }
  .pos-stock-header #barcode1 { min-width: 0 !important; width: 100% !important; height: 40px !important; }
  /* product search row above the categories was wider than the screen */
  .pos-menu, .pos-menu .nav-container, .pos-menu .nav-container .nav-item.d-md-none { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .pos-menu .nav-container .input-group { width: 100% !important; flex-wrap: nowrap !important; }
  .pos-menu .nav-container .input-group .form-control { min-width: 0 !important; width: 1% !important; }
  /* The theme fixes both the header and the product menu to the top on phones, so the menu covered the
     header (PICK UP / EXIT / SUSPEND and the barcode box). Stack them in one screen-high column instead. */
  .pos.pos-stock {
    height: 100vh !important; height: 100dvh !important; padding-top: 0 !important;
    display: flex !important; flex-direction: column !important; overflow: hidden !important;
  }
  .pos.pos-stock > .pos-stock-header { position: relative !important; top: auto !important; flex: 0 0 auto; z-index: 30; }
  .pos.pos-stock > .pos-stock-body { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; display: flex !important; flex-direction: column !important; }
  .pos-stock-body > .pos.pos-customer { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; display: flex !important; flex-direction: column !important; }
  .pos.pos-customer > .pos-menu { position: relative !important; top: auto !important; flex: 0 0 auto !important; z-index: 20; }
  .pos.pos-customer > .pos-content { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; margin-top: 0 !important; padding-top: 0 !important; }
  .pos-content > .pos-content-container-wrapper { height: 100% !important; }
  .product-container .not-available-text {
    font-size: 11px !important; letter-spacing: .05em !important; text-align: center; padding: 6px; line-height: 1.25;
  }
}
