/* ============================================================
   La Familia — Barcode Scanner v3.2 (mobile only)
   Button inside FiboSearch wrapper, beside the pill form.
   ALL layout rules scoped to mobile — desktop 100% untouched.
   ============================================================ */

/* ---------- Mobile layout: [pill form][scan icon] ---------- */
@media (max-width: 1024px) {

  .dgwt-wcas-search-wrapp.lf-has-barcode {
    display: flex;
    align-items: center;
  }

  .dgwt-wcas-search-wrapp.lf-has-barcode > .dgwt-wcas-search-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .lf-barcode-btn {
    position: relative !important;
    z-index: 10 !important;
    flex: 0 0 auto !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #222 !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 0 0 4px !important;
    line-height: 1;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  html[dir="rtl"] .lf-barcode-btn {
    margin: 0 4px 0 0 !important;
  }

  .lf-barcode-btn:hover,
  .lf-barcode-btn:focus,
  .lf-barcode-btn:active {
    color: #000 !important;
    background: rgba(0, 0, 0, 0.06) !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .lf-barcode-btn svg {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: none !important;
    display: block !important;
    pointer-events: none;
  }

  .lf-barcode-btn svg path {
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
  }
}

/* ---------- Desktop: hidden entirely, zero layout impact ---------- */
@media (min-width: 1025px) {
  .lf-barcode-btn {
    display: none !important;
  }
}

/* ---------- Scanner modal (above ALL site elements) ---------- */
.lf-barcode-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483600 !important;
  display: none;
}

.lf-barcode-modal.lf-open {
  display: block;
}

.lf-barcode-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.78);
}

.lf-barcode-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* ---------- Native <dialog> in browser top layer ---------- */
.lf-barcode-dlg::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.lf-barcode-dlg .lf-barcode-head,
.lf-barcode-modal .lf-barcode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
}

.lf-barcode-title {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}

.lf-barcode-close {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 6px;
  box-shadow: none;
}

.lf-barcode-close:hover {
  color: #000;
  background: none;
}

#lf-barcode-reader {
  width: 100%;
  min-height: 260px;
  background: #000;
}

#lf-barcode-reader video {
  width: 100% !important;
  display: block;
}

.lf-barcode-status {
  padding: 12px 18px;
  text-align: center;
  font-size: 14px;
  color: #444;
  min-height: 42px;
}

.lf-barcode-status.lf-error {
  color: #c0392b;
}

.lf-rtl .lf-barcode-dialog {
  direction: rtl;
}

html.lf-barcode-lock {
  overflow: hidden;
}
