/* 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: #f4f7fa; /* Un gris muy suave para que las tarjetas blancas resalten */
    color: #333; 
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    touch-action: manipulation; 
}

/* 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 6px 20px rgba(26, 115, 232, 0.4);
    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: #3c4043; box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3); }
.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: 14px !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: #5c005c; }
.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: #004200; }

@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: 13px !important; min-width: 110px; }
}

/* REDISEÑO DEL CONTENEDOR PRINCIPAL Y DISTRIBUCIÓN */
.container { 
    width: 100%; 
    max-width: 600px;
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    background: transparent; 
    position: relative; 
}

/* CABECERA CON COLOR PARA LLENAR EL ESPACIO SUPERIOR */
.app-header { 
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    text-align: center; 
    padding: 40px 20px 60px 20px; 
    border-radius: 0 0 32px 32px;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.2);
    margin-bottom: -30px; /* Crea el efecto de que el buscador flota sobre el encabezado */
}
.app-title { 
    color: #ffffff; 
    font-size: 22px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

/* SECCIÓN DE BÚSQUEDA FLOTANTE (ESTILO TARJETA) */
.section { 
    background: #ffffff;
    margin: 0 20px 20px 20px;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative; 
    z-index: 10;
}

.search-type-container { 
    display: flex; 
    background: #f1f3f4; 
    padding: 5px; 
    border-radius: 16px; 
    margin-bottom: 24px; 
}
.search-type-btn { 
    flex: 1; 
    padding: 12px 4px; 
    font-size: 11.5px; 
    font-weight: bold; 
    border: none; 
    background: transparent; 
    border-radius: 12px; 
    cursor: pointer; 
    color: #5f6368; 
    transition: all 0.2s ease; 
}
.search-type-btn.active { 
    background: #1a73e8; 
    color: white; 
    box-shadow: 0 4px 12px rgba(26,115,232,0.3); 
}

.search-input-wrapper { position: relative; width: 100%; }
input[type="text"] { 
    width: 100%; 
    padding: 18px 44px 18px 20px; 
    border: 2px solid #e8eaed; 
    border-radius: 16px; 
    font-size: 17px; 
    background-color: #fafafa; 
    color: #202124;
    transition: all 0.3s ease; 
}
input[type="text"]:focus { 
    border-color: #1a73e8; 
    background-color: #ffffff;
    outline: none; 
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1); 
}
.clear-btn { 
    position: absolute; 
    right: 14px; 
    top: 50%; 
    transform: translateY(-50%); 
    background: #e8eaed; 
    color: #5f6368; 
    border: none; 
    border-radius: 50%; 
    width: 26px; 
    height: 26px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer; 
    display: none; 
    align-items: center; 
    justify-content: center; 
}

/* LISTA DE SUGERENCIAS */
.sugerencias-lista { 
    position: absolute; 
    top: 100%;
    left: 0; 
    right: 0; 
    max-height: 55vh; 
    overflow-y: auto; 
    background: white; 
    border: 1px solid #e8eaed; 
    border-radius: 16px; 
    box-shadow: 0 12px 35px rgba(0,0,0,0.15); 
    z-index: 1000; 
    display: none; 
    margin-top: 12px; 
}
.sugerencia-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-bottom: 1px solid #f1f3f4; 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: #f8f9fa; }

.sug-titulo { font-weight: 700; color: #202124; font-size: 14px; line-height: 1.4; 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: 11px; padding: 4px 8px; border-radius: 6px; border: 1px solid #e8eaed; white-space: nowrap; font-weight: 600; }
.badge-normal { background-color: #f1f3f4; color: #5f6368; border-color: transparent; }
.badge-precio { background-color: #e8f5e9; color: #1e8e3e; border-color: #c8e6c9; font-weight: 800; flex-shrink: 0; }
.badge-existencia { background-color: #fff3e0; color: #d93025; border-color: #ffe0b2; }

/* RESULTADOS (MISMO ESTILO FLOTANTE) */
#resultado { 
    display: none; 
    background: #ffffff; 
    margin: 0 20px 20px 20px; 
    padding: 28px 20px; 
    border-radius: 24px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 2px solid #1a73e8; 
    text-align: center; 
    position: relative;
    z-index: 10;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.res-row { margin-bottom: 8px; text-align: left; background: #f8f9fa; padding: 12px 16px; border-radius: 12px; border: 1px solid #e8eaed; width: 100%; }
.res-row:last-child { margin-bottom: 0; }
.res-label { font-weight: 700; color: #1a73e8; display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.res-data { display: block; word-break: break-word; color: #202124; font-size: 15px; font-weight: 600; line-height: 1.3; }

/* EMPUJAR EL ESTADO AL FONDO DE LA PANTALLA */
#status { 
    margin-top: auto; /* Esto es la magia para usar el espacio en blanco */
    padding: 24px;
    font-size: 12.5px; 
    font-weight: 600; 
    color: #80868b; 
    text-align: center; 
    display: block; 
}
