/**
 * Estilos para el Sistema de Cola de Pedidos
 */

/* Badge flotante con contador de pedidos pendientes */
.cola-badge {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse 2s infinite;
}

.cola-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(238, 90, 111, 0.6);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Modal de cola de pedidos */
.cola-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.cola-modal-contenido {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

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

.cola-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e0e7ef;
}

.cola-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #1a2a3a;
}

.cola-modal-cerrar {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    padding: 0;
}

.cola-modal-cerrar:hover {
    background: #f0f0f0;
    color: #333;
}

.cola-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.cola-vacia {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 1.1rem;
}

.cola-pedido-item {
    background: #f9f9fb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1.5px solid #e0e7ef;
    transition: border-color 0.2s;
}

.cola-pedido-item:hover {
    border-color: #0073aa;
}

.cola-pedido-item[data-estado="procesando"] {
    border-color: #ffc107;
    background: #fffbf0;
}

.cola-pedido-item[data-estado="error"] {
    border-color: #ff6b6b;
    background: #fff5f5;
}

.cola-pedido-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.cola-pedido-info strong {
    font-size: 1.1rem;
    color: #1a2a3a;
}

.cola-pedido-fecha,
.cola-pedido-cliente,
.cola-pedido-items {
    font-size: 0.9rem;
    color: #666;
}

.cola-pedido-estado {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.cola-estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

.cola-estado-pendiente {
    background: #e3f2fd;
    color: #1976d2;
}

.cola-estado-procesando {
    background: #fff3cd;
    color: #856404;
}

.cola-estado-error {
    background: #f8d7da;
    color: #721c24;
}

.cola-pedido-intentos {
    font-size: 0.85rem;
    color: #666;
}

.cola-pedido-error {
    font-size: 0.85rem;
    color: #dc3545;
    background: #f8d7da;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 6px;
}

.cola-pedido-acciones {
    display: flex;
    gap: 8px;
}

.cola-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid #e0e7ef;
}

.btn-mini {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    background: #0073aa;
    color: #fff;
}

.btn-mini:hover {
    background: #005d8b;
    transform: scale(1.02);
}

.btn-mini:active {
    transform: scale(0.98);
}

.btn-mini.btn-peligro {
    background: #dc3545;
    color: #fff;
}

.btn-mini.btn-peligro:hover {
    background: #c82333;
}

.btn-secundario {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    background: #6c757d;
    color: #fff;
    flex: 1;
}

.btn-secundario:hover {
    background: #5a6268;
}

.btn-peligro {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    background: #dc3545;
    color: #fff;
    flex: 1;
}

.btn-peligro:hover {
    background: #c82333;
}

/* Notificaciones toast */
.cola-notificacion {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #fff;
    color: #333;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 1rem;
    font-weight: 500;
    max-width: 90%;
    text-align: center;
    transition: transform 0.3s ease;
}

.cola-notificacion-visible {
    transform: translateX(-50%) translateY(0);
}

.cola-notificacion-success {
    border-left: 4px solid #28a745;
}

.cola-notificacion-error {
    border-left: 4px solid #dc3545;
}

.cola-notificacion-info {
    border-left: 4px solid #0073aa;
}

/* Responsive */
@media (max-width: 600px) {
    .cola-modal-contenido {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }

    .cola-badge {
        bottom: 70px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .cola-modal-header h3 {
        font-size: 1.2rem;
    }

    .cola-pedido-acciones {
        flex-direction: column;
    }

    .cola-modal-footer {
        flex-direction: column;
    }
}
