body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f4f4;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 10px;
}

.logo {
    width: 50px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.8;
}

/* Search bar */
#search {
    width: 92%;
    margin: 10px auto;
    padding: 12px;
    display: block;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
}

/* Scan button */
.scan-btn {
    width: 92%;
    margin: 5px auto 15px auto;
    padding: 12px;
    background: #ec0928;
    color: white;
    border: none;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
    display: block;
}

/* Clear button */
.clear-btn {
    width: 92%;
    margin: 5px auto 15px auto;
    padding: 12px;
    background: #333;
    color: white;
    border: none;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
    display: block;
}

.clear-btn.hidden {
    display: none;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    background: white;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.tabs button {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
}

.tabs .active {
    border-bottom: 3px solid #ec0928;
    color: black;
}

/* Line filters */
.line-filter {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 10px;
    white-space: nowrap;
}

.line-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: #eee;
    cursor: pointer;
}

.line-pill.active {
    background: #ec0928;
    color: white;
}

/* Product cards */
.product-card {
    background: white;
    width: 92%;
    margin: 10px auto;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    gap: 12px;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9f9f9;
    flex-shrink: 0;
}

.product-content {
    flex: 1;
    min-width: 0;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

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

.product-price {
    color: #ec0928;
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.product-description {
    color: #333;
}

.highlight {
    animation: glow 1s ease-in-out 2;
}

@keyframes glow {
    0% { background: #ffeeee; }
    50% { background: #ffdada; }
    100% { background: white; }
}

/* Product Lines View */
.product-line-card {
    background: white;
    width: 92%;
    margin: 10px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.line-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.line-card-header strong {
    font-size: 18px;
    color: #333;
}

.line-card-price {
    color: #ec0928;
    font-size: 24px;
    font-weight: bold;
}

.line-card-count {
    color: #666;
    font-size: 14px;
}

/* Scanner Modal */
.scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.scanner-modal.hidden {
    display: none;
}

.scanner-header {
    background: white;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-close-btn {
    background: #ec0928;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
}

#scanner-reader {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Scan overlay with targeting guide */
.scanner-overlay {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 180px;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.scan-region {
    width: 80%;
    max-width: 400px;
    height: 150px;
    border: 3px solid #ec0928;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    position: relative;
}

.scan-region::before,
.scan-region::after {
    content: '';
    position: absolute;
    background: #ec0928;
}

/* Crosshair corners */
.scan-region::before {
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
}

.scan-region::after {
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
}

.scanner-instructions {
    background: #1a1a1a;
    padding: 20px;
    color: white;
    text-align: center;
}

.scanner-instructions p {
    margin: 0 0 15px 0;
    opacity: 0.9;
    font-size: 16px;
}

.manual-entry {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

#manual-upc {
    flex: 1;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #2a2a2a;
    color: white;
    font-size: 16px;
}

#manual-upc::placeholder {
    color: #888;
}

#manual-submit {
    padding: 12px 24px;
    background: #ec0928;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

#manual-submit:active {
    background: #d00820;
}