/* CONFIGURACIÓN BASE PARA ASEGURAR EL RESPONSIVE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    background-color: #f4f6f9;
    color: #333; 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

/* CONTENEDOR FLOTANTE (FAB) */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 14px;
    z-index: 9999;
}

.fab-main {
    width: 60px;
    height: 60px;
    background-color: #1a73e8;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    cursor: pointer;
    box-shadow: 0px 5px 16px rgba(0, 0, 0, 0.28);
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.fab-main:active {
    transform: scale(0.92);
}

.fab-line {
    width: 24px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.fab-container.active .fab-main { background-color: #5f6368; }
.fab-container.active .fab-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.fab-container.active .fab-line:nth-child(2) { opacity: 0; }
.fab-container.active .fab-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.btn-acceso-fab {
    color: white !important;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, visibility 0.2s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.8);
}

.fab-container.active .btn-acceso-fab {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.btn-acceso-fab:hover { transform: scale(1.04); }

.btn-fab-cashea { background-color: #007BFF; }
.btn-fab-cashea:hover { background-color: #0056b3; }
.btn-fab-deposito { background-color: #800080; }
.btn-fab-deposito:hover { background-color: #0056b3; }
.btn-fab-euromoda { background-color: #dc3545; }
.btn-fab-euromoda:hover { background-color: #bd2130; }
.btn-fab-txd { background-color: #006400; }
.btn-fab-txd:hover { background-color: #bd2130; }

@media (max-width: 360px) {
    .fab-container { bottom: 16px; right: 16px; gap: 10px; }
    .fab-main { width: 54px; height: 54px; }
    .btn-acceso-fab { padding: 10px 20px; font-size: 14px !important; min-width: 110px; }
}

.container { 
    max-width: 440px; 
    width: 100%; 
    background: white; 
    padding: 24px; 
    border-radius: 24px; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    position: relative; 
}

.app-header { text-align: center; margin-bottom: 20px; }
.app-title { color: #5f6368; font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }

#resultado { 
    display: none; 
    margin-bottom: 20px; 
    padding: 20px 14px; 
    border-radius: 20px; 
    background: #e8f0fe; 
    border: 2px solid #1a73e8; 
    text-align: center; 
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.precios-wrapper { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.price-container { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 2px; font-size: 56px; font-weight: 800; color: #2e7d32; letter-spacing: -1.5px; line-height: 1.1; }
.price-currency { margin-right: 6px; }
.price-tag { display: inline-block; }

.price-bs { font-size: 20px; font-weight: 800; color: #1a73e8; letter-spacing: -0.5px; display: none; }
.tasa-referencia { font-size: 11px; color: #666; margin-top: 4px; font-weight: 600; display: none; }

.res-row { margin-bottom: 6px; text-align: left; background: white; padding: 6px 12px; border-radius: 10px; border: 1px solid #d0e3ff; width: 100%; }
.res-row:last-child { margin-bottom: 0; }
.res-label { font-weight: 700; color: #1a73e8; display: block; margin-bottom: 1px; font-size: 10.5px; text-transform: uppercase; }
.res-data { display: block; word-break: break-word; color: #222; font-size: 14.5px; font-weight: 600; line-height: 1.2; }

.section { position: relative; }
.search-type-container { display: flex; background: #eee; padding: 3px; border-radius: 14px; margin-bottom: 16px; }
.search-type-btn { flex: 1; padding: 10px 4px; font-size: 11px; font-weight: bold; border: none; background: transparent; border-radius: 10px; cursor: pointer; color: #5f6368; transition: all 0.2s; }
.search-type-btn.active { background: #1a73e8; color: white; box-shadow: 0 2px 6px rgba(26,115,232,0.3); }

.search-input-wrapper { position: relative; width: 100%; }
input[type="text"] { width: 100%; padding: 14px 40px 14px 16px; border: 1px solid #ccc; border-radius: 14px; font-size: 16px; transition: border 0.2s; }
input[type="text"]:focus { border-color: #1a73e8; outline: none; }
.clear-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: #ddd; color: #666; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 11px; font-weight: bold; cursor: pointer; display: none; align-items: center; justify-content: center; }

.sugerencias-lista { position: absolute; left: 0; right: 0; max-height: 420px; overflow-y: auto; background: white; border: 1px solid #ccc; border-radius: 16px; box-shadow: 0 8px 16px rgba(0,0,0,0.12); z-index: 1000; display: none; margin-top: 8px; }
.sugerencia-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-bottom: 1px solid #eee; cursor: pointer; }
.sugerencia-item:last-child { border-bottom: none; border-radius: 0 0 16px 16px; }
.sugerencia-item:first-child { border-radius: 16px 16px 0 0; }
.sugerencia-item:hover { background-color: #e8f0fe; }

.sug-titulo { font-weight: bold; color: #1a73e8; font-size: 13px; line-height: 1.3; width: 100%; word-break: break-word; }
.sug-badges { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; align-items: center; justify-content: flex-start; }
.badge { font-size: 10.5px; padding: 2px 5px; border-radius: 4px; border: 1px solid #e8eaed; white-space: nowrap; font-weight: 500; }
.badge-normal { background-color: #f1f3f4; color: #444; }
.badge-precio { background-color: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; font-weight: 700; flex-shrink: 0; }
.badge-existencia { background-color: #fff3e0; color: #e65100; border-color: #ffe0b2; font-weight: 600; }

button.main-btn { width: 100%; color: white; border: none; padding: 14px; border-radius: 14px; font-size: 15px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
button.main-btn:active { transform: scale(0.99); }

.scanner-wrapper { width: 100%; max-width: 320px; margin: 16px auto 0 auto; display: none; border-radius: 16px; overflow: hidden; border: 2px solid #34a853; position: relative; background: #000; }
#reader { width: 100%; background: #000; }
.laser-line { position: absolute; top: 50%; left: 5%; width: 90%; height: 2px; background-color: red; z-index: 10; pointer-events: none; }

#status { font-size: 11.5px; font-weight: bold; color: #888; text-align: center; display: block; margin-top: 16px; }

