/* ==========================================================================
   kiosk.css - Customer-facing Price Checker Kiosk
   ========================================================================== */

body.kiosk {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ---- Top bar --------------------------------------------------------- */
.kiosk-topbar {
    background: linear-gradient(120deg, var(--brand-600), var(--brand-500));
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}
.kiosk-topbar .store-brand { display: flex; align-items: center; gap: 14px; }
.kiosk-topbar .store-brand img { height: 46px; width: 46px; border-radius: 12px; background: #fff; object-fit: contain; padding: 4px; }
.kiosk-topbar .store-brand h1 { font-size: 1.25rem; margin: 0; font-weight: 800; letter-spacing: .3px; }
.kiosk-topbar .store-brand small { display: block; opacity: .85; font-weight: 500; }
.kiosk-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; text-align: right; }
.kiosk-topbar .icon-btn {
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.16); border: none; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; margin-left: 8px; transition: background .15s ease;
    text-decoration: none; cursor: pointer;
}
.kiosk-topbar .icon-btn:hover, .kiosk-topbar .icon-btn:active { background: rgba(255,255,255,.3); color: #fff; }

/* ---- Hero / search ----------------------------------------------------- */
.kiosk-hero {
    flex: 0 0 auto;
    padding: 48px 24px 32px;
    text-align: center;
}
.kiosk-hero h2 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 6px; }
.kiosk-hero p { color: var(--ink-500); margin-bottom: 26px; font-size: 1.05rem; }

.scan-shell {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
    padding: 6px;
}
.scan-shell input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 18px 24px;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink-900);
}
.scan-shell button {
    width: 64px; height: 64px; border-radius: 50%;
    border: none; background: var(--brand-500); color: #fff;
    font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.scan-shell .barcode-icon { font-size: 1.6rem; color: var(--brand-500); padding-left: 18px; }
.scan-hint { margin-top: 14px; color: var(--ink-500); font-size: .95rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.scan-hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ---- Result card --------------------------------------------------- */
.kiosk-body { flex: 1; padding: 0 24px 32px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.result-wrap { width: 100%; max-width: 920px; display: none; }
.result-wrap.show { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: translateY(0);} }

.result-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.result-card .img-pane {
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.result-card .img-pane img { max-width: 100%; max-height: 220px; object-fit: contain; }
.result-card .info-pane { padding: 28px 32px; }
.result-card h3 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; line-height: 1.2; }
.result-card .meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.result-card .meta-chip {
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px 12px; font-size: .82rem; color: var(--ink-500); font-weight: 600;
}
.brand-logo {
    width: 18px; height: 18px; border-radius: 50%; object-fit: cover;
    margin-right: 2px; vertical-align: -3px;
}
.meta-chip.brand-chip { display: inline-flex; align-items: center; gap: 4px; }
.price-lines { margin-bottom: 14px; }
.price-line {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 0;
}
.price-line + .price-line { border-top: 1px dashed var(--border); }
.price-label {
    font-size: .78rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ink-500); white-space: nowrap;
}
.price-leader {
    flex: 1 1 auto; min-width: 24px; height: 0;
    border-bottom: 2px dotted var(--border);
    margin: 0 2px; align-self: center; transform: translateY(-2px);
}
.price-amount { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-amount-retail .price-current { font-size: 2.6rem; font-weight: 900; color: var(--brand-600); }
.price-was { font-size: 1.3rem; color: var(--ink-500); text-decoration: line-through; }
.price-savings { background: #fff1e6; color: #c2540a; font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: .95rem; }
.price-line-wholesale .price-amount { font-size: 1.5rem; font-weight: 800; color: var(--ink-700); }
.stock-pill { font-weight: 700; padding: 6px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.stock-pill.in { background: var(--brand-100); color: var(--brand-700); }
.stock-pill.low { background: #fff3cd; color: #8a6100; }
.stock-pill.out { background: #fdecec; color: var(--danger); }
.disclaimer { font-size: .85rem; color: var(--ink-500); margin-top: 18px; }
.not-found-card { text-align: center; padding: 48px 24px; }
.not-found-card .bi { font-size: 3rem; color: var(--danger); margin-bottom: 12px; }

/* ---- Recent / popular rails ------------------------------------------ */
.rail-section { width: 100%; max-width: 920px; }
.rail-section h4 { font-weight: 800; font-size: 1rem; margin-bottom: 12px; color: var(--ink-700); }
.rail-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.rail-chip {
    flex: 0 0 auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px; min-width: 190px;
    cursor: pointer; transition: transform .1s ease, box-shadow .1s ease;
}
.rail-chip:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.rail-chip .name { font-weight: 700; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-chip .price { color: var(--brand-600); font-weight: 800; margin-top: 4px; }
.rail-chip .time { color: var(--ink-500); font-size: .75rem; margin-top: 4px; }

/* ---- Footer ----------------------------------------------------------- */
.kiosk-footer {
    text-align: center; padding: 14px; font-size: .85rem; color: var(--ink-500);
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .result-card { grid-template-columns: 1fr; }
    .result-card .img-pane { padding: 24px; }
    .scan-shell input { font-size: 1.1rem; padding: 14px 16px; }
    .price-amount-retail .price-current { font-size: 2rem; }
    .price-label { min-width: 0; }
    .price-leader { display: none; }
}
