@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --background: #F0E9E9;
    --contrast: #EB606C;
    --active: #FF2E40;
    --action: #E31729;
    --green: #60B331;
    font-family: "Instrument Sans", sans-serif;
}

body {
    background-color: var(--background);

}

.validation-errors {
    color: var(--action);
    padding: 10px;
    border: 1px solid var(--action);
    border-radius: 10px;
}

.validation-errors p {
    margin: 0;
}

.button {
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: black;
}

#QR {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

#QR img {
    padding: 15px;
    background-color: var(--contrast);
    width: 50px;
    border-radius: 50px;
    cursor: pointer;
}

#barcode-scanner {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    box-sizing: border-box;
}

#barcode-scanner[hidden] {
    display: none;
}

.barcode-scanner-panel {
    width: min(420px, 100%);
    padding: 16px;
    border-radius: 8px;
    background: white;
    text-align: center;
    box-sizing: border-box;
}

#barcode-video {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 70vh;
    border-radius: 8px;
    background: black;
    object-fit: cover;
}

#barcode-status {
    margin: 12px 0;
}

#stop-scanner {
    background-color: var(--action);
}

.barcode-not-found {
    max-width: 640px;
    margin: 80px 20px;
    padding: 32px;
    border-radius: 8px;
    background: white;
    text-align: center;
}

.barcode-not-found h1 {
    margin-top: 0;
}

.barcode-not-found .button {
    display: inline-block;
    margin-top: 16px;
    background-color: var(--action);
}

.barcode-link {
    width: min(720px, calc(100% - 40px));
    margin: 60px auto;
    padding: 32px;
    border-radius: 8px;
    background: white;
    box-sizing: border-box;
}

.barcode-link h1 {
    margin-top: 0;
}

.barcode-value {
    display: inline-block;
    margin: 0 0 24px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--background);
    font-family: monospace;
}

.barcode-search-form {
    margin-bottom: 24px;
}

.barcode-search-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.barcode-search-form div {
    display: flex;
    gap: 10px;
}

.barcode-search-form input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.barcode-search-form .button,
.barcode-link-form .button {
    background-color: var(--action);
}

.barcode-product-results {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.barcode-product-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
}

.barcode-product-option:hover {
    background: #f7f7f7;
}

.barcode-product-option img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.barcode-product-option span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.barcode-product-option small {
    color: #666;
}

@media (max-width: 600px) {
    .barcode-search-form div {
        flex-direction: column;
    }
}
