body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
    background: #f4f6fa;
}

.consulta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--tema-cab-bg, #091444);
    color: var(--tema-cab-texto, #fdba55);
    padding: 0.75rem 1.15rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.consulta-header__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    text-align: left;
}

.consulta-header__logo-link {
    display: inline-flex;
    flex-shrink: 0;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.consulta-header__logo-link:hover {
    transform: scale(1.03);
}

.logo {
    height: 64px;
    width: auto;
    display: block;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
}

.consulta-header h1 {
    margin: 0;
    font-size: clamp(0.95rem, 2.2vw, 1.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--tema-cab-texto, #fdba55);
    background-color: #000;
    border: 2px solid #2e518b;
    border-radius: 50px;
    padding: 0.45rem 1rem;
    box-sizing: border-box;
    max-width: 100%;
}

.btn-inicio {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    border-radius: 25px;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tema-cab-texto, #fdba55);
    background-color: var(--tema-nav-bg, #000);
    border: 5px solid var(--tema-acento, #86a2f0);
    box-shadow: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.btn-inicio:hover {
    filter: none;
    border-color: var(--tema-cab-texto, #fdba55);
    background-color: #3d3d3d;
    transform: none;
    box-shadow: none;
}

.btn-inicio:active {
    transform: none;
}

.btn-inicio:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.btn-inicio:active {
    transform: translateY(0);
}

.btn-inicio svg {
    flex-shrink: 0;
}

main {
    padding: 20px;
}

button {
    padding: 15px 25px;
    font-size: 18px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .consulta-header {
        padding: 0.65rem 0.85rem;
    }

    .logo {
        height: 52px;
    }

    .btn-inicio {
        width: 100%;
        justify-content: center;
    }

    .consulta-header__brand {
        width: 100%;
    }
}

#result {
    margin: 20px auto 0;
    font-size: 20px;
    transition: opacity 0.5s ease;
    width: min(420px, 100%);
    min-height: 120px;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

#result.escaneando {
    width: min(320px, 100%);
    min-height: 300px;
    margin-left: auto;
    margin-right: auto;
}

#result.inexistente {
    font-size: 36px;
    font-weight: bold;
    color: red;
    text-align: center;
    margin-top: 40px;
}

#result.encontrado {
    font-size: 1rem;
    text-align: left;
    margin-top: 24px;
    color: #222;
}

.ficha-prod {
    background: #fff;
    border: 2px solid #2e518b;
    border-radius: 18px;
    padding: 1rem 1.1rem 1.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ficha-prod--ofer {
    border-color: #d97706;
    background: #fffbeb;
}

.ficha-prod--nuevo {
    border-color: #15803d;
}

.ficha-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.ficha-cod {
    font-weight: 700;
    font-size: 1rem;
}

.ficha-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.badge-ofer { background: #d97706; }
.badge-nuevo { background: #15803d; }
.badge-sinstk { background: #b91c1c; }

.ficha-img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    margin: 0 auto 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.ficha-precio-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eef2f7;
}

.ficha-precio-row--dto .ficha-val {
    color: #b45309;
}

.ficha-lbl {
    color: #64748b;
    font-size: 0.9rem;
}

.ficha-val {
    font-weight: 800;
    font-size: 1.25rem;
}

#result.encontrado .precio {
    color: #15803d;
}

.precio-dto {
    color: #b45309;
}

.aviso-sinstk {
    margin: 0.5rem 0;
    color: #b91c1c;
    font-weight: 700;
}

.ficha-detalle {
    margin: 0.75rem 0;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    border-radius: 10px;
}

.ficha-dl-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
    font-size: 0.92rem;
}

.ficha-dl-row span {
    color: #64748b;
}

.ficha-rubro {
    margin-top: 0.65rem;
    font-weight: 700;
    color: #1e3a5f;
}

.ficha-desc {
    margin-top: 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.ficha-desc1 {
    margin-top: 0.35rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.35;
}

button#scanBtn {
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button#scanBtn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

#cameraSelect {
    display: none;
    margin-top: 10px;
    font-size: 16px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}


@media (min-width: 768px) {
    .ficha-val {
        font-size: 1.45rem;
    }

    .ficha-desc {
        font-size: 1.3rem;
    }
}

@media (max-width: 767px) {
    .ficha-val {
        font-size: 1.2rem;
    }

    .ficha-desc {
        font-size: 1.1rem;
    }
}