
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #e6edf5;
    color: #374151;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.header h1 {
    margin: 0;
    font-size: 56px;
    font-family: "omnes-semicond", sans-serif;
    font-weight: 700;
    color: #021738;
}

.header p {
    margin-top: 10px;
    font-size: 18px;
    color: #628395;
}


.tool-card {
    background: #f5f3ef;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    font-family: "Nunito", system-ui, sans-serif;
}

.tool-card-large {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}


.app-layout {
    min-height: 100svh; /* allow scrolling if needed */
    display: flex;
    flex-direction: column;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center; /* center cards */
}

.camera-card {
    width: 100%;
    max-width: 520px;
}

#camera-container {
    position: relative;
    width: 100%;
    height: 36vh;        /* base height (JS may override, since we have dynamic sizing) */
    max-height: 36vh;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #0a2540;
}

video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

#overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#canvas {
    display: none;
}


.photo-btn {
    margin-top: 14px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: "Nunito", system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease;
}

.photo-btn:hover {
    background: #059669;
}

.photo-btn:active {
    background: #047857;
}

.scanner-output {
    margin-top: 16px;
}

.last-scan-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

#gtin {
    font-size: 28px;
    font-weight: 700;
    color: #021738;
}


.list-card {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
}

#scan-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    max-height: 220px; /* ~5 items */
    overflow-y: auto;
}

#scan-list li {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
}


.scan-red {
    color: #7f1d1d;
    background: #fee2e2;
}

.scan-yellow {
    color: #e6c945;
    background: #fef3c7;
}

.scan-orange {
    color: #ac3912;
    background: #ffedd5;
}

.scan-green {
    color: #065f46;
    background: #d1fae5;
}


button.primary {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: "Nunito", system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease;
}

button.primary:hover {
    background: #2563eb;
}

/* mobile styling */
@media (max-width: 768px) {

    body {
        overflow-y: auto;
    }

    .container {
        padding: 16px;
    }

    .header {
        margin-bottom: 12px;
    }

    .header h1 {
        font-size: 28px;
    }

    .header p {
        font-size: 14px;
    }

    .tool-card {
        padding: 16px;
    }

    #gtin {
        font-size: 22px;
    }

    button.primary {
        margin-top: 12px;
    }
}

.price-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

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

.price-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 300px;
  text-align: center;
}

.price-box input {
  width: 100%;
  font-size: 18px;
  padding: 10px;
  margin: 12px 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.actions button {
    flex: 1;
}

button.secondary {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    background: #f5f3ef;          
    color: #7f1d1d;              
    border: 1px solid #fecaca;   
    border-radius: 8px;
    font-family: "Nunito", system-ui, sans-serif;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

button.secondary:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

/* Mobile spacing */
@media (max-width: 768px) {
    .actions {
        flex-direction: column;
    }

    button.secondary {
        margin-top: 8px;
    }
}

#scan-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.remove-item {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
}

.remove-item:hover {
    color: #7f1d1d;
    background: #fee2e2;
}
