/* Turbo POS camera scanner overlay. Full-screen so a cashier can scan several
   items in a row; the cart updates behind it and each hit shows in the status. */

.trps-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .82);
    padding: 16px;
    box-sizing: border-box;
}

.trps-scan-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: #111;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.trps-scan-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.trps-scan-close:hover {
    background: rgba(255, 255, 255, .3);
}

.trps-scan-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.trps-scan-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* A scan window drawn over the video to help the operator aim. */
.trps-scan-reticle {
    position: absolute;
    inset: 18% 12%;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 12px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28);
    pointer-events: none;
}

.trps-scan-status {
    margin: 12px 4px 4px;
    color: #fff;
    font-size: 15px;
    text-align: center;
    min-height: 1.2em;
    word-break: break-all;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not (aspect-ratio: 4 / 3) {
    .trps-scan-stage {
        height: 320px;
    }
}

/* Camera scan button in the search toolbar. Matches the round icon buttons of
   the POS header; toggled with display via JS, so no display rule here. */
#pos-camera-scan-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    cursor: pointer;
    /* Centred with line-height/vertical-align rather than flex: the button is
       toggled with jQuery .show(), which restores inline-block, not flex. */
    line-height: 34px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 8px;
    transition: background .15s ease;
}

#pos-camera-scan-btn:hover {
    background: rgba(255, 255, 255, .32);
}

#pos-camera-scan-btn svg {
    display: inline-block;
    vertical-align: middle;
}
