/*
 * POS_TABLET_7_LANDSCAPE_RESPONSIVE_V1
 *
 * Mode kompak khusus tablet landscape sekitar
 * 7–10 inci. Desktop besar tetap memakai CSS utama.
 */

@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-width: 1365px)
{
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
  }

  .pos-screen {
    width: 100%;
    height: 100vh !important;
    min-height: 0 !important;
    grid-template-rows:
      64px
      minmax(0, 1fr) !important;
  }

  /* ========================================================
   * HEADER
   * ======================================================== */

  .pos-header {
    height: 64px !important;
    min-height: 64px !important;

    grid-template-columns:
      minmax(185px, .8fr)
      auto
      auto
      minmax(0, 1fr) !important;

    gap: 8px !important;
    padding: 0 10px !important;
  }

  .brand-block {
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    font-size: 15px;
  }

  .brand-block > div {
    min-width: 0;
  }

  .brand-block strong {
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
  }

  .brand-block small {
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 10px;
  }

  .mode-switch {
    order: initial !important;
    padding: 3px;
    border-radius: 12px;
  }

  .mode-switch button {
    min-height: 36px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 12px;
  }

  .clock-block {
    display: block !important;
    min-width: 84px;
  }

  .clock-block strong {
    font-size: 19px;
  }

  .clock-block small {
    font-size: 9px;
  }

  .header-actions {
    min-width: 0;
    justify-content: flex-end;
    gap: 5px;
  }

  .head-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border-radius: 10px;
    font-size: 13px;
  }

  .head-btn.today,
  .head-btn.debt,
  .head-btn.cashout {
    width: auto;
    min-width: 38px;
    padding: 0 9px;
  }

  /* ========================================================
   * TIGA PANEL UTAMA
   * ======================================================== */

  .pos-layout {
    min-height: 0 !important;

    grid-template-columns:
      clamp(160px, 15.5vw, 205px)
      minmax(0, 1fr)
      clamp(280px, 27vw, 350px) !important;

    gap: 8px !important;
    padding: 8px !important;
  }

  .left-panel,
  .center-panel,
  .cart-panel {
    min-width: 0;
    min-height: 0 !important;
    border-radius: 15px;
  }

  .left-panel {
    display: flex !important;
    padding: 10px;
  }

  .center-panel {
    padding: 10px;
    min-height: 0 !important;
  }

  .cart-panel {
    min-height: 0 !important;
  }

  /* ========================================================
   * PANEL KIRI
   * ======================================================== */

  .operator-card {
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 13px;
  }

  .operator-card small {
    font-size: 7px;
  }

  .operator-card strong {
    max-width: 125px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
  }

  .operator-card span {
    font-size: 8px;
  }

  .side-label {
    margin: 10px 0 5px;
    font-size: 8px;
  }

  .side-select,
  .wide-select {
    min-height: 37px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 11px;
  }

  .side-separator {
    margin: 10px 0;
  }

  .side-title {
    font-size: 10px;
  }

  .side-title button {
    width: 27px;
    height: 27px;
  }

  .category-list {
    display: grid !important;
    gap: 5px;
    margin-top: 7px;
  }

  .category-list button {
    flex: initial !important;
    min-height: 34px;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 10.5px;
    line-height: 1.15;
  }

  .side-bottom {
    display: block !important;
    padding-top: 8px;
  }

  .connection {
    font-size: 9px;
  }

  .side-bottom small {
    font-size: 7px;
    margin-top: 4px;
  }

  /* ========================================================
   * PENCARIAN DAN KATALOG
   * ======================================================== */

  .search-toolbar {
    grid-template-columns:
      minmax(0, 1fr)
      auto;

    gap: 7px;
  }

  .search-main {
    min-width: 0;
    min-height: 44px;
    gap: 6px;
    padding: 0 5px 0 10px;
    border-radius: 12px;
  }

  .search-main > span {
    font-size: 20px;
  }

  .search-main input {
    min-width: 0;
    font-size: 13px;
  }

  .scan-action-group {
    flex: 0 0 auto;
    gap: 4px;
  }

  .scan-icon-btn,
  .camera-icon-btn,
  .search-main .key-open {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 9px;
    font-size: 13px;
  }

  .soft-btn {
    min-height: 44px;
    padding: 0 10px;
    font-size: 11px;
  }

  .catalog-meta {
    margin: 10px 2px 8px;
  }

  .catalog-meta strong {
    font-size: 13px;
  }

  .catalog-meta span,
  .scan-status {
    font-size: 8px;
  }

  .product-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;

    gap: 8px;
  }

  .product-card {
    min-height: 188px;
    border-radius: 12px;
  }

  .product-img {
    height: clamp(76px, 8vw, 96px);
    font-size: 29px;
  }

  .product-body {
    padding: 8px;
  }

  .product-category {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 7px;
  }

  .product-name {
    display: -webkit-box;
    overflow: hidden;
    min-height: 30px;
    margin-top: 3px;

    font-size: 11.5px;
    line-height: 1.25;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .product-meta {
    gap: 3px;
    margin-top: 4px;
    font-size: 7.5px;
  }

  .product-meta > * {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .product-price {
    padding-top: 6px;
    font-size: 15px;
  }

  .product-add {
    right: 7px;
    bottom: 7px;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    font-size: 18px;
  }

  /* ========================================================
   * PANEL TRANSAKSI
   * ======================================================== */

  .cart-head {
    padding: 10px 11px;
  }

  .cart-head small {
    font-size: 7px;
  }

  .cart-head h2 {
    font-size: 16px;
  }

  .cart-head button {
    padding: 6px 8px;
    border-radius: 9px;
    font-size: 11px;
  }

  .cart-list {
    min-height: 110px;
    padding: 6px 10px;
  }

  .cart-empty {
    min-height: 120px;
    gap: 4px;
  }

  .cart-empty > div {
    font-size: 34px;
  }

  .cart-empty strong {
    font-size: 13px;
  }

  .cart-empty span {
    font-size: 9px;
  }

  .cart-item {
    padding: 7px 0;
  }

  .cart-item-name {
    font-size: 10px;
  }

  .cart-item-sub {
    font-size: 7px;
  }

  .cart-item-total {
    font-size: 10px;
  }

  .qty-control {
    margin-top: 4px;
  }

  .qty-control button,
  .qty-control input {
    height: 25px;
  }

  .payment-area {
    padding: 9px 10px;
  }

  .discount-control {
    gap: 6px;
    margin-bottom: 7px;
  }

  .discount-add-btn {
    min-height: 52px;
    gap: 7px;
    padding: 8px 9px;
    border-radius: 11px;
  }

  .discount-add-btn > span {
    font-size: 17px;
  }

  .discount-add-btn strong {
    font-size: 10px;
  }

  .discount-add-btn small {
    font-size: 8px;
  }

  .discount-add-btn b {
    font-size: 15px;
  }

  .selected-discount {
    padding: 8px 9px;
  }

  .discount-calculation {
    gap: 4px;
    margin-bottom: 6px;
    padding: 7px 9px;
  }

  .discount-calculation > div {
    font-size: 9px;
  }

  .total-box {
    padding: 8px 10px;
    border-radius: 11px;
  }

  .total-box span {
    font-size: 8px;
  }

  .total-box strong {
    font-size: 19px;
  }

  .payment-tabs {
    gap: 5px;
    margin-top: 7px;
  }

  .payment-tabs button {
    min-height: 34px;
    border-radius: 9px;
    font-size: 9px;
  }

  .payment-method-hint {
    min-height: 50px;
    margin-top: 7px;
    padding: 8px 9px;
    border-radius: 10px;
  }

  .payment-method-hint strong {
    font-size: 10px;
  }

  .payment-method-hint small {
    margin-top: 3px;
    font-size: 8px;
  }

  .payment-pane {
    margin-top: 6px;
  }

  .field-label {
    margin: 8px 0 4px;
    font-size: 8px;
  }

  .amount-input.compact,
  .input-shell.light {
    min-height: 38px;
  }

  .amount-input.compact input {
    font-size: 16px;
  }

  .change-row {
    margin-top: 5px;
    padding: 6px 8px;
    font-size: 9px;
  }

  .change-row strong {
    font-size: 12px;
  }

  .selected-card {
    margin-top: 5px;
    padding: 7px;
    font-size: 9px;
  }

  .checkout-btn {
    min-height: 47px;
    margin-top: 7px;
    padding: 0 11px;
    border-radius: 11px;
  }

  .checkout-btn span {
    font-size: 9px;
  }

  .checkout-btn strong {
    font-size: 14px;
  }

  /* ========================================================
   * MODAL DAN KEYBOARD
   * ======================================================== */

  .dialog {
    max-height: 92vh;
  }

  .keyboard-layer {
    padding: 7px;
  }

  .keyboard-panel {
    padding: 8px;
    border-radius: 14px;
  }

  .kb-key {
    min-height: 42px;
    font-size: 15px;
  }

  .keyboard-layer.numeric .kb-key {
    min-height: 54px;
    font-size: 22px;
  }
}

/*
 * Layar 7 inci dengan viewport yang lebih dekat
 * ke 960–1100 CSS pixel.
 */
@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-width: 1100px)
{
  .pos-header {
    grid-template-columns:
      minmax(175px, 1fr)
      auto
      0
      auto !important;
  }

  .clock-block {
    display: none !important;
  }

  .brand-block small {
    display: none;
  }

  .header-actions .today span,
  .header-actions .debt span,
  .header-actions .cashout span {
    display: none;
  }

  .head-btn.today,
  .head-btn.debt,
  .head-btn.cashout {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .pos-layout {
    grid-template-columns:
      150px
      minmax(0, 1fr)
      265px !important;
  }

  .left-panel,
  .center-panel {
    padding: 8px;
  }

  .operator-card {
    padding: 7px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .operator-card strong {
    max-width: 90px;
    font-size: 10px;
  }

  .side-select {
    font-size: 10px;
  }

  .category-list button {
    min-height: 31px;
    font-size: 9.5px;
  }

  #btnClearSearch {
    width: 40px;
    min-width: 40px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  #btnClearSearch::before {
    content: "×";
    font-size: 21px;
    line-height: 1;
  }

  .search-main input {
    font-size: 12px;
  }

  .product-grid {
    gap: 6px;
  }

  .product-card {
    min-height: 172px;
  }

  .product-img {
    height: 68px;
  }

  .product-body {
    padding: 6px;
  }

  .product-name {
    min-height: 27px;
    font-size: 10px;
  }

  .product-price {
    font-size: 13px;
  }

  .product-add {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .cart-head h2 {
    font-size: 14px;
  }

  .payment-area {
    padding: 7px 8px;
  }

  .discount-add-btn {
    min-height: 46px;
    padding: 6px 7px;
  }

  .payment-tabs button {
    padding: 0 3px;
    font-size: 8px;
  }

  .payment-method-hint {
    min-height: 44px;
  }

  .checkout-btn {
    min-height: 43px;
  }
}

/*
 * Penyesuaian vertikal untuk tablet pendek,
 * misalnya viewport 960×600.
 */
@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-width: 1365px)
  and (max-height: 700px)
{
  .pos-screen {
    grid-template-rows:
      58px
      minmax(0, 1fr) !important;
  }

  .pos-header {
    height: 58px !important;
    min-height: 58px !important;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mode-switch button,
  .head-btn {
    min-height: 34px;
    height: 34px;
  }

  .pos-layout {
    gap: 6px !important;
    padding: 6px !important;
  }

  .left-panel,
  .center-panel {
    padding: 7px;
  }

  .operator-card {
    padding: 6px;
  }

  .side-label {
    margin-top: 7px;
  }

  .side-separator {
    margin: 7px 0;
  }

  .category-list {
    gap: 3px;
    margin-top: 5px;
  }

  .category-list button {
    min-height: 27px;
  }

  .search-main,
  .soft-btn {
    min-height: 40px;
  }

  .scan-icon-btn,
  .camera-icon-btn,
  .search-main .key-open {
    width: 31px;
    height: 31px;
    min-width: 31px;
  }

  .catalog-meta {
    margin: 7px 2px 6px;
  }

  .product-card {
    min-height: 157px;
  }

  .product-img {
    height: 58px;
  }

  .product-name {
    min-height: 24px;
  }

  .product-price {
    padding-top: 4px;
  }

  .cart-head {
    padding: 7px 9px;
  }

  .cart-list {
    min-height: 80px;
    padding: 4px 8px;
  }

  .cart-empty {
    min-height: 80px;
  }

  .payment-area {
    padding: 6px 8px;
  }

  .discount-control {
    margin-bottom: 5px;
  }

  .discount-add-btn {
    min-height: 40px;
  }

  .total-box {
    padding: 6px 8px;
  }

  .payment-tabs {
    margin-top: 5px;
  }

  .payment-tabs button {
    min-height: 30px;
  }

  .payment-method-hint {
    min-height: 38px;
    margin-top: 5px;
    padding: 6px 7px;
  }

  .payment-method-hint small {
    display: none;
  }

  .checkout-btn {
    min-height: 39px;
    margin-top: 5px;
  }
}

/*
 * POS_TABLET_HEADER_NO_OVERLAP_V2
 *
 * Header tablet:
 * - MART/KANTIN tetap memakai label.
 * - Semua tombol aksi kanan menjadi ikon.
 * - Jam disembunyikan agar tidak bertumpuk.
 */

@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-width: 1365px)
{
  .pos-header {
    display: grid !important;

    grid-template-columns:
      minmax(190px, 1fr)
      auto
      auto !important;

    grid-template-areas:
      "brand mode actions" !important;

    align-items: center !important;
    gap: 8px !important;
    padding: 0 11px !important;
    overflow: hidden;
  }

  .brand-block {
    grid-area: brand;
    min-width: 0;
    overflow: hidden;
  }

  .brand-block > div {
    min-width: 0;
  }

  .brand-block strong,
  .brand-block small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mode-switch {
    grid-area: mode;
    order: initial !important;
    flex: 0 0 auto;
    min-width: 0;
    margin: 0 !important;
  }

  .mode-switch button {
    min-width: 76px;
    min-height: 36px !important;
    height: 36px;
    padding: 0 10px !important;
    font-size: 11px;
    white-space: nowrap;
  }

  /*
   * Jam tidak diperlukan di header tablet.
   * Jam perangkat tetap terlihat pada sistem.
   */
  .clock-block {
    display: none !important;
  }

  .header-actions {
    grid-area: actions;

    display: grid !important;

    grid-template-columns:
      repeat(7, 36px);

    align-items: center;
    justify-content: end;

    width: auto !important;
    min-width: 276px;

    gap: 4px !important;
    margin: 0 !important;
  }

  /*
   * Semua tombol kanan dibuat seragam:
   * ikon saja tanpa label teks.
   */
  .header-actions .head-btn,
  .header-actions .head-btn.today,
  .header-actions .head-btn.debt,
  .header-actions .head-btn.cashout,
  .header-actions .head-btn.danger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;

    padding: 0 !important;
    margin: 0 !important;

    overflow: hidden;
    white-space: nowrap;

    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
  }

  .header-actions .head-btn span {
    display: none !important;
  }
}

/*
 * Mode ekstra kompak untuk tablet 7 inci
 * sekitar 960–1080 CSS pixel.
 */
@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-width: 1080px)
{
  .pos-header {
    grid-template-columns:
      minmax(165px, 1fr)
      auto
      auto !important;

    gap: 6px !important;
    padding: 0 8px !important;
  }

  .brand-mark {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
  }

  .brand-block {
    gap: 7px !important;
  }

  .brand-block strong {
    font-size: 12px !important;
  }

  .brand-block small {
    display: none !important;
  }

  .mode-switch {
    padding: 3px !important;
  }

  .mode-switch button {
    min-width: 64px;
    min-height: 34px !important;
    height: 34px;

    padding: 0 7px !important;

    font-size: 10px;
  }

  /*
   * Ikon mode disembunyikan,
   * label MART/KANTIN tetap terlihat.
   */
  .mode-switch button > span {
    display: none !important;
  }

  .header-actions {
    grid-template-columns:
      repeat(7, 33px);

    min-width: 255px;
    gap: 4px !important;
  }

  .header-actions .head-btn,
  .header-actions .head-btn.today,
  .header-actions .head-btn.debt,
  .header-actions .head-btn.cashout,
  .header-actions .head-btn.danger {
    width: 33px !important;
    min-width: 33px !important;
    max-width: 33px !important;
    height: 33px !important;

    font-size: 13px;
    border-radius: 9px;
  }
}


/*
 * POS_REAL_TABLET_7_VIEWPORT_V3
 *
 * Tablet 7 inci nyata dapat memiliki viewport sekitar
 * 800–899 CSS pixel karena kepadatan layar Android.
 * Layout tiga panel tetap aktif mulai 800px.
 */


/* POS_BRANCH_ANALYTICS_TABLET_HEADER_V1 */
/* Header tablet mengakomodasi 7 tombol: keyboard, hari ini, hutang, analisis, tarik tunai, fullscreen, logout. */
