/* Price Checker kiosk visual language - large, clear touch targets.
   Scoped entirely under .app-pricechecker so it never leaks into the other 3 PWAs,
   same convention as selfordering.css. */

.app-pricechecker {
    --pc-primary: #0f7a4d;
    --pc-primary-dark: #0a4d31;
    --pc-bg: #f4f6fa;
    --pc-card: #ffffff;
    --pc-text: #131b2e;
    --pc-muted: #6b7280;
    --pc-border: #e1e7f0;
    --pc-radius: 18px;
    --pc-radius-lg: 26px;
    --pc-shadow: 0 8px 24px rgba(10, 26, 61, 0.10);

    background: var(--pc-bg);
    color: var(--pc-text);
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
}

@media (prefers-color-scheme: dark) {
    .app-pricechecker {
        --pc-bg: #0c1220;
        --pc-card: #161e30;
        --pc-text: #eef1f8;
        --pc-muted: #9aa4b8;
        --pc-border: #2a3550;
        --pc-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
}

.app-pricechecker * {
    box-sizing: border-box;
}

/* ---------- Header ---------- */
.pricechecker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--pc-card);
    box-shadow: var(--pc-shadow);
}

.pricechecker-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.app-pricechecker .lang-toggle {
    display: flex;
    gap: 8px;
}

.app-pricechecker .lang-btn {
    border: 2px solid var(--pc-primary);
    background: transparent;
    color: var(--pc-primary);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 1rem;
    cursor: pointer;
}

.app-pricechecker .lang-btn.active {
    background: var(--pc-primary);
    color: #fff;
}

.app-pricechecker .lang-btn:active {
    transform: scale(0.95);
}

/* ---------- Login screen ---------- */
.pricechecker-login {
    max-width: 480px;
    width: 100%;
    margin: 4vh auto;
    padding: 32px;
    background: var(--pc-card);
    border-radius: var(--pc-radius-lg);
    box-shadow: var(--pc-shadow);
}

.pricechecker-login h1 {
    text-align: center;
    font-size: 1.6rem;
    color: var(--pc-primary-dark);
    margin: 0 0 22px;
}

.pricechecker-input {
    font-size: 1.3rem !important;
    padding: 18px 20px !important;
    text-align: center;
}

/* ---------- Search screen ---------- */
.pricechecker-search {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.pricechecker-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.pricechecker-welcome {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pc-muted);
}

/* ---------- Two-column layout (left: search/keypad, right: results) ---------- */
.pricechecker-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) 1fr;
    gap: 18px;
    align-items: start;
}

.pricechecker-left-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 16px;
}

.pricechecker-results-panel {
    min-width: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-inline-end: 4px;
}

@media (max-width: 860px) {
    .pricechecker-layout {
        grid-template-columns: 1fr;
    }

    .pricechecker-left-panel {
        position: static;
    }

    .pricechecker-results-panel {
        max-height: none;
        overflow-y: visible;
    }
}

/* Phone screens: shrink the numpad so it doesn't push the results below the fold -
   just big enough to tap accurately, not a full desktop-sized keypad. */
@media (max-width: 600px) {
    .pc-numpad {
        gap: 8px;
        padding: 10px;
        max-width: 300px;
    }

    .pc-numpad-row {
        gap: 8px;
    }

    .pc-numpad-key {
        min-height: 0;
        font-size: 1.3rem;
        border-radius: 12px;
    }

    .pc-numpad-key svg {
        width: 20px;
        height: 20px;
    }
}

.pricechecker-search-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pricechecker-search-input {
    flex: 1;
    min-width: 0;
    letter-spacing: 1px;
}

.pricechecker-search-box .btn-primary,
.pricechecker-search-box .btn-secondary {
    width: auto;
    flex: 0 0 auto;
    padding: 14px 24px;
    font-size: 1rem;
}

/* Narrow screens: text box gets its own full-width row, buttons share the row below it. */
@media (max-width: 480px) {
    .pricechecker-search-input {
        flex-basis: 100%;
    }

    .pricechecker-search-box .btn-primary,
    .pricechecker-search-box .btn-secondary {
        flex: 1 1 0;
    }
}

.pricechecker-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 14px;
    background: var(--pc-card);
    border: 1.5px solid var(--pc-border);
    border-radius: var(--pc-radius);
}

.app-pricechecker .pricechecker-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pc-text);
    cursor: pointer;
    user-select: none;
}

.app-pricechecker .pricechecker-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--pc-primary);
    cursor: pointer;
}

.pricechecker-toolbar {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.pricechecker-toolbar .btn-secondary {
    width: auto;
    padding: 10px 20px;
}

.pc-camera-video {
    width: 100%;
    max-height: 60vh;
    border-radius: var(--co-radius-sm, 11px);
    background: #000;
    margin: 12px 0;
}

/* ---------- Alpha keyboard ---------- */
.alpha-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--pc-card);
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-shadow);
    padding: 14px;
    margin-bottom: 20px;
}

.alpha-keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.alpha-key {
    flex: 1;
    min-height: 52px;
    max-width: 68px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 1.5px solid var(--pc-border);
    border-radius: 12px;
    background: var(--pc-bg);
    cursor: pointer;
    transition: all .15s ease;
}

.alpha-key:hover { border-color: var(--pc-primary); transform: translateY(-1px); }
.alpha-key:active { transform: scale(0.95); }

.alpha-key-wide {
    max-width: 110px;
    flex: 1.6;
}

.alpha-key.active {
    background: var(--pc-primary);
    color: #fff;
}

.alpha-key-space {
    flex: 4;
    max-width: none;
}

/* ---------- Numpad (search screen) ---------- */
.pc-numpad {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--pc-card);
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-shadow);
    padding: 20px;
    margin-bottom: 20px;
    max-width: 460px;
    width: 100%;
    margin-inline: auto;
}

.pc-numpad-row {
    display: flex;
    gap: 14px;
}

.pc-numpad-key {
    flex: 1;
    aspect-ratio: 1;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    border: 1.5px solid var(--pc-border);
    border-radius: 16px;
    background: var(--pc-bg);
    color: var(--pc-text);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease, color .15s ease;
}

.pc-numpad-key svg { width: 30px; height: 30px; }

.pc-numpad-key:focus-visible { outline: 2px solid var(--pc-primary); outline-offset: 2px; }
.pc-numpad-key:hover { border-color: var(--pc-primary); }
.pc-numpad-key:active { transform: scale(0.95); background: var(--pc-primary); color: #fff; }

.pc-numpad-backspace { color: var(--co-danger, #e5484d); }
.pc-numpad-backspace:active { color: #fff; }

/* ---------- Result card ---------- */
.pricechecker-result-card {
    background: var(--pc-card);
    border-radius: var(--pc-radius-lg);
    box-shadow: var(--pc-shadow);
    padding: 28px;
    text-align: center;
    animation: pc-scale-in .2s ease;
}

.pricechecker-result-card h2 {
    font-size: 1.8rem;
    margin: 0 0 8px;
}

.pricechecker-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pricechecker-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--pc-bg);
    color: var(--pc-muted);
    border: 1px solid var(--pc-border);
}

.pricechecker-badge-category {
    background: var(--pc-primary);
    color: #fff;
    border-color: var(--pc-primary);
}

.pricechecker-item-image {
    display: block;
    max-width: 220px;
    max-height: 220px;
    margin: 0 auto 16px;
    border-radius: var(--pc-radius);
    object-fit: contain;
    background: var(--pc-bg);
}

.pricechecker-description {
    color: var(--pc-muted);
    margin: 0 0 14px;
}

.pricechecker-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 10px;
    border-top: 1px solid var(--pc-border);
    font-size: 1.3rem;
}

.pricechecker-price-label {
    color: var(--pc-muted);
    font-weight: 700;
}

.pricechecker-price-value {
    font-weight: 800;
    color: var(--pc-primary-dark);
    font-size: 1.6rem;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.pricechecker-price-before {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--pc-muted);
    text-decoration: line-through;
}

.pricechecker-price-after {
    color: var(--co-danger, #e5484d);
}

.pricechecker-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pricechecker-results-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pc-text);
}

.pricechecker-results-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pc-muted);
    background: var(--pc-bg);
    border: 1px solid var(--pc-border);
    border-radius: 999px;
    padding: 3px 12px;
}

.pricechecker-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricechecker-result-card-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: start;
    padding: 12px 16px;
    border-radius: var(--pc-radius);
    border: 1.5px solid var(--pc-border);
    background: var(--pc-card);
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}

.pricechecker-result-card-mini:hover {
    border-color: var(--pc-primary);
    transform: translateY(-1px);
}

.pricechecker-result-thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--pc-bg);
}

.pricechecker-result-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--pc-muted);
}

.pricechecker-result-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pricechecker-result-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pc-text);
}

.pricechecker-result-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pricechecker-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    text-align: center;
}

.pricechecker-state-icon {
    font-size: 2.4rem;
    opacity: .5;
}

.pricechecker-qty-section {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 2px solid var(--pc-border);
}

.pricechecker-qty-section h3 {
    font-size: 1.1rem;
    color: var(--pc-muted);
    margin: 8px 0 6px;
}

.pricechecker-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    font-size: 1.1rem;
}

.pricechecker-qty-storage { color: var(--pc-text); }
.pricechecker-qty-value { font-weight: 700; }

.pricechecker-qty-total-row {
    border-top: 1px dashed var(--pc-border);
    margin-top: 4px;
    font-size: 1.25rem;
}
.pricechecker-qty-total-row .pricechecker-qty-value { color: var(--pc-primary-dark); font-weight: 800; }

@keyframes pc-scale-in {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
