/* 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; 
    color: #333; 
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    touch-action: manipulation; 
}

/* 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; 
    padding-bottom: 70px; /* IMPORTANTE: Da espacio para que la barra inferior no tape el contenido */
}

/* 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; 
}
.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; }

/* 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; }

/* BARRA DE ESTADO FIJADA EN LA PARTE INFERIOR */
#status { 
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff; 
    padding: 15px 20px;
    font-size: 12.5px; 
    font-weight: 600; 
    color: #5f6368; 
    text-align: center; 
    z-index: 9999;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05); 
    border-top: 1px solid #e8eaed;
}
