:root {
    --primary: #2ecc71;
    --dark: #1e272e;
    --light-bg: #f5f6fa;
    --border-color: #dcdde1;
}

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
}

.container {
    display: flex;
    height: 100vh;
}

/* Sección de Escaneo */
.scan-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.brand {
    position: absolute;
    top: 40px;
    left: 40px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.brand > a {
    color: var(--primary);
    text-decoration: none;
}

.scan-card {
    background: white;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    text-align: center;
    max-width: 500px;
}

.scan-animation {
    width: 120px;
    height: 120px;
    background: #f0fdf4;
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.laser {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(46, 204, 113, 0.5);
    top: 50%;
    animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
    0% { top: 20%; }
    50% { top: 80%; }
    100% { top: 20%; }
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
}

.btn-outline {
    border: 1px solid var(--border-color);
    background: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

/* Barra Lateral Derecha */
.cart-sidebar {
    width: 400px;
    background: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 40px 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f1f1f1;
}

.item-name {
    display: block;
    font-weight: 600;
    color: var(--dark);
}

.item-qty {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.item-price {
    font-weight: 600;
}

.checkout-footer {
    padding: 30px;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #7f8c8d;
}

.total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 20px 0;
}

.btn-pay {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
}

.btn_vuelto {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
}

.help-footer {
    position: absolute;
    bottom: 40px;
    color: #95a5a6;
}

.link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Estilos para el botón eliminar */
        .cart-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            border-bottom: 1px solid #eee;
            transition: all 0.3s ease;
        }
        .item-right {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .btn-delete {
            background: #fee2e2;
            color: #ef4444;
            border: none;
            border-radius: 6px;
            padding: 5px 10px;
            cursor: pointer;
            font-weight: bold;
            font-size: 1.1rem;
        }
        .btn-delete:hover {
            background: #ef4444;
            color: white;
        }

         /* Estilo rápido para el input oculto o estético */
        #codigo_barras {
            width: 100%;
            padding: 15px;
            font-size: 1.2rem;
            border: 2px solid #ddd;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        #codigo_barras:focus { border-color: #6366f1; outline: none; }
        #codigo_barras:focus {
    border: 2px solid #22c55e; /* Verde cuando está listo */
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

/* Estilos para el Modal */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); /* Fondo oscuro transparente */
    backdrop-filter: blur(5px); /* Efecto de desenfoque al fondo */
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.resumen-final {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 15px;
}

.resumen-final h1 {
    color: #2ecc71; /* El verde de tu botón pagar */
    margin: 10px 0 0 0;
}

.grid-metodos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.btn-metodo {
    padding: 20px 10px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-metodo:hover {
    border-color: #2ecc71;
    background-color: #f0fff4;
    transform: translateY(-3px);
}

.btn-metodo .icon {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
}

/* Teclado alfanumérico */
.teclado-virtual {
    background: #e9ecef;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 20px auto;
}

.teclado-fila {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.teclado-fila button {
    height: 50px;
    min-width: 45px;
    border: none;
    border-radius: 8px;
    background: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 0 #ccc;
    transition: all 0.1s;
}

.teclado-fila button:active {
    transform: translateY(3px);
    box-shadow: none;
    background: #f0f0f0;
}

.btn-espacio {
    flex-grow: 2; /* Hace que la barra de espacio sea más larga */
}

.btn-borrar {
    background: #ffdbdb !important;
    color: #d63031;
    min-width: 70px !important;
}

/* Contenedor principal que sube desde abajo */
.teclado-modal-inferior {
    position: fixed;
    bottom: -100%; /* Oculto inicialmente */
    left: 0;
    width: 100%;
    background: #d1d4d9;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom); /* Para móviles modernos */
}

.teclado-modal-inferior.activo {
    bottom: 0;
}

.teclado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #ccc;
}

.teclado-cuerpo {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.teclado-fila {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.teclado-fila button {
    height: 50px;
    flex: 1;
    min-width: 35px;
    max-width: 60px;
    border: none;
    border-radius: 6px;
    background: white;
    font-size: 1.2rem;
    font-weight: 500;
    box-shadow: 0 2px 0 #a5a7ab;
    cursor: pointer;
}

.teclado-fila button:active {
    background: #e2e2e2;
    transform: translateY(2px);
    box-shadow: none;
}

/* Teclas especiales */
.tecla-especial { background: #adb5bd !important; flex: 1.5 !important; max-width: 100px !important; }
.tecla-espacio { flex: 5 !important; max-width: 400px !important; }
.tecla-shift.activa { background: #2ecc71 !important; color: white; }

/* Modal rut */
.contenedor-input-rut {
    margin: 25px 0;
}

.input_vuelto {
        width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

#input_vielto:focus {
    border-color: #2ecc71;
}

#input-rut {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

#input-rut:focus {
    border-color: #2ecc71;
}

.btn-primario {
    background-color: #f0fff4 !important;
    border-color: #2ecc71 !important;
}

.btn-secundario {
    background-color: #f8f9fa !important;
    border-color: #ddd !important;
}

/* Contenedor del input para darle espacio */
.contenedor-input-rut {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

#input-rut {
    width: 90%; /* Ajusta el ancho al contenedor */
    max-width: 400px;
    padding: 20px; /* Hace que el input sea alto y fácil de tocar */
    font-size: 2rem; /* Texto grande y legible */
    font-weight: 500;
    text-align: center; /* CENTRA EL TEXTO (el RUT) */
    color: #333;
    
    /* Estilo visual de la imagen */
    border: 2px solid #e0e0e0; 
    border-radius: 15px; /* Bordes muy redondeados */
    background-color: #fff;
    outline: none; /* Quita el borde azul al hacer clic */
    transition: all 0.3s ease;
}

/* Efecto cuando el usuario está escribiendo */
#input-rut:focus {
    border-color: #2ecc71; /* Verde como tu botón de pagar */
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.1);
}

/* Estilo para el placeholder (el texto que dice Sin RUT) */
#input-rut::placeholder {
    color: #333; /* En la imagen el placeholder es oscuro y legible */
    font-weight: 400;
}

.rut-descuentos {
    font-size: .8rem;
    margin: 0;
    margin-top: -14px;
    font-style: italic;
}

/* Buscador sugerencia */
.sugerencias-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Se muestra solo cuando hay resultados */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sugerencia-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.sugerencia-item:hover {
    background-color: #f8f9fa;
    color: #2ecc71;
}

.center {
    min-width: 20px;
}