.barcode-scanner-wrapper {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scanner-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.scanner-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scanner-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scanner-btn:not(:disabled):active {
    transform: scale(0.98);
}

.scanner-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.scanner-video-container {
    position: relative;
    width: 100%;
    min-height: 350px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#barcode-scanner video,
#barcode-scanner canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 480px;
    display: block;
}

#barcode-scanner canvas.drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
}

.scanner-result {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    min-height: 100px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.scanner-message {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin: 0;
    padding: 10px;
}

.scanner-error {
    text-align: center;
    font-size: 16px;
    color: #dc3545;
    font-weight: 600;
    margin: 0;
    padding: 10px;
}

.product-result {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.product-image {
    flex: 0 0 auto;
    max-width: 200px;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-info {
    flex: 1;
    min-width: 200px;
}

.product-name {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
}

.product-price {
    font-size: 20px;
    font-weight: 600;
    color: #28a745;
    margin: 10px 0;
}

.product-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.product-link:hover {
    background: #0056b3;
    color: #fff;
}

@media (max-width: 768px) {
    .barcode-scanner-wrapper {
        padding: 15px;
    }
    
    .scanner-controls {
        flex-direction: column;
    }
    
    .scanner-btn {
        width: 100%;
        min-width: auto;
    }
    
    .scanner-video-container {
        min-height: 280px;
    }
    
    .product-result {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        max-width: 100%;
    }
    
    .product-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .scanner-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .product-name {
        font-size: 18px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .scanner-video-container {
        min-height: 240px;
    }
}
