/* Language switch + full-page barcode scan */

/* Bengali font stack is applied in fonts.css */

html.hf-lang-scanning,
html.hf-lang-scanning body {
  overflow: hidden !important;
  touch-action: none;
}

html.hf-lang-boot .hf-main,
html.hf-lang-boot .hf-footer,
html.hf-lang-boot .hf-master-content {
  opacity: 0;
  pointer-events: none;
}

html.hf-lang-ready .hf-main,
html.hf-lang-ready .hf-footer,
html.hf-lang-ready .hf-master-content,
html:not(.hf-lang-boot) .hf-main,
html:not(.hf-lang-boot) .hf-footer,
html:not(.hf-lang-boot) .hf-master-content {
  opacity: 1;
  transition: opacity 0.2s ease;
}

html.hf-lang-bn .hf-nav,
html.hf-lang-bn .hf-main,
html.hf-lang-bn .hf-footer {
  word-break: normal;
  overflow-wrap: anywhere;
}

.hf-nav-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-flow: row nowrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

.hf-nav .hf-lang--nav {
  height: 36px;
  padding: 2px;
  flex-shrink: 0;
  align-self: center;
}

.hf-nav .hf-lang--nav .hf-lang-btn {
  min-width: 2.35rem;
  min-height: 28px;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
}

.hf-nav .hf-lang--nav .hf-lang-btn--bn {
  min-width: 2.65rem;
  font-size: 0.74rem;
  padding: 0 0.45rem;
}

html.hf-lang-bn .hf-nav-auth,
html.hf-lang-bn .hf-nav-customer-profile,
html.hf-lang-bn .hf-nav-customer-logout,
html.hf-lang-bn .hf-nav-pwa-install,
html.hf-lang-bn .hf-navlink {
  line-height: 1.2;
}

html.hf-lang-bn .hf-nav-customer-profile-label,
html.hf-lang-bn .hf-nav-customer-logout-label,
html.hf-lang-bn .hf-nav-pwa-install span:not(.hf-mi) {
  white-space: nowrap;
}

@media (min-width: 1024px) and (max-width: 1320px) {
  html.hf-lang-bn .hf-nav-customer-name {
    max-width: 5rem;
  }

  html.hf-lang-bn .hf-nav-customer {
    max-width: min(100%, 17rem);
  }

  .hf-nav-customer-name {
    max-width: 6rem;
  }
}

@media (min-width: 1024px) and (max-width: 1240px) {
  .hf-nav-customer-profile-label,
  .hf-nav-customer-logout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .hf-nav-customer-profile,
  .hf-nav-customer-logout {
    width: 1.95rem;
    height: 1.95rem;
    padding: 0;
    justify-content: center;
  }

  .hf-nav-customer-name {
    max-width: 5.25rem;
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .hf-nav-pwa-install span:not(.hf-mi) {
    display: none;
  }

  .hf-nav-pwa-install {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    justify-content: center;
  }
}

.hf-lang {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  user-select: none;
}

.hf-lang--on-light {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: none;
}

.hf-lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 247, 237, 0.72);
  min-height: 30px;
  padding: 0 0.72rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hf-lang-btn--bn {
  font-family: var(--hf-font-bn);
  font-size: 0.8rem;
  padding: 0 0.68rem;
}

.hf-lang--on-light .hf-lang-btn {
  color: rgba(51, 65, 85, 0.78);
}

.hf-lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hf-lang--on-light .hf-lang-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

.hf-lang-btn.is-active {
  background: linear-gradient(135deg, #ff8f00, #e65100 55%, #c62828);
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.38);
}

.hf-lang--on-light .hf-lang-btn.is-active {
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}

.hf-lang-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.hf-lang-btn:focus-visible {
  outline: 2px solid rgba(255, 143, 0, 0.7);
  outline-offset: 2px;
}

.hf-lang-sheet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 143, 0, 0.18), rgba(198, 40, 40, 0.14));
  border: 1px solid rgba(255, 183, 77, 0.22);
}

.hf-lang-sheet-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.hf-lang-sheet-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff7ed;
}

.hf-lang-sheet-sub {
  font-size: 0.75rem;
  color: rgba(255, 236, 220, 0.7);
}

.hf-lang-sheet .hf-lang {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}

.hf-lang-sheet .hf-lang-btn {
  color: rgba(51, 65, 85, 0.78);
}

.hf-lang-sheet .hf-lang-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

.hf-lang-scan {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  pointer-events: none;
}

.hf-lang-scan.is-on,
.hf-lang-scan.is-on[hidden] {
  display: block !important;
  pointer-events: auto;
}

.hf-lang-scan-dim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(230, 81, 0, 0.18), transparent 55%),
    rgba(10, 6, 4, 0.42);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.hf-lang-scan.is-on .hf-lang-scan-dim {
  opacity: 1;
}

.hf-lang-scan-frame {
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  pointer-events: none;
}

.hf-lang-scan-frame::before,
.hf-lang-scan-frame::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid #ffb74d;
  filter: drop-shadow(0 0 8px rgba(255, 143, 0, 0.55));
}

.hf-lang-scan-frame::before {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 10px 0 0 0;
}

.hf-lang-scan-frame::after {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 10px 0 0;
}

.hf-lang-scan-corners {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

.hf-lang-scan-corners::before,
.hf-lang-scan-corners::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid #ffb74d;
  filter: drop-shadow(0 0 8px rgba(255, 143, 0, 0.55));
}

.hf-lang-scan-corners::before {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 10px;
}

.hf-lang-scan-corners::after {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 10px 0;
}

.hf-lang-scan-bars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 7px,
    rgba(255, 255, 255, 0.045) 7px 8px,
    transparent 8px 13px,
    rgba(255, 143, 0, 0.1) 13px 16px,
    transparent 16px 22px,
    rgba(255, 255, 255, 0.07) 22px 23px,
    transparent 23px 29px
  );
  mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
  pointer-events: none;
}

.hf-lang-scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: -8%;
  height: 7px;
  background: linear-gradient(90deg, transparent 0%, #ff8f00 18%, #fff6e8 50%, #ff8f00 82%, transparent 100%);
  box-shadow:
    0 0 18px 4px rgba(255, 143, 0, 0.55),
    0 0 48px 14px rgba(230, 81, 0, 0.28);
  opacity: 0;
  transform: translateY(0);
}

.hf-lang-scan.is-running .hf-lang-scan-beam {
  opacity: 1;
  animation: hf-lang-beam 1.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hf-lang-scan.is-running .hf-lang-scan-trail {
  opacity: 1;
  animation: hf-lang-trail 1.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hf-lang-scan-trail {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: linear-gradient(180deg, rgba(255, 143, 0, 0.16), transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.hf-lang-scan-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  min-width: min(86vw, 320px);
  padding: 1.15rem 1.25rem 1.05rem;
  border-radius: 20px;
  background: rgba(20, 12, 9, 0.88);
  border: 1px solid rgba(255, 183, 77, 0.28);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  color: #fff7ed;
  text-align: center;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hf-lang-scan.is-on .hf-lang-scan-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hf-lang-scan-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  color: #ffcc80;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hf-lang-scan-kicker .hf-mi {
  font-size: 16px;
}

.hf-lang-scan-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hf-lang-scan-text {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: rgba(255, 247, 237, 0.72);
}

.hf-lang-scan-meter {
  margin-top: 0.85rem;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.hf-lang-scan-meter > span {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8f00, #fff3e0, #ff8f00);
  animation: hf-lang-meter 1.2s ease-in-out infinite;
}

.hf-lang-scan.is-done .hf-lang-scan-meter > span {
  width: 100%;
  animation: none;
  background: #81c784;
}

.hf-lang-scan.is-done .hf-lang-scan-beam,
.hf-lang-scan.is-done .hf-lang-scan-trail {
  opacity: 0;
  animation: none;
}

@keyframes hf-lang-beam {
  0% {
    top: -4%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    top: 104%;
    opacity: 0;
  }
}

@keyframes hf-lang-trail {
  0% {
    height: 0;
    opacity: 0.15;
  }
  100% {
    height: 100%;
    opacity: 0.28;
  }
}

@keyframes hf-lang-meter {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(420%);
  }
}

@media (max-width: 420px) {
  .hf-lang-btn {
    padding: 0 0.5rem;
    font-size: 0.68rem;
  }

  .hf-lang-btn--bn {
    font-size: 0.74rem;
    padding: 0 0.48rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hf-lang-scan-beam,
  .hf-lang-scan-trail,
  .hf-lang-scan-meter > span {
    animation: none !important;
  }

  .hf-lang-scan.is-running .hf-lang-scan-beam {
    top: 50%;
    opacity: 0.85;
  }
}
