/* Scanner EAN — plein écran mobile, bande horizontale EAN */

.ean-scanner {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: #060e14;
}

.ean-scanner.hidden {
  display: none !important;
}

body.ean-scanner-open {
  overflow: hidden;
}

.ean-scanner-backdrop {
  display: none;
}

.ean-scanner-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: #060e14;
}

.ean-scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: rgba(6, 14, 20, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.ean-scanner-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f2f8fc;
}

.ean-scanner-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.ean-scanner-hint,
.ean-scanner-tap-hint {
  margin: 0;
  padding: 6px 14px 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
  flex-shrink: 0;
}

.ean-scanner-tap-hint {
  padding-bottom: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.ean-scanner-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.ean-scanner-viewport-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.ean-scanner-torch {
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.ean-scanner-torch.hidden {
  display: none !important;
}

.ean-scanner-torch.is-on {
  background: rgba(255, 200, 60, 0.9);
  color: #1a1200;
}

.ean-scanner-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 2px 4px;
  backdrop-filter: blur(6px);
}

.ean-scanner-zoom.hidden {
  display: none !important;
}

.ean-scanner-zoom button {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ean-scanner-zoom-val {
  min-width: 36px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.ean-scanner-viewport.ean-scanner-focusing::after {
  border-color: rgba(255, 220, 80, 0.95);
}

#ean-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  transform: translateZ(0);
}

#ean-scanner-video.hidden {
  display: none !important;
}

.ean-scanner-reader {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ean-scanner-reader.hidden {
  display: none !important;
}

#ean-scanner-reader > div,
#ean-scanner-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#ean-scanner-reader img {
  display: none !important;
}

/* Bande horizontale type code EAN (plus large, moins haute) */
.ean-scanner-viewport::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 3%;
  right: 3%;
  top: 50%;
  height: 28%;
  transform: translateY(-50%);
  border: 2px solid rgba(120, 220, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
}

.ean-scanner-manual {
  flex-shrink: 0;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 14, 20, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ean-scanner-manual label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}

.ean-scanner-manual-row {
  display: flex;
  gap: 8px;
}

.ean-scanner-manual-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
}

.ean-scanner-manual-row input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.ean-scanner-manual-row button {
  flex-shrink: 0;
  border: none;
  background: linear-gradient(135deg, #0c5a88, #0c3d5c);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
